diff options
Diffstat (limited to 'views/default/input')
23 files changed, 646 insertions, 624 deletions
diff --git a/views/default/input/access.php b/views/default/input/access.php index 461fbf625..42247af61 100644 --- a/views/default/input/access.php +++ b/views/default/input/access.php @@ -1,55 +1,53 @@ <?php - - /** - * Elgg access level input - * Displays a pulldown input field - * - * @package Elgg - * @subpackage Core - - * @author Curverider Ltd - - * @link http://elgg.org/ - * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * - */ - - if (isset($vars['class'])) $class = $vars['class']; - if (!$class) $class = "input-access"; - - if (!array_key_exists('value', $vars) || $vars['value'] == ACCESS_DEFAULT) - $vars['value'] = get_default_access(); - - - if ((!isset($vars['options'])) || (!is_array($vars['options']))) - { - $vars['options'] = array(); - $vars['options'] = get_write_access_array(); +/** + * Elgg access level input + * Displays a pulldown input field + * + * @package Elgg + * @subpackage Core + + * @author Curverider Ltd + + * @link http://elgg.org/ + * + * @uses $vars['value'] The current value, if any + * @uses $vars['js'] Any Javascript to enter into the input tag + * @uses $vars['internalname'] The name of the input field + * + */ + +if (isset($vars['class'])) { + $class = $vars['class']; +} +if (!$class) { + $class = "input-access"; +} + +if (!array_key_exists('value', $vars) || $vars['value'] == ACCESS_DEFAULT) { + $vars['value'] = get_default_access(); +} + + +if ((!isset($vars['options'])) || (!is_array($vars['options']))) { + $vars['options'] = array(); + $vars['options'] = get_write_access_array(); +} + +if (is_array($vars['options']) && sizeof($vars['options']) > 0) { + ?> + + <select <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['js'])) echo $vars['js']; ?> <?php if ((isset($vars['disabled'])) && ($vars['disabled'])) echo ' disabled="yes" '; ?> class="<?php echo $class; ?>"> + <?php + + foreach($vars['options'] as $key => $option) { + if ($key != $vars['value']) { + echo "<option value=\"{$key}\">". htmlentities($option, ENT_QUOTES, 'UTF-8') ."</option>"; + } else { + echo "<option value=\"{$key}\" selected=\"selected\">". htmlentities($option, ENT_QUOTES, 'UTF-8') ."</option>"; } - - if (is_array($vars['options']) && sizeof($vars['options']) > 0) { - -?> - -<select <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['js'])) echo $vars['js']; ?> <?php if ((isset($vars['disabled'])) && ($vars['disabled'])) echo ' disabled="yes" '; ?> class="<?php echo $class; ?>"> -<?php - - foreach($vars['options'] as $key => $option) { - if ($key != $vars['value']) { - echo "<option value=\"{$key}\">". htmlentities($option, ENT_QUOTES, 'UTF-8') ."</option>"; - } else { - echo "<option value=\"{$key}\" selected=\"selected\">". htmlentities($option, ENT_QUOTES, 'UTF-8') ."</option>"; - } - } - -?> -</select> - -<?php - - } + } -?>
\ No newline at end of file + ?> + </select> + <?php +}
\ No newline at end of file diff --git a/views/default/input/autocomplete.php b/views/default/input/autocomplete.php index 052219a1b..7dc088d0e 100644 --- a/views/default/input/autocomplete.php +++ b/views/default/input/autocomplete.php @@ -1,56 +1,59 @@ <?php +/** + * Displays an autocomplete text input. + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + * @TODO: This currently only works for ONE AUTOCOMPLETE TEXT FIELD on a page. + * + * @uses $vars['value'] The current value, if any + * @uses $vars['js'] Any Javascript to enter into the input tag + * @uses $vars['internalname'] The name of the input field + * @uses $vars['match_on'] Array | str What to match on. all|array(group|user|friend|subtype) + * @uses $vars['match_owner'] Bool. Match only entities that are owned by logged in user. + * + */ + +global $autocomplete_js_loaded; + +$internalname = $vars['internalname']; +$value = $vars['value']; + +if(!$value) { + $value= ''; +} + +if($vars['internal_id']) { + $id_autocomplete = $vars['internal_id']; +} + +$ac_url_params = http_build_query(array( + 'match_on' => $vars['match_on'], + 'match_owner' => $vars['match_owner'], +)); +$ac_url = $vars['url'] . 'pg/autocomplete?' . $ac_url_params; + +if (!isset($autocomplete_js_loaded)) { + $autocomplete_js_loaded = false; +} - /** - * Displays an autocomplete text input. - * - * @package Elgg - * @subpackage Core - * @author Curverider Ltd - * @link http://elgg.org/ - * - * @TODO: This currently only works for ONE AUTOCOMPLETE TEXT FIELD on a page. - * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * @uses $vars['match_on'] Array | str What to match on. all|array(group|user|friend|subtype) - * @uses $vars['match_owner'] Bool. Match only entities that are owned by logged in user. - * - */ - - global $autocomplete_js_loaded; - - $internalname = $vars['internalname']; - $value = $vars['value']; - - if(!$value) - $value= ''; - - if($vars['internal_id']) - $id_autocomplete = $vars['internal_id']; - - $ac_url_params = http_build_query(array( - 'match_on' => $vars['match_on'], - 'match_owner' => $vars['match_owner'], - )); - $ac_url = $vars['url'] . 'pg/autocomplete?' . $ac_url_params; - - if (!isset($autocomplete_js_loaded)) $autocomplete_js_loaded = false; - ?> <!-- show the input --> - <input type="text" class='autocomplete' name ='<?php echo $internalname; ?>_autocomplete' value='<?php echo $value?>' /> - <input type="hidden" name="<?php echo $internalname; ?>" value='<?php echo $value; ?>' /> - +<input type="text" class='autocomplete' name ='<?php echo $internalname; ?>_autocomplete' value='<?php echo $value?>' /> +<input type="hidden" name="<?php echo $internalname; ?>" value='<?php echo $value; ?>' /> + <?php - if (!$autocomplete_js_loaded) { -?> +if (!$autocomplete_js_loaded) { + ?> -<!-- include autocomplete --> -<script language="javascript" type="text/javascript" src="<?php echo $vars['url']; ?>vendors/jquery/jquery.autocomplete.min.js"></script> -<script type="text/javascript"> -function bindAutocomplete() { + <!-- include autocomplete --> + <script language="javascript" type="text/javascript" src="<?php echo $vars['url']; ?>vendors/jquery/jquery.autocomplete.min.js"></script> + <script type="text/javascript"> + function bindAutocomplete() { $('input[type=text].autocomplete').autocomplete("<?php echo $ac_url; ?>", { minChars: 1, matchContains: true, @@ -58,13 +61,13 @@ function bindAutocomplete() { formatItem: function(row, i, max, term) { eval("var info = " + row + ";"); var r = ''; - + switch (info.type) { case 'user': case 'group': r = info.icon + info.name + ' - ' + info.desc; break; - + default: r = info.name + ' - ' + info.desc; break; @@ -80,20 +83,20 @@ function bindAutocomplete() { var hidden = $(this).next(); hidden.val(info.guid); }); -} + } -$(document).ready(function() { + $(document).ready(function() { bindAutocomplete(); -}); + }); -</script> + </script> -<?php + <?php - $autocomplete_js_loaded = true; - } else { -?> -<!-- rebind autocomplete --> -<script type="text/javascript">bindAutocomplete();</script> -<?php - }
\ No newline at end of file + $autocomplete_js_loaded = true; +} else { + ?> + <!-- rebind autocomplete --> + <script type="text/javascript">bindAutocomplete();</script> + <?php +}
\ No newline at end of file diff --git a/views/default/input/button.php b/views/default/input/button.php index 4a21a3127..0a65feb82 100644 --- a/views/default/input/button.php +++ b/views/default/input/button.php @@ -1,39 +1,59 @@ <?php - /** - * Create a input button - * Use this view for forms rather than creating a submit/reset button tag in the wild as it provides - * extra security which help prevent CSRF attacks. - * - * @package Elgg - * @subpackage Core - * @author Curverider Ltd - * @link http://elgg.org/ - * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * @uses $vars['type'] Submit or reset, defaults to submit. - * @uses $vars['src'] Src of an image - * - */ +/** + * Create a input button + * Use this view for forms rather than creating a submit/reset button tag in the wild as it provides + * extra security which help prevent CSRF attacks. + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + * @uses $vars['value'] The current value, if any + * @uses $vars['js'] Any Javascript to enter into the input tag + * @uses $vars['internalname'] The name of the input field + * @uses $vars['type'] Submit or reset, defaults to submit. + * @uses $vars['src'] Src of an image + * + */ - global $CONFIG; - - if (isset($vars['class'])) $class = $vars['class']; - if (!$class) $class = "submit_button"; +global $CONFIG; - if (isset($vars['type'])) { $type = strtolower($vars['type']); } else { $type = 'submit'; } - switch ($type) - { - case 'button' : $type='button'; break; - case 'reset' : $type='reset'; break; - case 'submit': - default: $type = 'submit'; - } - - $value = htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); - if (isset($vars['internalname'])) $name = $vars['internalname']; - if (isset($vars['src'])) $src = "src=\"{$vars['src']}\""; - if (strpos($src,$CONFIG->wwwroot)===false) $src = ""; // blank src if trying to access an offsite image. +if (isset($vars['class'])) { + $class = $vars['class']; +} +if (!$class) { + $class = "submit_button"; +} + +if (isset($vars['type'])) { + $type = strtolower($vars['type']); +} else { + $type = 'submit'; +} + +switch ($type) { + case 'button' : + $type='button'; + break; + case 'reset' : + $type='reset'; + break; + case 'submit': + default: + $type = 'submit'; +} + +$value = htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); +if (isset($vars['internalname'])) { + $name = $vars['internalname']; +} +if (isset($vars['src'])) { + $src = "src=\"{$vars['src']}\""; +} +// blank src if trying to access an offsite image. +if (strpos($src,$CONFIG->wwwroot)===false) { + $src = ""; +} ?> <input name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> type="<?php echo $type; ?>" class="<?php echo $class; ?>" <?php echo $vars['js']; ?> value="<?php echo $value; ?>" <?php echo $src; ?> />
\ No newline at end of file diff --git a/views/default/input/calendar.php b/views/default/input/calendar.php index 9dd5b2dc0..12cbf95ec 100644 --- a/views/default/input/calendar.php +++ b/views/default/input/calendar.php @@ -1,44 +1,40 @@ -<?php +<?php +/** + * Elgg calendar input + * Displays a calendar input field + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + * @uses $vars['value'] The current value, if any + * @uses $vars['js'] Any Javascript to enter into the input tag + * @uses $vars['internalname'] The name of the input field + * + */ - /** - * Elgg calendar input - * Displays a calendar input field - * - * @package Elgg - * @subpackage Core +static $calendarjs; +if (empty($calendarjs)) { + echo <<< END - * @author Curverider Ltd - - * @link http://elgg.org/ - * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * - */ - - static $calendarjs; - if (empty($calendarjs)) { - - echo <<< END - <script language="JavaScript" src="{$vars['url']}vendors/calendarpopup/CalendarPopup.js"></script> - + END; - $calendarjs = 1; - } - $strippedname = sanitise_string($vars['internalname']); - $js = "cal" . $strippedname; + $calendarjs = 1; +} +$strippedname = sanitise_string($vars['internalname']); +$js = "cal" . $strippedname; + +if ($vars['value'] > 86400) { + $val = date("F j, Y",$vars['value']); +} else { + $val = $vars['value']; +} - if ($vars['value'] > 86400) { - $val = date("F j, Y",$vars['value']); - } else { - $val = $vars['value']; - } - ?> <script language="JavaScript"> - var cal<?php echo $strippedname; ?> = new CalendarPopup(); +var cal<?php echo $strippedname; ?> = new CalendarPopup(); </script> <input type="text" <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" id="<?php echo $strippedname; ?>" value="<?php echo $val; ?>" /> -<a href="#" onclick="<?php echo $js; ?>.select(document.getElementById('<?php echo $strippedname; ?>'),'anchor<?php echo $strippedname; ?>','MMM dd, yyyy'); return false;" TITLE="<?php echo $js; ?>.select(document.forms[0].<?php echo $strippedname; ?>,'anchor<?php echo $strippedname; ?>','MMM dd, yyyy'); return false;" NAME="anchor<?php echo $strippedname; ?>" ID="anchor<?php echo $strippedname; ?>">select</a>
\ No newline at end of file +<a href="#" onclick="<?php echo $js; ?>.select(document.getElementById('<?php echo $strippedname; ?>'),'anchor<?php echo $strippedname; ?>','MMM dd, yyyy'); return false;" TITLE="<?php echo $js; ?>.select(document.forms[0].<?php echo $strippedname; ?>,'anchor<?php echo $strippedname; ?>','MMM dd, yyyy'); return false;" NAME="anchor<?php echo $strippedname; ?>" ID="anchor<?php echo $strippedname; ?>">select</a>
\ No newline at end of file diff --git a/views/default/input/captcha.php b/views/default/input/captcha.php index f4ebc218a..d1d780e77 100644 --- a/views/default/input/captcha.php +++ b/views/default/input/captcha.php @@ -1,10 +1,10 @@ <?php - /** - * This view provides a hook for third parties to provide captcha behaviour. - * - * @package Elgg - * @subpackage Core - * @author Curverider Ltd - * @link http://elgg.org/ - */ +/** + * This view provides a hook for third parties to provide captcha behaviour. + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + */ ?>
\ No newline at end of file diff --git a/views/default/input/checkboxes.php b/views/default/input/checkboxes.php index 4e806bbfc..7d03db257 100644 --- a/views/default/input/checkboxes.php +++ b/views/default/input/checkboxes.php @@ -1,52 +1,49 @@ <?php +/** + * Elgg checkbox input + * Displays a checkbox input field + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + * @uses $vars['value'] The current value, if any + * @uses $vars['js'] Any Javascript to enter into the input tag + * @uses $vars['internalname'] The name of the input field + * @uses $vars['options'] An array of strings representing the label => options for the checkbox field + * + */ - /** - * Elgg checkbox input - * Displays a checkbox input field - * - * @package Elgg - * @subpackage Core +$class = $vars['class']; +if (!$class) { + $class = "input-checkboxes"; +} - * @author Curverider Ltd +foreach($vars['options'] as $label => $option) { + //if (!in_array($option,$vars['value'])) { + if (is_array($vars['value'])) { + $valarray = $vars['value']; + $valarray = array_map('strtolower', $valarray); + if (!in_array(strtolower($option),$valarray)) { + $selected = ""; + } else { + $selected = "checked = \"checked\""; + } + } else { + if (strtolower($option) != strtolower($vars['value'])) { + $selected = ""; + } else { + $selected = "checked = \"checked\""; + } + } + $labelint = (int) $label; + if ("{$label}" == "{$labelint}") { + $label = $option; + } - * @link http://elgg.org/ - * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * @uses $vars['options'] An array of strings representing the label => options for the checkbox field - * - */ - - $class = $vars['class']; - if (!$class) $class = "input-checkboxes"; - - foreach($vars['options'] as $label => $option) { - //if (!in_array($option,$vars['value'])) { - if (is_array($vars['value'])) { - $valarray = $vars['value']; - $valarray = array_map('strtolower', $valarray); - if (!in_array(strtolower($option),$valarray)) { - $selected = ""; - } else { - $selected = "checked = \"checked\""; - } - } else { - if (strtolower($option) != strtolower($vars['value'])) { - $selected = ""; - } else { - $selected = "checked = \"checked\""; - } - } - $labelint = (int) $label; - if ("{$label}" == "{$labelint}") { - $label = $option; - } - - if (isset($vars['internalid'])) $id = "id=\"{$vars['internalid']}\""; - $disabled = ""; - if ($vars['disabled']) $disabled = ' disabled="yes" '; - echo "<label><input type=\"checkbox\" $id $disabled {$vars['js']} name=\"{$vars['internalname']}[]\" value=\"".htmlentities($option, ENT_QUOTES, 'UTF-8')."\" {$selected} class=\"$class\" />{$label}</label><br />"; - } - -?>
\ No newline at end of file + if (isset($vars['internalid'])) $id = "id=\"{$vars['internalid']}\""; + $disabled = ""; + if ($vars['disabled']) $disabled = ' disabled="yes" '; + echo "<label><input type=\"checkbox\" $id $disabled {$vars['js']} name=\"{$vars['internalname']}[]\" value=\"".htmlentities($option, ENT_QUOTES, 'UTF-8')."\" {$selected} class=\"$class\" />{$label}</label><br />"; +}
\ No newline at end of file diff --git a/views/default/input/email.php b/views/default/input/email.php index e1fb61eab..bd2892e97 100644 --- a/views/default/input/email.php +++ b/views/default/input/email.php @@ -1,24 +1,25 @@ <?php +/** + * Elgg email input + * Displays an email input field + * + * @package Elgg + * @subpackage Core - /** - * Elgg email input - * Displays an email input field - * - * @package Elgg - * @subpackage Core + * @author Curverider Ltd - * @author Curverider Ltd + * @link http://elgg.org/ + * + * @uses $vars['value'] The current value, if any + * @uses $vars['js'] Any Javascript to enter into the input tag + * @uses $vars['internalname'] The name of the input field + * + */ - * @link http://elgg.org/ - * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * - */ - - $class = $vars['class']; - if (!$class) $class = "input-text"; +$class = $vars['class']; +if (!$class) { + $class = "input-text"; +} ?> -<input type="text" <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?>value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" class="<?php echo $class; ?>"/>
\ No newline at end of file +<input type="text" <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?>value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" class="<?php echo $class; ?>"/>
\ No newline at end of file diff --git a/views/default/input/file.php b/views/default/input/file.php index e707e3ee0..15cc011f6 100644 --- a/views/default/input/file.php +++ b/views/default/input/file.php @@ -1,26 +1,25 @@ <?php +/** + * Elgg file input + * Displays a file input field + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + * @uses $vars['js'] Any Javascript to enter into the input tag + * @uses $vars['internalname'] The name of the input field + * + */ - /** - * Elgg file input - * Displays a file input field - * - * @package Elgg - * @subpackage Core +if (!empty($vars['value'])) { + echo elgg_echo('fileexists') . "<br />"; +} - * @author Curverider Ltd - - * @link http://elgg.org/ - * - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * - */ - - if (!empty($vars['value'])) { - echo elgg_echo('fileexists') . "<br />"; - } - - $class = $vars['class']; - if (!$class) $class = "input-file"; +$class = $vars['class']; +if (!$class) { + $class = "input-file"; +} ?> <input type="file" size="30" <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> class="<?php echo $class; ?>" />
\ No newline at end of file diff --git a/views/default/input/form.php b/views/default/input/form.php index 0a4619ac1..25f140a01 100644 --- a/views/default/input/form.php +++ b/views/default/input/form.php @@ -1,34 +1,50 @@ <?php - /** - * Create a form for data submission. - * Use this view for forms rather than creating a form tag in the wild as it provides - * extra security which help prevent CSRF attacks. - * - * @package Elgg - * @subpackage Core - * @author Curverider Ltd - * @link http://elgg.org/ - * - * @uses $vars['body'] The body of the form (made up of other input/xxx views and html - * @uses $vars['method'] Method (default POST) - * @uses $vars['enctype'] How the form is encoded, default blank - * @uses $vars['action'] URL of the action being called - * - */ - - if (isset($vars['internalid'])) { $id = $vars['internalid']; } else { $id = ''; } - if (isset($vars['internalname'])) { $name = $vars['internalname']; } else { $name = ''; } - $body = $vars['body']; - $action = $vars['action']; - if (isset($vars['enctype'])) { $enctype = $vars['enctype']; } else { $enctype = ''; } - if (isset($vars['method'])) { $method = $vars['method']; } else { $method = 'POST'; } +/** + * Create a form for data submission. + * Use this view for forms rather than creating a form tag in the wild as it provides + * extra security which help prevent CSRF attacks. + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + * @uses $vars['body'] The body of the form (made up of other input/xxx views and html + * @uses $vars['method'] Method (default POST) + * @uses $vars['enctype'] How the form is encoded, default blank + * @uses $vars['action'] URL of the action being called + * + */ - // Generate a security header - $security_header = ""; - if ($vars['disable_security']!=true) - { - $security_header = elgg_view('input/securitytoken'); - } +if (isset($vars['internalid'])) { + $id = $vars['internalid']; +} else { + $id = ''; +} + +if (isset($vars['internalname'])) { + $name = $vars['internalname']; +} else { + $name = ''; +} +$body = $vars['body']; +$action = $vars['action']; +if (isset($vars['enctype'])) { + $enctype = $vars['enctype']; +} else { + $enctype = ''; +} +if (isset($vars['method'])) { + $method = $vars['method']; +} else { + $method = 'POST'; +} + +// Generate a security header +$security_header = ""; +if ($vars['disable_security']!=true) { + $security_header = elgg_view('input/securitytoken'); +} ?> <form <?php if ($id) { ?>id="<?php echo $id; ?>" <?php } ?> <?php if ($name) { ?>name="<?php echo $name; ?>" <?php } ?> action="<?php echo $action; ?>" method="<?php echo $method; ?>" <?php if ($enctype!="") echo "enctype=\"$enctype\""; ?>> <?php echo $security_header; ?> diff --git a/views/default/input/hidden.php b/views/default/input/hidden.php index 2338a66bb..e95779367 100644 --- a/views/default/input/hidden.php +++ b/views/default/input/hidden.php @@ -1,18 +1,18 @@ <?php - /** - * Create a hidden data field - * Use this view for forms rather than creating a hidden tag in the wild as it provides - * extra security which help prevent CSRF attacks. - * - * @package Elgg - * @subpackage Core - * @author Curverider Ltd - * @link http://elgg.org/ - * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * - */ +/** + * Create a hidden data field + * Use this view for forms rather than creating a hidden tag in the wild as it provides + * extra security which help prevent CSRF attacks. + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + * @uses $vars['value'] The current value, if any + * @uses $vars['js'] Any Javascript to enter into the input tag + * @uses $vars['internalname'] The name of the input field + * + */ ?> -<input type="hidden" <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" />
\ No newline at end of file +<input type="hidden" <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" />
\ No newline at end of file diff --git a/views/default/input/longtext.php b/views/default/input/longtext.php index 86b0f3fc4..f60e29a70 100644 --- a/views/default/input/longtext.php +++ b/views/default/input/longtext.php @@ -1,25 +1,22 @@ <?php +/** + * Elgg long text input + * Displays a long text input field + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + * @uses $vars['value'] The current value, if any + * @uses $vars['js'] Any Javascript to enter into the input tag + * @uses $vars['internalname'] The name of the input field + * + */ - /** - * Elgg long text input - * Displays a long text input field - * - * @package Elgg - * @subpackage Core +$class = $vars['class']; +if (!$class) $class = "input-textarea"; - * @author Curverider Ltd - - * @link http://elgg.org/ - * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * - */ - - $class = $vars['class']; - if (!$class) $class = "input-textarea"; - ?> -<textarea class="<?php echo $class; ?>" name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?>><?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?></textarea>
\ No newline at end of file +<textarea class="<?php echo $class; ?>" name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?>><?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?></textarea>
\ No newline at end of file diff --git a/views/default/input/password.php b/views/default/input/password.php index 8ab0b6935..90ee984d4 100644 --- a/views/default/input/password.php +++ b/views/default/input/password.php @@ -1,24 +1,23 @@ <?php +/** + * Elgg password input + * Displays a password input field + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + * @uses $vars['value'] The current value, if any + * @uses $vars['js'] Any Javascript to enter into the input tag + * @uses $vars['internalname'] The name of the input field + * + */ - /** - * Elgg password input - * Displays a password input field - * - * @package Elgg - * @subpackage Core - - * @author Curverider Ltd - - * @link http://elgg.org/ - * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * - */ - - $class = $vars['class']; - if (!$class) $class = "input-password"; +$class = $vars['class']; +if (!$class) { + $class = "input-password"; +} ?> -<input type="password" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" class="<?php echo $class; ?>" />
\ No newline at end of file +<input type="password" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" class="<?php echo $class; ?>" />
\ No newline at end of file diff --git a/views/default/input/plaintext.php b/views/default/input/plaintext.php index a99084a43..e177f8b3f 100644 --- a/views/default/input/plaintext.php +++ b/views/default/input/plaintext.php @@ -1,25 +1,24 @@ <?php +/** + * Elgg long text input (plaintext) + * Displays a long text input field that should not be overridden by wysiwyg editors. + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + * @uses $vars['value'] The current value, if any + * @uses $vars['js'] Any Javascript to enter into the input tag + * @uses $vars['internalname'] The name of the input field + * + */ - /** - * Elgg long text input (plaintext) - * Displays a long text input field that should not be overridden by wysiwyg editors. - * - * @package Elgg - * @subpackage Core +$class = $vars['class']; +if (!$class) { + $class = "input-textarea"; +} - * @author Curverider Ltd - - * @link http://elgg.org/ - * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * - */ - - $class = $vars['class']; - if (!$class) $class = "input-textarea"; - ?> -<textarea class="<?php echo $class; ?>" name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?>><?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?></textarea>
\ No newline at end of file +<textarea class="<?php echo $class; ?>" name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?>><?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?></textarea>
\ No newline at end of file diff --git a/views/default/input/pulldown.php b/views/default/input/pulldown.php index 6aa69f428..03143d677 100644 --- a/views/default/input/pulldown.php +++ b/views/default/input/pulldown.php @@ -1,52 +1,46 @@ <?php - - /** - * Elgg pulldown input - * Displays a pulldown input field - * - * @package Elgg - * @subpackage Core - - * @author Curverider Ltd - - * @link http://elgg.org/ - * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * @uses $vars['options'] An array of strings representing the options for the pulldown field - * @uses $vars['options_values'] An associative array of "value" => "option" where "value" is an internal name and "option" is - * the value displayed on the button. Replaces $vars['options'] when defined. - */ - - - $class = $vars['class']; - if (!$class) $class = "input-pulldown"; +/** + * Elgg pulldown input + * Displays a pulldown input field + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + * @uses $vars['value'] The current value, if any + * @uses $vars['js'] Any Javascript to enter into the input tag + * @uses $vars['internalname'] The name of the input field + * @uses $vars['options'] An array of strings representing the options for the pulldown field + * @uses $vars['options_values'] An associative array of "value" => "option" where "value" is an internal name and "option" is + * the value displayed on the button. Replaces $vars['options'] when defined. + */ + +$class = $vars['class']; +if (!$class) { + $class = "input-pulldown"; +} ?> - <select name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> <?php echo $vars['js']; ?> <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> class="<?php echo $class; ?>"> <?php - if ($vars['options_values']) - { - foreach($vars['options_values'] as $value => $option) { - if ($value != $vars['value']) { - echo "<option value=\"".htmlentities($value, ENT_QUOTES, 'UTF-8')."\">". htmlentities($option, ENT_QUOTES, 'UTF-8') ."</option>"; - } else { - echo "<option value=\"".htmlentities($value, ENT_QUOTES, 'UTF-8')."\" selected=\"selected\">". htmlentities($option, ENT_QUOTES, 'UTF-8') ."</option>"; - } - } +if ($vars['options_values']) { + foreach($vars['options_values'] as $value => $option) { + if ($value != $vars['value']) { + echo "<option value=\"".htmlentities($value, ENT_QUOTES, 'UTF-8')."\">". htmlentities($option, ENT_QUOTES, 'UTF-8') ."</option>"; + } else { + echo "<option value=\"".htmlentities($value, ENT_QUOTES, 'UTF-8')."\" selected=\"selected\">". htmlentities($option, ENT_QUOTES, 'UTF-8') ."</option>"; + } } - else - { - foreach($vars['options'] as $option) { - if ($option != $vars['value']) { - echo "<option>". htmlentities($option, ENT_QUOTES, 'UTF-8') ."</option>"; - } else { - echo "<option selected=\"selected\">". htmlentities($option, ENT_QUOTES, 'UTF-8') ."</option>"; - } - } +} else { + foreach($vars['options'] as $option) { + if ($option != $vars['value']) { + echo "<option>". htmlentities($option, ENT_QUOTES, 'UTF-8') ."</option>"; + } else { + echo "<option selected=\"selected\">". htmlentities($option, ENT_QUOTES, 'UTF-8') ."</option>"; + } } -?> +} +?> </select>
\ No newline at end of file diff --git a/views/default/input/radio.php b/views/default/input/radio.php index 12e40ccdd..c6163b141 100644 --- a/views/default/input/radio.php +++ b/views/default/input/radio.php @@ -1,40 +1,41 @@ <?php +/** + * Elgg radio input + * Displays a radio input field + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + * @uses $vars['value'] The current value, if any + * @uses $vars['js'] Any Javascript to enter into the input tag + * @uses $vars['internalname'] The name of the input field + * @uses $vars['options'] An array of strings representing the options for the radio field as "label" => option + * + */ - /** - * Elgg radio input - * Displays a radio input field - * - * @package Elgg - * @subpackage Core +$class = $vars['class']; +if (!$class) { + $class = "input-radio"; +} - * @author Curverider Ltd +foreach($vars['options'] as $label => $option) { + if (strtolower($option) != strtolower($vars['value'])) { + $selected = ""; + } else { + $selected = "checked = \"checked\""; + } + $labelint = (int) $label; + if ("{$label}" == "{$labelint}") { + $label = $option; + } - * @link http://elgg.org/ - * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * @uses $vars['options'] An array of strings representing the options for the radio field as "label" => option - * - */ - - $class = $vars['class']; - if (!$class) $class = "input-radio"; - - foreach($vars['options'] as $label => $option) { - if (strtolower($option) != strtolower($vars['value'])) { - $selected = ""; - } else { - $selected = "checked = \"checked\""; - } - $labelint = (int) $label; - if ("{$label}" == "{$labelint}") { - $label = $option; - } - - if (isset($vars['internalid'])) $id = "id=\"{$vars['internalid']}\""; - if ($vars['disabled']) $disabled = ' disabled="yes" '; - echo "<label><input type=\"radio\" $disabled {$vars['js']} name=\"{$vars['internalname']}\" $id value=\"".htmlentities($option, ENT_QUOTES, 'UTF-8')."\" {$selected} class=\"$class\" />{$label}</label><br />"; - } - -?>
\ No newline at end of file + if (isset($vars['internalid'])) { + $id = "id=\"{$vars['internalid']}\""; + } + if ($vars['disabled']) { + $disabled = ' disabled="yes" '; + } + echo "<label><input type=\"radio\" $disabled {$vars['js']} name=\"{$vars['internalname']}\" $id value=\"".htmlentities($option, ENT_QUOTES, 'UTF-8')."\" {$selected} class=\"$class\" />{$label}</label><br />"; +}
\ No newline at end of file diff --git a/views/default/input/reset.php b/views/default/input/reset.php index 96fc57a4f..bb8d278c3 100644 --- a/views/default/input/reset.php +++ b/views/default/input/reset.php @@ -1,25 +1,26 @@ <?php - /** - * Create a reset input button - * Use this view for forms rather than creating a submit/reset button tag in the wild as it provides - * extra security which help prevent CSRF attacks. - * - * @package Elgg - * @subpackage Core - * @author Curverider Ltd - * @link http://elgg.org/ - * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * @uses $vars['type'] Submit or reset, defaults to submit. - * - */ +/** + * Create a reset input button + * Use this view for forms rather than creating a submit/reset button tag in the wild as it provides + * extra security which help prevent CSRF attacks. + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + * @uses $vars['value'] The current value, if any + * @uses $vars['js'] Any Javascript to enter into the input tag + * @uses $vars['internalname'] The name of the input field + * @uses $vars['type'] Submit or reset, defaults to submit. + * + */ - $vars['type'] = 'reset'; - $class = $vars['class']; - if (!$class) $class = "submit_button"; - $vars['class'] = $class; - - echo elgg_view('input/button', $vars); -?>
\ No newline at end of file +$vars['type'] = 'reset'; +$class = $vars['class']; +if (!$class) { + $class = "submit_button"; +} +$vars['class'] = $class; + +echo elgg_view('input/button', $vars);
\ No newline at end of file diff --git a/views/default/input/securitytoken.php b/views/default/input/securitytoken.php index fa202548e..a2a4a0e01 100644 --- a/views/default/input/securitytoken.php +++ b/views/default/input/securitytoken.php @@ -1,18 +1,17 @@ <?php - /** - * CSRF security token view for use with secure forms. - * - * It is still recommended that you use input/form. - * - * @package Elgg - * @subpackage Core - * @author Curverider Ltd - * @link http://elgg.org/ - */ +/** + * CSRF security token view for use with secure forms. + * + * It is still recommended that you use input/form. + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + */ - $ts = time(); - $token = generate_action_token($ts); - - echo elgg_view('input/hidden', array('internalname' => '__elgg_token', 'value' => $token)); - echo elgg_view('input/hidden', array('internalname' => '__elgg_ts', 'value' => $ts)); -?> +$ts = time(); +$token = generate_action_token($ts); + +echo elgg_view('input/hidden', array('internalname' => '__elgg_token', 'value' => $token)); +echo elgg_view('input/hidden', array('internalname' => '__elgg_ts', 'value' => $ts)); diff --git a/views/default/input/submit.php b/views/default/input/submit.php index 66e5c543b..b0c72791f 100644 --- a/views/default/input/submit.php +++ b/views/default/input/submit.php @@ -1,25 +1,28 @@ <?php - /** - * Create a submit input button - * Use this view for forms rather than creating a submit/reset button tag in the wild as it provides - * extra security which help prevent CSRF attacks. - * - * @package Elgg - * @subpackage Core - * @author Curverider Ltd - * @link http://elgg.org/ - * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * @uses $vars['type'] Submit or reset, defaults to submit. - * - */ +/** + * Create a submit input button + * Use this view for forms rather than creating a submit/reset button tag in the wild as it provides + * extra security which help prevent CSRF attacks. + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + * @uses $vars['value'] The current value, if any + * @uses $vars['js'] Any Javascript to enter into the input tag + * @uses $vars['internalname'] The name of the input field + * @uses $vars['type'] Submit or reset, defaults to submit. + * + */ - $vars['type'] = 'submit'; - if (isset($vars['class'])) $class = $vars['class']; - if (!$class) $class = "submit_button"; - $vars['class'] = $class; - - echo elgg_view('input/button', $vars); -?>
\ No newline at end of file +$vars['type'] = 'submit'; +if (isset($vars['class'])) { + $class = $vars['class']; +} +if (!$class) { + $class = "submit_button"; +} +$vars['class'] = $class; + +echo elgg_view('input/button', $vars);
\ No newline at end of file diff --git a/views/default/input/tags.php b/views/default/input/tags.php index 8793756e2..172875004 100644 --- a/views/default/input/tags.php +++ b/views/default/input/tags.php @@ -1,45 +1,45 @@ -<?php +<?php +/** + * Elgg tag input + * Displays a tag input field + * + * @package Elgg + * @subpackage Core - /** - * Elgg tag input - * Displays a tag input field - * - * @package Elgg - * @subpackage Core + * @author Curverider Ltd - * @author Curverider Ltd + * @link http://elgg.org/ + * + * @uses $vars['value'] The current value, if any + * @uses $vars['js'] Any Javascript to enter into the input tag + * @uses $vars['internalname'] The name of the input field + * @uses $vars['value'] An array of tags + * @uses $vars['class'] Class override + */ - * @link http://elgg.org/ - * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * @uses $vars['value'] An array of tags - * @uses $vars['class'] Class override - */ +$class = $vars['class']; +if (!$class) { + $class = "input-tags"; +} - $class = $vars['class']; - if (!$class) $class = "input-tags"; +$tags = ""; +if (!empty($vars['value'])) { + if (is_array($vars['value'])) { + foreach($vars['value'] as $tag) { + + if (!empty($tags)) { + $tags .= ", "; + } + if (is_string($tag)) { + $tags .= $tag; + } else { + $tags .= $tag->value; + } + } + } else { + $tags = $vars['value']; + } +} - $tags = ""; - if (!empty($vars['value'])) { - if (is_array($vars['value'])) { - foreach($vars['value'] as $tag) { - - if (!empty($tags)) { - $tags .= ", "; - } - if (is_string($tag)) { - $tags .= $tag; - } else { - $tags .= $tag->value; - } - - } - } else { - $tags = $vars['value']; - } - } - ?> -<input type="text" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?><?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> value="<?php echo htmlentities($tags, ENT_QUOTES, 'UTF-8'); ?>" class="<?php echo $class; ?>"/>
\ No newline at end of file +<input type="text" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?><?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> value="<?php echo htmlentities($tags, ENT_QUOTES, 'UTF-8'); ?>" class="<?php echo $class; ?>"/>
\ No newline at end of file diff --git a/views/default/input/text.php b/views/default/input/text.php index 2a30ba081..1814e5801 100644 --- a/views/default/input/text.php +++ b/views/default/input/text.php @@ -1,27 +1,28 @@ <?php +/** + * Elgg text input + * Displays a text input field + * + * @package Elgg + * @subpackage Core - /** - * Elgg text input - * Displays a text input field - * - * @package Elgg - * @subpackage Core + * @author Curverider Ltd - * @author Curverider Ltd + * @link http://elgg.org/ + * + * @uses $vars['value'] The current value, if any + * @uses $vars['js'] Any Javascript to enter into the input tag + * @uses $vars['internalname'] The name of the input field + * @uses $vars['disabled'] If true then control is read-only + * @uses $vars['class'] Class override + */ - * @link http://elgg.org/ - * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * @uses $vars['disabled'] If true then control is read-only - * @uses $vars['class'] Class override - */ - - $class = $vars['class']; - if (!$class) $class = "input-text"; - +$class = $vars['class']; +if (!$class) { + $class = "input-text"; +} + ?> -<input type="text" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" class="<?php echo $class ?>"/>
\ No newline at end of file +<input type="text" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" class="<?php echo $class ?>"/>
\ No newline at end of file diff --git a/views/default/input/url.php b/views/default/input/url.php index 82fde938e..6bf19d319 100644 --- a/views/default/input/url.php +++ b/views/default/input/url.php @@ -1,24 +1,23 @@ <?php +/** + * Elgg URL input + * Displays a URL input field + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + * + * @uses $vars['value'] The current value, if any + * @uses $vars['js'] Any Javascript to enter into the input tag + * @uses $vars['internalname'] The name of the input field + * @uses $vars['class'] Class override + */ - /** - * Elgg URL input - * Displays a URL input field - * - * @package Elgg - * @subpackage Core - - * @author Curverider Ltd - - * @link http://elgg.org/ - * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * @uses $vars['class'] Class override - */ - - $class = $vars['class']; - if (!$class) $class = "input-url"; +$class = $vars['class']; +if (!$class) { + $class = "input-url"; +} ?> -<input type="text" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" class="<?php echo $class; ?>"/>
\ No newline at end of file +<input type="text" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" class="<?php echo $class; ?>"/>
\ No newline at end of file diff --git a/views/default/input/urlshortener.php b/views/default/input/urlshortener.php index 4707809f5..7a8c2786a 100644 --- a/views/default/input/urlshortener.php +++ b/views/default/input/urlshortener.php @@ -1,10 +1,10 @@ <?php - /** - * This view provides a hook for third parties to provide a URL shortener. - * - * @package Elgg - * @subpackage Core - * @author Curverider Ltd - * @link http://elgg.org/ - */ +/** + * This view provides a hook for third parties to provide a URL shortener. + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd + * @link http://elgg.org/ + */ ?>
\ No newline at end of file diff --git a/views/default/input/userpicker.php b/views/default/input/userpicker.php index efe83ec14..742554dbd 100644 --- a/views/default/input/userpicker.php +++ b/views/default/input/userpicker.php @@ -1,23 +1,23 @@ -<?php +<?php /** - * User Picker. Sends an array of user guids. - * + * User Picker. Sends an array of user guids. + * * @package Elgg * @subpackage Core * @author Curverider Ltd * @link http://elgg.org/ - * + * * @uses $vars['value'] The current value, if any * @uses $vars['internalname'] The name of the input field - * - * + * + * * pops up defaulted to lazy load friends lists in paginated alphabetical order. - * upon - * + * upon + * * As users are checked they move down to a "users" box. * When this happens, a hidden input is created also. * {$internalnal}[] with the value th GUID. - * + * */ global $user_picker_js_sent; @@ -81,13 +81,13 @@ function userPickerFormatItem(row, i, max, term) { var r = ''; var name = info.name.replace(new RegExp("(" + term + ")", "gi"), "<span class=\"user_picker_highlight\">$1</b>"); var desc = info.desc.replace(new RegExp("(" + term + ")", "gi"), "<span class=\"user_picker_highlight\">$1</b>"); - + switch (info.type) { case 'user': case 'group': r = info.icon + name + ' - ' + desc; break; - + default: r = name + ' - ' + desc; break; @@ -103,10 +103,10 @@ function userPickerAddUser(event, data, formatted) { var internalName = picker.find('input.internalname').val(); // not sure why formatted isn't. var formatted = userPickerFormatItem(data); - + // add guid as hidden input and to list. var li = formatted + ' <a class="delete_collection" onclick="userPickerRemoveUser(this, ' + info.guid + ')"><strong>X</strong></a>' - + '<input type="hidden" name="' + internalName + '[]" value="' + info.guid + '" />'; + + '<input type="hidden" name="' + internalName + '[]" value="' + info.guid + '" />'; $('<li class="user_picker_entry">').html(li).appendTo(users); $(this).val(''); @@ -137,11 +137,10 @@ $(document).ready(function() { <input class="internalname" type="hidden" name="internalname" value="<?php echo $vars['internalname']; ?>" /> <input class="search" type="text" name="user_search" size="30"/> <span class="controls"> - <label><input class="all_users" type="checkbox" name="match_on" value="true" /><?php echo elgg_echo('userpicker:only_friends'); ?></label> + <label><input class="all_users" type="checkbox" name="match_on" value="true" /><?php echo elgg_echo('userpicker:only_friends'); ?></label> </span> <div class="results"> <!-- This space will be filled with users, checkboxes and magic. --> </div> <ul class="users"></ul> </div> - |