diff options
Diffstat (limited to 'views')
37 files changed, 119 insertions, 73 deletions
diff --git a/views/default/admin/appearance/profile_fields.php b/views/default/admin/appearance/profile_fields.php index 91d14b874..f1d78c19f 100644 --- a/views/default/admin/appearance/profile_fields.php +++ b/views/default/admin/appearance/profile_fields.php @@ -5,12 +5,20 @@  $add = elgg_view_form('profile/fields/add', array('class' => 'elgg-form-settings'), array());  $list = elgg_view('admin/appearance/profile_fields/list'); -$reset = elgg_view_form('profile/fields/reset', array(), array()); + +$reset = elgg_view('output/confirmlink', array( +	'text' => elgg_echo('reset'), +	'href' => 'action/profile/fields/reset', +	'title' => elgg_echo('profile:resetdefault'), +	'confirm' => elgg_echo('profile:resetdefault:confirm'), +	'class' => 'elgg-button elgg-button-cancel', +	'is_trusted' => 'true', +));  $body = <<<__HTML  $add  $list -$reset +<div class="mtl">$reset</div>  __HTML;  echo $body; diff --git a/views/default/admin/users/admins.php b/views/default/admin/users/admins.php new file mode 100644 index 000000000..9b175d437 --- /dev/null +++ b/views/default/admin/users/admins.php @@ -0,0 +1,12 @@ +<?php +$admins = elgg_list_entities(array(), 'elgg_get_admins'); +	 +?> +<div class="elgg-module elgg-module-inline"> +	<div class="elgg-head"> +		<h3><?php echo elgg_echo('admin:statistics:label:admins'); ?></h3> +	</div> +	<div class="elgg-body"> +		<?php echo $admins; ?> +	</div> +</div> diff --git a/views/default/annotation/generic_comment.php b/views/default/annotation/generic_comment.php index 9891510e0..22a8d9211 100644 --- a/views/default/annotation/generic_comment.php +++ b/views/default/annotation/generic_comment.php @@ -55,13 +55,13 @@ HTML;  	//@todo need link to actual comment! -	$on = elgg_echo('on'); +	$commented_on = elgg_echo('generic_comment:on', array($commenter_link, $entity_link));  	$excerpt = elgg_get_excerpt($comment->value, 80);  	$body = <<<HTML  <span class="elgg-subtext"> -	$commenter_link $on $entity_link ($friendlytime): $excerpt +	$commented_on ($friendlytime): $excerpt  </span>  HTML; diff --git a/views/default/core/settings/statistics/online.php b/views/default/core/settings/statistics/online.php index f50ad9acc..1385ff60f 100644 --- a/views/default/core/settings/statistics/online.php +++ b/views/default/core/settings/statistics/online.php @@ -8,20 +8,13 @@  $user = elgg_get_page_owner_entity(); -$logged_in = 0; -$log = get_system_log($user->guid, "login", "", 'user', '', 1); - -if ($log) { -	$logged_in = $log[0]->time_created; -} -  $label_name = elgg_echo('usersettings:statistics:label:name');  $label_email = elgg_echo('usersettings:statistics:label:email');  $label_member_since = elgg_echo('usersettings:statistics:label:membersince');  $label_last_login = elgg_echo('usersettings:statistics:label:lastlogin');  $time_created = date("r", $user->time_created); -$last_login = date("r", $logged_in); +$last_login = date("r", $user->last_login);  $title = elgg_echo('usersettings:statistics:yourdetails'); diff --git a/views/default/css/admin.php b/views/default/css/admin.php index b996e5636..059e51dd6 100644 --- a/views/default/css/admin.php +++ b/views/default/css/admin.php @@ -1238,6 +1238,10 @@ a.elgg-widget-collapsed:before {  	height: 16px;  	display: inline-block;  	margin: 0 2px; +	vertical-align: text-bottom; +} +.elgg-module .elgg-head .elgg-icon { +	vertical-align: baseline;  }  .elgg-icon-delete:hover,  .elgg-icon-delete-alt:hover { diff --git a/views/default/css/elements/layout.php b/views/default/css/elements/layout.php index 25a2bffb7..9d92752b4 100644 --- a/views/default/css/elements/layout.php +++ b/views/default/css/elements/layout.php @@ -118,4 +118,4 @@  }  .elgg-page-footer a:hover {  	color: #666; -}
\ No newline at end of file +} diff --git a/views/default/css/elements/modules.php b/views/default/css/elements/modules.php index 74092c774..a37ae094b 100644 --- a/views/default/css/elements/modules.php +++ b/views/default/css/elements/modules.php @@ -191,4 +191,4 @@ a.elgg-widget-collapsed:before {  .elgg-widget-placeholder {  	border: 2px dashed #dedede;  	margin-bottom: 15px; -}
\ No newline at end of file +} diff --git a/views/default/css/elements/typography.php b/views/default/css/elements/typography.php index d93b28d2c..c044cb1cc 100644 --- a/views/default/css/elements/typography.php +++ b/views/default/css/elements/typography.php @@ -158,4 +158,5 @@ h6 { font-size: 0.8em; }  }  .elgg-output img {  	max-width: 100%; -}
\ No newline at end of file +	height: auto; +} diff --git a/views/default/forms/profile/fields/add.php b/views/default/forms/profile/fields/add.php index 1ea9c57a9..2087ec299 100644 --- a/views/default/forms/profile/fields/add.php +++ b/views/default/forms/profile/fields/add.php @@ -25,5 +25,5 @@ $formbody = <<< END  		$submit_control</div>  END; -echo autop(elgg_echo('profile:explainchangefields')); +echo elgg_autop(elgg_echo('profile:explainchangefields'));  echo $formbody; diff --git a/views/default/forms/profile/fields/reset.php b/views/default/forms/profile/fields/reset.php deleted file mode 100644 index c0bb1b7f4..000000000 --- a/views/default/forms/profile/fields/reset.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php -/** - * Reset profile fields form - */ - -echo '<div class="elgg-foot">'; -$params = array( -	'value' => elgg_echo('profile:resetdefault'), -	'class' => 'elgg-button-cancel', -); -echo elgg_view('input/submit', $params); -echo '</div>'; diff --git a/views/default/forms/register.php b/views/default/forms/register.php index 75ecd3450..c0ee66f76 100644 --- a/views/default/forms/register.php +++ b/views/default/forms/register.php @@ -6,6 +6,8 @@   * @subpackage Core   */ +elgg_load_js('elgg.register'); +  $password = $password2 = '';  $username = get_input('u');  $email = get_input('e'); diff --git a/views/default/forms/user/passwordreset.php b/views/default/forms/user/passwordreset.php index 3c89776f6..5946fa7c0 100644 --- a/views/default/forms/user/passwordreset.php +++ b/views/default/forms/user/passwordreset.php @@ -3,7 +3,7 @@   * Reset user password form   */ -echo autop(elgg_echo('user:resetpassword:reset_password_confirm')); +echo elgg_autop(elgg_echo('user:resetpassword:reset_password_confirm'));  echo elgg_view('input/hidden', array(  	'name' => 'u', diff --git a/views/default/js/admin.php b/views/default/js/admin.php index 5cefba512..e8aa0d2ed 100644 --- a/views/default/js/admin.php +++ b/views/default/js/admin.php @@ -4,8 +4,9 @@   *   * @since 1.8   */ + +if (0) { ?><script><?php }  ?> -//<script>  elgg.provide('elgg.admin');  elgg.admin.init = function () { @@ -47,7 +48,7 @@ elgg.admin.init = function () {  	// admin notices delete ajax  	$('a.elgg-admin-notice').click(elgg.admin.deleteNotice); -} +};  /**   * Save the plugin order after a move event. @@ -88,7 +89,7 @@ elgg.admin.editProfileField = function(value, settings) {  	elgg.action('profile/fields/edit', data);  	return value; -} +};  /**   * Save the plugin profile order after a move event. @@ -104,7 +105,7 @@ elgg.admin.moveProfileField = function(e, ui) {  	elgg.action('profile/fields/reorder', {  		fieldorder: orderStr  	}); -} +};  /**   * Fires the ajax action to delete the admin notice then hides the notice. @@ -120,6 +121,6 @@ elgg.admin.deleteNotice = function(e) {  			$container.slideUp('medium');  		}  	}); -} +};  elgg.register_hook_handler('init', 'system', elgg.admin.init, 1000);
\ No newline at end of file diff --git a/views/default/js/elgg.php b/views/default/js/elgg.php index 6460e93d6..6fe03484d 100644 --- a/views/default/js/elgg.php +++ b/views/default/js/elgg.php @@ -50,12 +50,14 @@ foreach ($libs as $file) {  /**   * Set some values that are cacheable   */ +if (0) { ?><script><?php }  ?>  elgg.version = '<?php echo get_version(); ?>';  elgg.release = '<?php echo get_version(true); ?>';  elgg.config.wwwroot = '<?php echo elgg_get_site_url(); ?>'; -elgg.security.interval = 5 * 60 * 1000; <?php //@todo make this configurable ?> +<?php //@todo make this configurable ?> +elgg.security.interval = 5 * 60 * 1000;  elgg.config.domReady = false;  elgg.config.language = '<?php echo isset($CONFIG->language) ? $CONFIG->language : 'en'; ?>';  elgg.config.languageReady = false; diff --git a/views/default/js/initialize_elgg.php b/views/default/js/initialize_elgg.php index f8234f84f..b45c33463 100644 --- a/views/default/js/initialize_elgg.php +++ b/views/default/js/initialize_elgg.php @@ -3,6 +3,7 @@   * Initialize Elgg's js lib with the uncacheable data   */ +if (0) { ?><script><?php }  ?>  /**   * Don't want to cache these -- they could change for every request diff --git a/views/default/js/lightbox.php b/views/default/js/lightbox.php index c45d46098..a1f018eea 100644 --- a/views/default/js/lightbox.php +++ b/views/default/js/lightbox.php @@ -3,7 +3,8 @@   * Elgg lightbox   *   * Usage - * Apply the class elgg-lightbox to links. + * Call elgg_load_js('lightbox') and elgg_load_css('lightbox') then + * apply the class elgg-lightbox to links.   *   * Advanced Usage   * Elgg is distributed with the Fancybox jQuery library. Please go to @@ -16,6 +17,7 @@   * @todo add support for passing options: $('#myplugin-lightbox').elgg.ui.lightbox(options);   */ +if (0) { ?><script><?php }  ?>  /** diff --git a/views/default/js/walled_garden.php b/views/default/js/walled_garden.php index 13ec83c04..7a482fe23 100644 --- a/views/default/js/walled_garden.php +++ b/views/default/js/walled_garden.php @@ -12,6 +12,7 @@ $cancel_button = elgg_view('input/button', array(  ));  $cancel_button = trim($cancel_button); +if (0) { ?><script><?php }  ?>  elgg.provide('elgg.walled_garden'); @@ -47,10 +48,10 @@ elgg.walled_garden.load = function(view) {  				$(id).find('input.elgg-button-submit').after('<?php echo $cancel_button; ?>');  				$('#elgg-walledgarden-login').fadeToggle();  				$(id).fadeToggle(); -			}, +			}  		});  		event.preventDefault(); -    }; +	};  };  elgg.register_hook_handler('init', 'system', elgg.walled_garden.init);
\ No newline at end of file diff --git a/views/default/output/longtext.php b/views/default/output/longtext.php index 200f27de5..589100c4f 100644 --- a/views/default/output/longtext.php +++ b/views/default/output/longtext.php @@ -31,7 +31,7 @@ if ($parse_urls) {  $text = filter_tags($text); -$text = autop($text); +$text = elgg_autop($text);  $attributes = elgg_format_attributes($vars); diff --git a/views/default/page/components/list.php b/views/default/page/components/list.php index 0cf7d507c..28ed58ddf 100644 --- a/views/default/page/components/list.php +++ b/views/default/page/components/list.php @@ -51,14 +51,15 @@ if ($pagination && $count) {  if (is_array($items) && count($items) > 0) {  	$html .= "<ul class=\"$list_class\">";  	foreach ($items as $item) { -		if (elgg_instanceof($item)) { -			$id = "elgg-{$item->getType()}-{$item->getGUID()}"; -		} else { -			$id = "item-{$item->getType()}-{$item->id}"; +		$li = elgg_view_list_item($item, $vars); +		if ($li) { +			if (elgg_instanceof($item)) { +				$id = "elgg-{$item->getType()}-{$item->getGUID()}"; +			} else { +				$id = "item-{$item->getType()}-{$item->id}"; +			} +			$html .= "<li id=\"$id\" class=\"$item_class\">$li</li>";  		} -		$html .= "<li id=\"$id\" class=\"$item_class\">"; -		$html .= elgg_view_list_item($item, $vars); -		$html .= '</li>';  	}  	$html .= '</ul>';  } diff --git a/views/default/page/elements/head.php b/views/default/page/elements/head.php index 1eb2be088..d4a95b4d0 100644 --- a/views/default/page/elements/head.php +++ b/views/default/page/elements/head.php @@ -14,7 +14,7 @@ if (empty($vars['title'])) {  global $autofeed;  if (isset($autofeed) && $autofeed == true) { -	$url = full_url(); +	$url = current_page_url();  	if (substr_count($url,'?')) {  		$url .= "&view=rss";  	} else { diff --git a/views/default/page/elements/messages.php b/views/default/page/elements/messages.php index a35a48586..edd40d71e 100644 --- a/views/default/page/elements/messages.php +++ b/views/default/page/elements/messages.php @@ -18,7 +18,7 @@ if (isset($vars['object']) && is_array($vars['object']) && sizeof($vars['object'  	foreach ($vars['object'] as $type => $list ) {  		foreach ($list as $message) {  			echo "<li class=\"elgg-message elgg-state-$type\">"; -			echo autop($message); +			echo elgg_autop($message);  			echo '</li>';  		}  	} diff --git a/views/default/river/elements/image.php b/views/default/river/elements/image.php index 9caa44b36..6f6aeae65 100644 --- a/views/default/river/elements/image.php +++ b/views/default/river/elements/image.php @@ -9,4 +9,8 @@  $subject = $vars['item']->getSubjectEntity(); -echo elgg_view_entity_icon($subject, 'small'); +if (elgg_in_context('widgets')) { +	echo elgg_view_entity_icon($subject, 'tiny'); +} else { +	echo elgg_view_entity_icon($subject, 'small'); +} diff --git a/views/default/widgets/control_panel/content.php b/views/default/widgets/control_panel/content.php index d2db54bc6..a348d612f 100644 --- a/views/default/widgets/control_panel/content.php +++ b/views/default/widgets/control_panel/content.php @@ -11,12 +11,26 @@ elgg_register_menu_item('admin_control_panel', array(  	'link_class' => 'elgg-button elgg-button-action',  )); -elgg_register_menu_item('admin_control_panel', array( -	'name' => 'upgrade', -	'text' => elgg_echo('upgrade'), -	'href' => 'upgrade.php', -	'link_class' => 'elgg-button elgg-button-action', -)); +// @todo Move in this in ElggUpgradeManager::isLocked() when #4682 fixed +$is_locked = _elgg_upgrade_is_locked(); + +if (!$is_locked) { +	elgg_register_menu_item('admin_control_panel', array( +		'name' => 'upgrade', +		'text' => elgg_echo('upgrade'), +		'href' => 'upgrade.php', +		'link_class' => 'elgg-button elgg-button-action', +	)); +} else { +	elgg_register_menu_item('admin_control_panel', array( +		'name' => 'unlock_upgrade', +		'text' => elgg_echo('upgrade:unlock'), +		'href' => 'action/admin/site/unlock_upgrade', +		'is_action' => true, +		'link_class' => 'elgg-button elgg-button-action', +		'confirm' => elgg_echo('upgrade:unlock:confirm'), +	)); +}  echo elgg_view_menu('admin_control_panel', array(  	'class' => 'elgg-menu-hz', diff --git a/views/installation/install/js_rewrite_check.php b/views/installation/install/js_rewrite_check.php new file mode 100644 index 000000000..04d81171d --- /dev/null +++ b/views/installation/install/js_rewrite_check.php @@ -0,0 +1,12 @@ +<?php +/** + * Some servers don't allow PHP to check the rewrite, so try via AJAX + */ +?> +<script type="text/javascript"> +	elgg.installer.rewriteTest( +		'<?php echo $vars['url'];?>', +		'<?php echo elgg_echo('install:check:rewrite:success'); ?>', +		'<?php echo $vars['config']->wwwroot; ?>install.php?step=database' +	); +</script>
\ No newline at end of file diff --git a/views/installation/install/pages/admin.php b/views/installation/install/pages/admin.php index 9456e682f..e810aa701 100644 --- a/views/installation/install/pages/admin.php +++ b/views/installation/install/pages/admin.php @@ -3,7 +3,7 @@   * Install create admin account page   */ -echo autop(elgg_echo('install:admin:instructions')); +echo elgg_autop(elgg_echo('install:admin:instructions'));  $vars['type'] = 'admin'; diff --git a/views/installation/install/pages/complete.php b/views/installation/install/pages/complete.php index 2f5a04854..80f8e7434 100644 --- a/views/installation/install/pages/complete.php +++ b/views/installation/install/pages/complete.php @@ -3,7 +3,7 @@   * Install completion page   */ -echo autop(elgg_echo('install:complete:instructions')); +echo elgg_autop(elgg_echo('install:complete:instructions'));  ?> diff --git a/views/installation/install/pages/database.php b/views/installation/install/pages/database.php index d3011c9e3..d24b4f57b 100644 --- a/views/installation/install/pages/database.php +++ b/views/installation/install/pages/database.php @@ -6,12 +6,12 @@   */  if (isset($vars['failure']) && $vars['failure']) { -	echo autop(elgg_echo('install:database:error')); +	echo elgg_autop(elgg_echo('install:database:error'));  	$vars['refresh'] = TRUE;  	$vars['advance'] = FALSE;  	echo elgg_view('install/nav', $vars);  } else { -	echo autop(elgg_echo('install:database:instructions')); +	echo elgg_autop(elgg_echo('install:database:instructions'));  	$vars['type'] = 'database'; diff --git a/views/installation/install/pages/requirements.php b/views/installation/install/pages/requirements.php index e3689e761..3f0941c95 100644 --- a/views/installation/install/pages/requirements.php +++ b/views/installation/install/pages/requirements.php @@ -14,7 +14,7 @@ if ($vars['num_failures'] != 0) {  	$instruct_text = elgg_echo('install:requirements:instructions:success');  } -echo autop($instruct_text); +echo elgg_autop($instruct_text);  $report = $vars['report'];  foreach ($report as $category => $checks) { @@ -23,17 +23,17 @@ foreach ($report as $category => $checks) {  	echo "<ul class=\"elgg-require-$category\">";  	foreach ($checks as $check) {  		echo "<li class=\"{$check['severity']}\">"; -		echo autop($check['message']); +		echo elgg_autop($check['message']);  		echo "</li>";  	}  	echo "</ul>";  } -$vars['refresh'] = TRUE; +$vars['refresh'] = true;  // cannot advance to next step with a failure  if ($vars['num_failures'] != 0) { -	$vars['advance'] = FALSE; +	$vars['advance'] = false;  }  echo elgg_view('install/nav', $vars); diff --git a/views/installation/install/pages/settings.php b/views/installation/install/pages/settings.php index 30a1deb5a..04f23c0ea 100644 --- a/views/installation/install/pages/settings.php +++ b/views/installation/install/pages/settings.php @@ -1,6 +1,6 @@  <?php -echo autop(elgg_echo('install:settings:instructions')); +echo elgg_autop(elgg_echo('install:settings:instructions'));  $vars['type'] = 'settings'; diff --git a/views/installation/install/pages/welcome.php b/views/installation/install/pages/welcome.php index f069e4ba7..f370c15f3 100644 --- a/views/installation/install/pages/welcome.php +++ b/views/installation/install/pages/welcome.php @@ -3,6 +3,6 @@   * Install welcome page   */ -echo autop(elgg_echo('install:welcome:instructions')); +echo elgg_autop(elgg_echo('install:welcome:instructions'));  echo elgg_view('install/nav', $vars); diff --git a/views/installation/page/elements/messages.php b/views/installation/page/elements/messages.php index 2a06a7b1e..46261dca4 100644 --- a/views/installation/page/elements/messages.php +++ b/views/installation/page/elements/messages.php @@ -12,7 +12,7 @@ if (isset($vars['object']) && is_array($vars['object']) && sizeof($vars['object'  	foreach ($vars['object'] as $type => $list ) {  		foreach ($list as $message) {  			echo "<li class=\"elgg-state-$type\">"; -			echo autop($message); +			echo elgg_autop($message);  			echo '</li>';  		}  	} diff --git a/views/opendd/messages/exceptions/exception.php b/views/opendd/messages/exceptions/exception.php index 54868f1f4..dc0f48a8d 100644 --- a/views/opendd/messages/exceptions/exception.php +++ b/views/opendd/messages/exceptions/exception.php @@ -11,7 +11,7 @@  ?>  <!-- -<?php echo get_class($vars['object']); ?>: <?php echo autop($vars['object']->getMessage()); ?> +<?php echo get_class($vars['object']); ?>: <?php echo elgg_autop($vars['object']->getMessage()); ?>  <?php if (elgg_get_config('debug')) { ?>  <?php  	echo print_r($vars['object'], true); diff --git a/views/rss/group/default.php b/views/rss/group/default.php index f57c7f82c..7fef4d434 100644 --- a/views/rss/group/default.php +++ b/views/rss/group/default.php @@ -11,9 +11,9 @@ $pubdate = date('r', $vars['entity']->getTimeCreated());  $title = htmlspecialchars($vars['entity']->name, ENT_NOQUOTES, 'UTF-8');  if ($vars['entity']->description) { -	$description = autop($vars['entity']->description); +	$description = elgg_autop($vars['entity']->description);  } elseif ($vars['entity']->briefdescription) { -	$description = autop($vars['entity']->briefdescription); +	$description = elgg_autop($vars['entity']->briefdescription);  } else {  	$description = '';  } diff --git a/views/rss/object/default.php b/views/rss/object/default.php index be8025953..8c7d5d8e0 100644 --- a/views/rss/object/default.php +++ b/views/rss/object/default.php @@ -15,7 +15,7 @@ if (empty($title)) {  $permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8');  $pubdate = date('r', $vars['entity']->getTimeCreated()); -$description = autop($vars['entity']->description); +$description = elgg_autop($vars['entity']->description);  $creator = elgg_view('page/components/creator', $vars);  $georss = elgg_view('page/components/georss', $vars); diff --git a/views/rss/page/default.php b/views/rss/page/default.php index c973e3fd0..a7b757760 100644 --- a/views/rss/page/default.php +++ b/views/rss/page/default.php @@ -17,7 +17,7 @@ if (empty($vars['title'])) {  }  // Remove RSS from URL -$url = str_replace('?view=rss', '', full_url()); +$url = str_replace('?view=rss', '', current_page_url());  $url = str_replace('&view=rss', '', $url);  $url = htmlspecialchars($url, ENT_NOQUOTES, 'UTF-8'); diff --git a/views/rss/user/default.php b/views/rss/user/default.php index 1c7bf75e7..92c9427b2 100644 --- a/views/rss/user/default.php +++ b/views/rss/user/default.php @@ -11,7 +11,7 @@ $pubdate = date('r', $vars['entity']->getTimeCreated());  $title = htmlspecialchars($vars['entity']->name, ENT_NOQUOTES, 'UTF-8');  if ($vars['entity']->description) { -	$description = autop($vars['entity']->description); +	$description = elgg_autop($vars['entity']->description);  } else {  	$description = '';  } diff --git a/views/xml/messages/exceptions/exception.php b/views/xml/messages/exceptions/exception.php index 3e4e1c376..66a0f2b96 100644 --- a/views/xml/messages/exceptions/exception.php +++ b/views/xml/messages/exceptions/exception.php @@ -11,7 +11,7 @@  ?>  <!-- -<?php echo get_class($vars['object']); ?>: <?php echo autop($vars['object']->getMessage()); ?> +<?php echo get_class($vars['object']); ?>: <?php echo elgg_autop($vars['object']->getMessage()); ?>  <?php if (elgg_get_config('debug')) { ?>  | 
