diff options
Diffstat (limited to 'views/default/admin')
31 files changed, 579 insertions, 814 deletions
diff --git a/views/default/admin/appearance/default_widgets.php b/views/default/admin/appearance/default_widgets.php new file mode 100644 index 000000000..1bf5791ac --- /dev/null +++ b/views/default/admin/appearance/default_widgets.php @@ -0,0 +1,82 @@ +<?php +/** + * Default widgets landing page. + * + * @package Elgg.Core + * @subpackage Administration.DefaultWidgets + */ + +$object = elgg_get_entities(array( + 'type' => 'object', + 'subtype' => 'moddefaultwidgets', + 'limit' => 1, +)); + +if ($object) { + echo elgg_view('output/url', array( + 'text' => elgg_echo('upgrade'), + 'href' => 'action/widgets/upgrade', + 'is_action' => true, + 'is_trusted' => true, + 'class' => 'elgg_button elgg-button-submit', + 'title' => 'Upgrade your default widgets to work on Elgg 1.8', + )); +} + +elgg_push_context('default_widgets'); +$widget_context = get_input('widget_context'); +$list = elgg_trigger_plugin_hook('get_list', 'default_widgets', null, array()); + +// default to something if we can +if (!$widget_context && $list) { + $widget_context = $list[0]['widget_context']; +} + +$current_info = null; +$tabs = array(); +foreach ($list as $info) { + $url = "admin/appearance/default_widgets?widget_context={$info['widget_context']}"; + $selected = false; + if ($widget_context == $info['widget_context']) { + $selected = true; + $current_info = $info; + } + + $tabs[] = array( + 'title' => $info['name'], + 'url' => $url, + 'selected' => $selected + ); +} + +$tabs_vars = array( + 'tabs' => $tabs +); + +echo elgg_view('navigation/tabs', $tabs_vars); + +echo elgg_view('output/longtext', array('value' => elgg_echo('admin:default_widgets:instructions'))); + +if (!$current_info) { + $content = elgg_echo('admin:default_widgets:unknown_type'); +} else { + // default widgets are owned and saved to the site. + elgg_set_page_owner_guid(elgg_get_config('site_guid')); + elgg_push_context($current_info['widget_context']); + + $default_widgets_input = elgg_view('input/hidden', array( + 'name' => 'default_widgets', + 'value' => 1 + )); + + $params = array( + 'content' => $default_widgets_input, + 'num_columns' => $current_info['widget_columns'], + ); + + $content = elgg_view_layout('widgets', $params); + elgg_pop_context(); +} +elgg_pop_context(); + +echo $content; diff --git a/views/default/admin/appearance/menu_items.php b/views/default/admin/appearance/menu_items.php index 4e35e032f..1d5c95cf9 100644 --- a/views/default/admin/appearance/menu_items.php +++ b/views/default/admin/appearance/menu_items.php @@ -7,4 +7,4 @@ */ -echo elgg_view_form('admin/menu/save'); +echo elgg_view_form('admin/menu/save', array('class' => 'elgg-form-settings')); diff --git a/views/default/admin/appearance/profile_fields.php b/views/default/admin/appearance/profile_fields.php index 7077687cc..f1d78c19f 100644 --- a/views/default/admin/appearance/profile_fields.php +++ b/views/default/admin/appearance/profile_fields.php @@ -3,16 +3,22 @@ * Admin area: edit default profile fields */ -$add = elgg_view_form('profile/fields/add', array(), array()); +$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 -<div class="default_profile_reset"> - $reset -</div> +<div class="mtl">$reset</div> __HTML; echo $body; diff --git a/views/default/admin/appearance/profile_fields/list.php b/views/default/admin/appearance/profile_fields/list.php index d14452f47..b9440a95d 100644 --- a/views/default/admin/appearance/profile_fields/list.php +++ b/views/default/admin/appearance/profile_fields/list.php @@ -1,88 +1,55 @@ <?php - +/** + * Profile fields. + * + * @todo Needs some review + */ // List form elements $n = 0; $loaded_defaults = array(); $items = array(); -if ($fieldlist = elgg_get_config('profile_custom_fields')) { +$fieldlist = elgg_get_config('profile_custom_fields'); +if ($fieldlist) { $fieldlistarray = explode(',', $fieldlist); foreach ($fieldlistarray as $listitem) { - if ($translation = elgg_get_config("admin_defined_profile_{$listitem}")) { + $translation = elgg_get_config("admin_defined_profile_$listitem"); + $type = elgg_get_config("admin_defined_profile_type_$listitem"); + if ($translation && $type) { $item = new stdClass; $item->translation = $translation; $item->shortname = $listitem; - $item->name = "admin_defined_profile_{$listitem}"; - $item->type = elgg_get_config("admin_defined_profile_type_{$listitem}"); + $item->name = "admin_defined_profile_$listitem"; + $item->type = elgg_echo("profile:field:$type"); $items[] = $item; } } } ?> - -<script language="javascript" type="text/javascript" src="<?php echo elgg_get_site_url()?>vendors/jquery/jquery.jeditable.mini.js"></script> -<script language="javascript" type="text/javascript"> -var reorderURL = '<?php echo elgg_add_action_tokens_to_url(elgg_get_site_url() . 'action/profile/fields/reorder', FALSE); ?>'; -function sortCallback(event, ui) { - var orderArr = $('#sortable_profile_fields').sortable('toArray'); - var orderStr = orderArr.join(','); - jQuery.post(reorderURL, {'fieldorder': orderStr}); -} - -$(document).ready(function() { - $('#sortable_profile_fields').sortable({ - items: 'li', - handle: '.handle', - stop: sortCallback - }); -}); - -</script> - -<div id="list"> - <ul id="sortable_profile_fields"> +<ul id="elgg-profile-fields" class="mvm"> <?php - $save = elgg_echo('save'); - $cancel = elgg_echo('cancel'); - $edit_url = elgg_add_action_tokens_to_url(elgg_get_site_url()."action/profile/editdefault/editfield", FALSE); - - foreach($items as $item) { - echo <<< END - -<script language="javascript" type="text/javascript"> - - $(function() { - $(".{$item->shortname}_editable").editable("$edit_url ", { - type : 'text', - submitdata: { _method: "post", 'field': '{$item->shortname}' }, - onblur: 'submit', - width:'300px', - height:'none', - style:'display:inline;', - tooltip:'Click to edit label' - }); - }); - -</script> - -END; - - echo elgg_view("profile/", array('value' => $item->translation)); - - //$even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; - $url = elgg_add_action_tokens_to_url(elgg_get_site_url()."action/profile/fields/delete?id={$item->shortname}"); - echo "<li id=\"{$item->shortname}\"><div class='delete-button'><a href=\"$url\">" . elgg_echo('delete') . "</a></div>"; - echo "<img width='16' height='16' class='handle' alt='move' title='Drag here to reorder this item' src='".elgg_get_site_url()."mod/profile/graphics/drag-handle.png'/>"; - echo "<b class=\"profile_field_editable\"><span class=\"{$item->shortname}_editable\">$item->translation</span></b>: [".elgg_echo($item->type)."]"; - echo "</li>"; - - } +$save = elgg_echo('save'); +$cancel = elgg_echo('cancel'); + +foreach ($items as $item) { + echo elgg_view("profile/", array('value' => $item->translation)); + + //$even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; + $url = elgg_view('output/url', array( + 'href' => "action/profile/fields/delete?id={$item->shortname}", + 'text' => elgg_view_icon('delete-alt'), + 'is_action' => true, + 'is_trusted' => true, + )); + $type = elgg_echo($item->type); + echo <<<HTML +<li id="$item->shortname" class="clearfix"> + <span class="elgg-icon elgg-icon-drag-arrow elgg-state-draggable"></span> + <b><span id="elgg-profile-field-{$item->shortname}" class="elgg-state-editable">$item->translation</span></b> [$type] $url +</li> +HTML; +} ?> - </ul> -</div> -<div id="tempList"></div> - -<input name="sortableListOrder" type="hidden" id="sortableListOrder" value="<?php echo $fieldlist; ?>" /> - +</ul>
\ No newline at end of file diff --git a/views/default/admin/components/invalid_plugin.php b/views/default/admin/components/invalid_plugin.php deleted file mode 100644 index 91c073fac..000000000 --- a/views/default/admin/components/invalid_plugin.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php -/** - * Displays an invalid plugin on the admin screen. - * - * An invalid plugin is a plugin whose isValid() method returns false. - * This usually means there are required files missing, unreadable or in the - * wrong format. - * - * @package Elgg.Core - * @subpackage Plugins - */ - -$plugin = elgg_get_array_value('plugin', $vars); -$id = $plugin->getID(); -$path = htmlspecialchars($plugin->getPath()); -$message = elgg_echo('admin:plugins:warning:invalid', array($id)); - -?> - -<div class="plugin_details not_active"> - <p class="plugin-cannot-activate"><?php echo $message; ?></p> - <p><?php echo elgg_echo('admin:plugins:label:location') . ": " . $path; ?></p> -</div> diff --git a/views/default/admin/components/plugin.php b/views/default/admin/components/plugin.php deleted file mode 100644 index 0185ba0ff..000000000 --- a/views/default/admin/components/plugin.php +++ /dev/null @@ -1,214 +0,0 @@ -<?php -/** - * Displays a plugin on the admin screen. - * - * This file renders a plugin for the admin screen, including active/deactive, - * manifest details & display plugin settings. - * - * @package Elgg.Core - * @subpackage Plugins - */ - -$plugin = $vars['plugin']; -$priority = $plugin->getPriority(); -$active = $plugin->isActive(); - -$name = $plugin->manifest->getName(); -$can_activate = $plugin->canActivate(); -$max_priority = elgg_get_max_plugin_priority(); -$actions_base = '/action/admin/plugins/'; - -$ts = time(); -$token = generate_action_token($ts); -$active_class = ($active && $can_activate) ? 'active' : 'not_active'; - -// build reordering links -$links = ''; - -// top and up link only if not at top -if ($priority > 1) { - $top_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( - 'plugin_guid' => $plugin->guid, - 'priority' => 'first', - 'is_action' => true - )); - - $links .= elgg_view('output/url', array( - 'href' => $top_url, - 'text' => elgg_echo('top'), - 'is_action' => true - )); - - $up_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( - 'plugin_guid' => $plugin->guid, - 'priority' => '-1', - 'is_action' => true - )); - - $links .= elgg_view('output/url', array( - 'href' => $up_url, - 'text' => elgg_echo('up'), - 'is_action' => true - )); -} - -// down and bottom links only if not at bottom -if ($priority < $max_priority) { - $down_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( - 'plugin_guid' => $plugin->guid, - 'priority' => '+1', - 'is_action' => true - )); - - $links .= elgg_view('output/url', array( - 'href' => $down_url, - 'text' => elgg_echo('down'), - 'is_action' => true - )); - - $bottom_url = elgg_http_add_url_query_elements($actions_base . 'set_priority', array( - 'plugin_guid' => $plugin->guid, - 'priority' => 'last', - 'is_action' => true - )); - - $links .= elgg_view('output/url', array( - 'href' => $bottom_url, - 'text' => elgg_echo('bottom'), - 'is_action' => true - )); -} - -// activate / deactivate links -if ($can_activate) { - if ($active) { - $action = 'deactivate'; - $class = 'elgg-cancel-button'; - } else { - $action = 'activate'; - $class = 'elgg-submit-button'; - } - - $url = elgg_http_add_url_query_elements($actions_base . $action, array( - 'plugin_guids[]' => $plugin->guid, - 'is_action' => true - )); - - $action_button = elgg_view('output/url', array( - 'href' => $url, - 'text' => elgg_echo($action), - 'is_action' => true, - 'class' => "elgg-button $class" - )); -} else { - $action_button = elgg_view('output/url', array( - 'text' => elgg_echo('admin:plugins:cannot_activate'), - 'disabled' => 'disabled', - 'class' => "elgg-action-button disabled" - )); -} - -// Display categories -$categories_html = ''; -if ($categories) { - $categories_arr = array(); - $base_url = elgg_get_site_url() . "pg/admin/plugins?category="; - - foreach ($categories as $category) { - $url = $base_url . urlencode($category); - $categories_arr[] = "<a href=\"$url\">" . htmlspecialchars($category) . '</a>'; - } - - $categories_html = implode(', ', $categories_arr); -} - -// @todo We need to make a page handler to read these files in. -// this is broken. -$screenshots_html = ''; -$screenshots = $plugin->manifest->getScreenshots(); -if ($screenshots) { - $base_url = elgg_get_plugins_path() . $plugin->getID() . '/'; - foreach ($screenshots as $screenshot) { - $screenshot_full = "{$vars['url']}pg/admin_plugin_screenshot/{$plugin->getID()}/full/{$screenshot['path']}"; - $screenshot_src = "{$vars['url']}pg/admin_plugin_screenshot/{$plugin->getID()}/thumbnail/{$screenshot['path']}"; - - $screenshots_html .= "<li class=\"elgg-plugin-screenshot prm ptm\"><a href=\"$screenshot_full\"><img src=\"$screenshot_src\"></a></li>"; - } -} - -// metadata -$description = elgg_view('output/longtext', array('value' => $plugin->manifest->getDescription())); -$author = '<span>' . elgg_echo('admin:plugins:label:author') . '</span>: ' - . elgg_view('output/text', array('value' => $plugin->manifest->getAuthor())); -$version = htmlspecialchars($plugin->manifest->getVersion()); -$website = elgg_view('output/url', array( - 'href' => $plugin->manifest->getWebsite(), - 'text' => $plugin->manifest->getWebsite() -)); - -$copyright = elgg_view('output/text', array('value' => $plugin->manifest->getCopyright())); -$license = elgg_view('output/text', array('value' => $plugin->manifest->getLicense())); - -?> - -<div class="plugin_details <?php echo $active_class ?>"> - <div class="admin_plugin_reorder"> - <?php echo "$links"; ?> - </div><div class="clearfloat"></div> - - <div class="admin_plugin_enable_disable"><?php echo $action_button; ?></div> - -<?php -$settings_view = 'settings/' . $plugin->getID() . '/edit'; -if (elgg_view_exists($settings_view)) { - $link = elgg_get_site_url() . "pg/admin/plugin_settings/" . $plugin->getID(); - $settings_link = "<a class='plugin_settings small link' href='$link'>[" . elgg_echo('settings') . "]</a>"; -} -?> - <h3><?php echo $plugin->manifest->getName() . " $version $settings_link"; ?></h3> - <div class="plugin_description"><?php echo $description; ?></div> - <p class="plugin_author"><?php echo $author . ' - ' . $website; ?></p> - - <?php - if ($plugin->manifest->getApiVersion() < 1.8) { - $reqs = $plugin->manifest->getRequires(); - if (!$reqs) { - $message = elgg_echo('admin:plugins:warning:elgg_version_unknown'); - echo "<p class=\"plugin-cannot-activate\">$message</p>"; - } - } - - if (!$can_activate) { - $message = elgg_echo('admin:plugins:warning:unmet_dependencies'); - echo "<p class=\"elgg-unsatisfied-dependency\">$message</p>"; - } - ?> - - <div class="pts"><a class="manifest_details small link"><?php echo elgg_echo("admin:plugins:label:moreinfo"); ?></a></div> - - <div class="manifest_file hidden"> - - <div><?php echo elgg_echo('admin:plugins:label:location') . ": " . htmlspecialchars($plugin->getPath()) ?></div> - <?php - if ($categories_html) { - ?> - <div><?php echo elgg_echo('admin:plugins:label:categories') . ": " . $categories_html; ?></div> - <?php - } - - if ($screenshots_html) { - ?> - <div><ul><?php echo $screenshots_html; ?></ul></div> - <?php - } - ?> - <div><?php echo elgg_echo('admin:plugins:label:copyright') . ": " . $copyright; ?></div> - <div><?php echo elgg_echo('admin:plugins:label:licence') . ": " . $license; ?></div> - - <div><?php echo elgg_echo('admin:plugins:label:dependencies'); ?>: - <?php - echo elgg_view('admin/components/plugin_dependencies', array('plugin' => $plugin)); - ?> - </div> - </div> -</div>
\ No newline at end of file diff --git a/views/default/admin/components/plugin_dependencies.php b/views/default/admin/components/plugin_dependencies.php deleted file mode 100644 index cd38e98b0..000000000 --- a/views/default/admin/components/plugin_dependencies.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php -/** - * Shows a table of plugin dependecies for ElggPlugin in $vars['plugin']. - * - * This uses a table because it's a table of data. - * - * @package Elgg.Core - * @subpackage Admin.Plugins - */ - -$plugin = elgg_get_array_value('plugin', $vars, false); -$deps = $plugin->package->checkDependencies(true); - -$columns = array('type', 'name', 'expected_value', 'local_value', 'comment'); - -echo '<table class="elgg-plugins-dependencies styled"> - <tr> -'; - -foreach ($columns as $column) { - $column = elgg_echo("admin:plugins:dependencies:$column"); - echo "<th class=\"pas\">$column</th>"; -} - -echo '<tr/>'; - -$row = 'odd'; -foreach ($deps as $dep) { - $fields = elgg_get_plugin_dependency_strings($dep); - - if ($dep['status']) { - $class = 'elgg-satisfied-dependency'; - } else { - $class = 'elgg-unsatisfied-dependency'; - } - - echo "<tr class=\"$row\">"; - - foreach ($columns as $column) { - echo "<td class=\"pas $class\">{$fields[$column]}</td>"; - } - - echo '</tr>'; - - $row = ($row == 'odd') ? 'even' : 'odd'; -} - -echo '</table>';
\ No newline at end of file diff --git a/views/default/admin/components/plugin_settings.php b/views/default/admin/components/plugin_settings.php deleted file mode 100644 index 0a4891145..000000000 --- a/views/default/admin/components/plugin_settings.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php -/** - * Elgg plugin settings - * - * @package Elgg - * @subpackage Core - */ - -$plugin = $vars['plugin']; -$plugin_info = load_plugin_manifest($plugin); - -$form_body = elgg_view("settings/{$plugin}/edit", $vars); -$form_body .= elgg_view('input/hidden', array('internalname' => 'plugin', 'value' => $plugin)); -$form_body .= elgg_view('input/submit', array('value' => elgg_echo('save'))); -//$form_body .= elgg_view('input/reset', array('value' => elgg_echo('reset'))); - -?> -<div class="elgg-module elgg-inline-module"> - <div class="elgg-head"> - <h3><?php echo $plugin_info['name']; ?></h3> - </div> - <div class="elgg-body"> - <?php - echo elgg_view('input/form', array( - 'body' => $form_body, - 'internalid' => 'plugin_settings', - 'action' => "action/plugins/settings/save", - )); - ?> - </div> -</div> diff --git a/views/default/admin/dashboard.php b/views/default/admin/dashboard.php index 1b042f14b..d3976ca38 100644 --- a/views/default/admin/dashboard.php +++ b/views/default/admin/dashboard.php @@ -1,6 +1,6 @@ <?php -elgg_set_page_owner_guid(get_loggedin_userid()); +elgg_set_page_owner_guid(elgg_get_logged_in_user_guid()); $params = array( 'num_columns' => 2, diff --git a/views/default/admin/footer.php b/views/default/admin/footer.php new file mode 100644 index 000000000..ce420e99a --- /dev/null +++ b/views/default/admin/footer.php @@ -0,0 +1,9 @@ +<?php +/** + * Elgg admin footer. Extend this view to add content to the admin footer + */ + +$options = array( + 'class' => 'elgg-menu-hz' +); +echo elgg_view_menu('admin_footer', $options);
\ No newline at end of file diff --git a/views/default/admin/header.php b/views/default/admin/header.php new file mode 100644 index 000000000..331190a88 --- /dev/null +++ b/views/default/admin/header.php @@ -0,0 +1,27 @@ +<?php +/** + * Elgg admin header + */ +$admin_title = elgg_get_site_entity()->name . ' ' . elgg_echo('admin'); + +$view_site = elgg_view('output/url', array( + 'href' => elgg_get_site_url(), + 'text' => elgg_echo('admin:view_site'), + 'is_trusted' => true, +)); +$logout = elgg_view('output/url', array( + 'href' => 'action/logout', + 'text' => elgg_echo('logout'), + 'is_trusted' => true, +)); +?> +<h1 class="elgg-heading-site"> + <a href="<?php echo elgg_get_site_url(); ?>admin"> + <?php echo $admin_title; ?> + </a> +</h1> +<ul class="elgg-menu-user"> + <li><?php echo elgg_echo('admin:loggedin', array(elgg_get_logged_in_user_entity()->name)); ?></li> + <li><?php echo $view_site; ?></li> + <li><?php echo $logout; ?></li> +</ul>
\ No newline at end of file diff --git a/views/default/admin/plugin_settings.php b/views/default/admin/plugin_settings.php new file mode 100644 index 000000000..1c6e9e206 --- /dev/null +++ b/views/default/admin/plugin_settings.php @@ -0,0 +1,26 @@ +<?php +/** + * Elgg plugin settings + * + * @uses ElggPlugin $vars['plugin'] The plugin object to display settings for. + * + * @package Elgg.Core + * @subpackage Plugins.Settings + */ + +$plugin = $vars['plugin']; +$plugin_id = $plugin->getID(); + +// required for plugin settings backward compatibility +$vars['entity'] = $plugin; + +$settings = false; + +if (elgg_view_exists("settings/$plugin_id/edit") || elgg_view_exists("plugins/$plugin_id/settings")) { + $title = $plugin->getManifest()->getName(); + + $params = array('id' => "$plugin_id-settings", 'class' => 'elgg-form-settings'); + $body = elgg_view_form("plugins/settings/save", $params, $vars); + + echo elgg_view_module('info', $title, $body); +}
\ No newline at end of file diff --git a/views/default/admin/plugins.php b/views/default/admin/plugins.php new file mode 100644 index 000000000..42f153d0f --- /dev/null +++ b/views/default/admin/plugins.php @@ -0,0 +1,197 @@ +<?php +/** + * Elgg administration plugin screen + * + * Shows a list of plugins that can be sorted and filtered. + * + * @package Elgg.Core + * @subpackage Admin.Plugins + */ + +elgg_load_js('lightbox'); +elgg_load_css('lightbox'); + +elgg_generate_plugin_entities(); +$installed_plugins = elgg_get_plugins('any'); +$show_category = get_input('category', 'all'); +$sort = get_input('sort', 'priority'); + +// Get a list of the all categories +// and trim down the plugin list if we're not viewing all categories. +// @todo this could be cached somewhere after have the manifest loaded +$categories = array(); + +foreach ($installed_plugins as $id => $plugin) { + if (!$plugin->isValid()) { + if ($plugin->isActive()) { + // force disable and warn + elgg_add_admin_notice('invalid_and_deactivated_' . $plugin->getID(), + elgg_echo('ElggPlugin:InvalidAndDeactivated', array($plugin->getId()))); + $plugin->deactivate(); + } + continue; + } + + $plugin_categories = $plugin->getManifest()->getCategories(); + + // handle plugins that don't declare categories + // unset them here because this is the list we foreach + switch ($show_category) { + case 'all': + break; + case 'active': + if (!$plugin->isActive()) { + unset($installed_plugins[$id]); + } + break; + case 'inactive': + if ($plugin->isActive()) { + unset($installed_plugins[$id]); + } + break; + case 'nonbundled': + if (in_array('bundled', $plugin_categories)) { + unset($installed_plugins[$id]); + } + break; + default: + if (!in_array($show_category, $plugin_categories)) { + unset($installed_plugins[$id]); + } + break; + } + + if (isset($plugin_categories)) { + foreach ($plugin_categories as $category) { + if (!array_key_exists($category, $categories)) { + $categories[$category] = ElggPluginManifest::getFriendlyCategory($category); + } + } + } +} + +$guids = array(); +foreach ($installed_plugins as $plugin) { + $guids[] = $plugin->getGUID(); +} + +// sort plugins +switch ($sort) { + case 'date': + $plugin_list = array(); + foreach ($installed_plugins as $plugin) { + $create_date = $plugin->getTimeCreated(); + while (isset($plugin_list[$create_date])) { + $create_date++; + } + $plugin_list[$create_date] = $plugin; + } + krsort($plugin_list); + break; + case 'alpha': + $plugin_list = array(); + foreach ($installed_plugins as $plugin) { + $plugin_list[$plugin->getFriendlyName()] = $plugin; + } + ksort($plugin_list); + break; + case 'priority': + default: + $plugin_list = $installed_plugins; + break; +} + + + +asort($categories); + +// we want bundled/nonbundled pulled to be at the top of the list +unset($categories['bundled']); +unset($categories['nonbundled']); + +$common_categories = array( + 'all' => elgg_echo('admin:plugins:category:all'), + 'active' => elgg_echo('admin:plugins:category:active'), + 'inactive' => elgg_echo('admin:plugins:category:inactive'), + 'bundled' => elgg_echo('admin:plugins:category:bundled'), + 'nonbundled' => elgg_echo('admin:plugins:category:nonbundled'), +); + +$categories = array_merge($common_categories, $categories); +// security - only want a defined option +if (!array_key_exists($show_category, $categories)) { + $show_category = reset($categories); +} + +$category_form = elgg_view_form('admin/plugins/filter', array( + 'action' => 'admin/plugins', + 'method' => 'get', + 'disable_security' => true, +), array( + 'category' => $show_category, + 'category_options' => $categories, + 'sort' => $sort, +)); + + +$sort_options = array( + 'priority' => elgg_echo('admin:plugins:sort:priority'), + 'alpha' => elgg_echo('admin:plugins:sort:alpha'), + 'date' => elgg_echo('admin:plugins:sort:date'), +); +// security - only want a defined option +if (!array_key_exists($sort, $sort_options)) { + $sort = reset($sort_options); +} + +$sort_form = elgg_view_form('admin/plugins/sort', array( + 'action' => 'admin/plugins', + 'method' => 'get', + 'disable_security' => true, +), array( + 'sort' => $sort, + 'sort_options' => $sort_options, + 'category' => $show_category, +)); + +$buttons = "<div class=\"clearfix mbm\">"; +$buttons .= elgg_view_form('admin/plugins/change_state', array( + 'action' => 'action/admin/plugins/activate_all', + 'class' => 'float', +), array( + 'guids' => $guids, + 'action' => 'activate', +)); +$buttons .= elgg_view_form('admin/plugins/change_state', array( + 'action' => 'action/admin/plugins/deactivate_all', + 'class' => 'float', +), array( + 'guids' => $guids, + 'action' => 'deactivate', +)); +$buttons .= "</div>"; + +$buttons .= $category_form . $sort_form; + +// construct page header +?> +<div id="content_header" class="mbm clearfix"> + <div class="content-header-options"><?php echo $buttons ?></div> +</div> + +<div id="elgg-plugin-list"> +<?php + +$options = array( + 'limit' => 0, + 'full_view' => true, + 'list_type_toggle' => false, + 'pagination' => false, +); +if ($show_category == 'all' && $sort == 'priority') { + $options['display_reordering'] = true; +} +echo elgg_view_entity_list($plugin_list, $options); + +?> +</div>
\ No newline at end of file diff --git a/views/default/admin/plugins/advanced.php b/views/default/admin/plugins/advanced.php deleted file mode 100644 index 0815739f5..000000000 --- a/views/default/admin/plugins/advanced.php +++ /dev/null @@ -1,97 +0,0 @@ -<?php -/** - * Elgg administration advanced plugin screen - * - * Shows a list of all plugins sorted by load order. - * - * @package Elgg.Core - * @subpackage Admin.Plugins - */ - -elgg_generate_plugin_entities(); -$installed_plugins = elgg_get_plugins('any'); -$show_category = get_input('category', null); - -// Get a list of the all categories -// and trim down the plugin list if we're not viewing all categories. -// @todo this could be cached somewhere after have the manifest loaded -$categories = array(); - -foreach ($installed_plugins as $plugin) { - if (!$plugin->isValid()) { - continue; - } - - $plugin_categories = $plugin->manifest->getCategories(); - - // handle plugins that don't declare categories - // unset them here because this is the list we foreach - if ($show_category && !in_array($show_category, $plugin_categories)) { - unset($installed_plugins[$id]); - } - - if (isset($plugin_categories)) { - foreach ($plugin_categories as $category) { - if (!array_key_exists($category, $categories)) { - $categories[$category] = elgg_echo("admin:plugins:label:moreinfo:categories:$category"); - } - } - } -} - -$ts = time(); -$token = generate_action_token($ts); -$categories = array_merge(array('' => elgg_echo('admin:plugins:categories:all')), $categories); - -$category_dropdown = elgg_view('input/dropdown', array( - 'internalname' => 'category', - 'options_values' => $categories, - 'value' => $show_category -)); - -$category_button = elgg_view('input/submit', array( - 'value' => elgg_echo('filter'), - 'class' => 'elgg-action-button' -)); - -$category_form = elgg_view('input/form', array( - 'body' => $category_dropdown . $category_button -)); - -// @todo Until "en/deactivate all" means "All plugins on this page" hide when not looking at all. -if (!isset($show_category) || empty($show_category)) { - $activate_url = "{$CONFIG->url}action/admin/plugins/activate_all?__elgg_token=$token&__elgg_ts=$ts"; - $deactivate_url = "{$CONFIG->url}action/admin/plugins/deactivate_all?__elgg_token=$token&__elgg_ts=$ts"; - - $buttons = "<a class='elgg-action-button' href=\"$activate_url\">" . elgg_echo('admin:plugins:activate_all') . '</a> '; - $buttons .= "<a class='elgg-action-button disabled' href=\"$deactivate_url\">" . elgg_echo('admin:plugins:deactivate_all') . '</a> '; - $buttons .= "<br /><br />"; -} else { - $buttons = ''; -} - -$buttons .= $category_form; - -// construct page header -?> -<div id="content_header" class="clearfix"> - <div class="content-header-options"><?php echo $buttons ?></div> -</div> -<br /> -<?php - -// Display list of plugins -foreach ($installed_plugins as $plugin) { - $view = ($plugin->isValid()) ? 'admin/components/plugin' : 'admin/components/invalid_plugin'; - echo elgg_view($view, array( - 'plugin' => $plugin - )); -} -?> -<script type="text/javascript"> - $(document).ready(function() { - $('a.manifest_details.link').click(function() { - elgg_slide_toggle($(this), '.plugin_details', '.manifest_file'); - }); - }); -</script>
\ No newline at end of file diff --git a/views/default/admin/plugins/simple.php b/views/default/admin/plugins/simple.php deleted file mode 100644 index e9d7d5ffb..000000000 --- a/views/default/admin/plugins/simple.php +++ /dev/null @@ -1,111 +0,0 @@ -<?php -/** - * Elgg administration simple plugin screen - * - * Shows an alphabetical list of "simple" plugins. - * - * @package Elgg - * @subpackage Core - */ - -elgg_generate_plugin_entities(); -$installed_plugins = elgg_get_plugins('any'); -$plugin_list = array(); - -foreach ($installed_plugins as $plugin) { - if (!$plugin->isValid()) { - continue; - } - $interface = $plugin->manifest->getAdminInterface(); - if ($interface == 'simple') { - $plugin_list[$plugin->manifest->getName()] = $plugin; - } -} - -ksort($plugin_list); - -$form_body .= <<<___END - <ul class="admin_plugins margin-top"> -___END; - -$actions_base = '/action/admin/plugins/'; -$ts = time(); -$token = generate_action_token($ts); - -foreach ($plugin_list as $name => $plugin) { - $plugin_guid = $plugin->guid; - $plugin_id = $plugin->getID(); - $active = $plugin->isActive(); - $can_activate = $plugin->canActivate(); - $author = $plugin->manifest->getAuthor(); - $version = $plugin->manifest->getVersion(); - $website = $plugin->manifest->getWebsite(); - $description = $plugin->manifest->getDescription(); - - if ($active) { - $active_class = 'active'; - $checked = 'checked="checked"'; - } else { - $active_class = 'not_active'; - $checked = ''; - } - - if ($can_activate) { - $disabled = ''; - } else { - $disabled = 'disabled="disabled"'; - $description .= '<p>' . elgg_echo('admin:plugins:simple:cannot_activate') . '</p>'; - } - - $description = elgg_view('output/longtext', array('value' => $description)); - - $author_html = $link_html = $version_html = $settings_html = ''; - - if ($author) { - $author_html = elgg_echo('admin:plugins:author', array($author)); - } - - if ($version) { - $version_html = ' | ' . elgg_echo('admin:plugins:version', array($version)); - } - - if ($website) { - $link_html = " | <a href=\"$website\">" . elgg_echo('admin:plugins:plugin_website') . '</a>'; - } - - if (elgg_view_exists("settings/$plugin_id/edit")) { - $settings_href = elgg_get_site_url() . "pg/admin/plugin_settings/$plugin_id"; - $settings_html = " | <a class='plugin_settings link' href='$settings_href'>" . elgg_echo('settings') . "</a>"; - } - - $form_body .= <<<___END - <li class="plugin_details $active_class"> - <span class="plugin_controls"> - <input type="checkbox" id="$plugin_guid" class="plugin_enabled" $checked $disabled name="active_plugin_guids[]" value="$plugin_guid"/> - <label for="$plugin_guid">$name</label> - </span> - - <span class="plugin_info"> - <span class="plugin_description"> - $description - </span> - <span class="plugin_metadata small"> - $author_html - $version_html - $link_html - $settings_html - </span> - </span> - </li> -___END; -} - -$form_body .= '</ul>'; -$form_body .= elgg_view('input/submit', array('value' => elgg_echo('save'))); -$form_body .= elgg_view('input/reset', array('value' => elgg_echo('reset'), 'class' => 'elgg-action-button disabled')); - -echo elgg_view('input/form', array( - 'action' => "action/admin/plugins/simple_update_states", - 'body' => $form_body, - 'class' => 'admin_plugins_simpleview' -));
\ No newline at end of file diff --git a/views/default/admin/settings/advanced.php b/views/default/admin/settings/advanced.php new file mode 100644 index 000000000..a262740f2 --- /dev/null +++ b/views/default/admin/settings/advanced.php @@ -0,0 +1,9 @@ +<?php +/** + * Elgg administration site advanced settings + * + * @package Elgg + * @subpackage Core + */ + +echo elgg_view_form('admin/site/update_advanced', array('class' => 'elgg-form-settings')); diff --git a/views/default/admin/settings/advanced/site_secret.php b/views/default/admin/settings/advanced/site_secret.php new file mode 100644 index 000000000..e70ac7ab6 --- /dev/null +++ b/views/default/admin/settings/advanced/site_secret.php @@ -0,0 +1,11 @@ +<?php +/** + * Elgg administration site secret settings + * + * @package Elgg + * @subpackage Core + */ + +echo elgg_view_form('admin/site/regenerate_secret', array(), array( + 'strength' => _elgg_get_site_secret_strength(), +)); diff --git a/views/default/admin/settings/basic.php b/views/default/admin/settings/basic.php new file mode 100644 index 000000000..9334ba81b --- /dev/null +++ b/views/default/admin/settings/basic.php @@ -0,0 +1,9 @@ +<?php +/** + * Elgg administration site basic settings + * + * @package Elgg + * @subpackage Core + */ + +echo elgg_view_form('admin/site/update_basic', array('class' => 'elgg-form-settings')); diff --git a/views/default/admin/sidebar.php b/views/default/admin/sidebar.php new file mode 100644 index 000000000..100ce2af8 --- /dev/null +++ b/views/default/admin/sidebar.php @@ -0,0 +1,8 @@ +<?php +/** + * Admin sidebar -- just outputs the page menus + */ + +$content = elgg_view_menu('page', array('sort_by' => 'priority', 'show_section_headers' => true)); + +echo elgg_view_module('main', '', $content, array('class' => 'elgg-admin-sidebar-menu'));
\ No newline at end of file diff --git a/views/default/admin/site/advanced.php b/views/default/admin/site/advanced.php deleted file mode 100644 index d3daf0c8e..000000000 --- a/views/default/admin/site/advanced.php +++ /dev/null @@ -1,103 +0,0 @@ -<?php -/** - * Elgg administration site advanced settings - * - * @package Elgg - * @subpackage Core - */ - -$action = elgg_get_site_url() . "action/admin/site/update_advanced"; - -$form_body = ""; - -foreach (array('wwwroot', 'path', 'dataroot', 'view') as $field) { - $form_body .= "<p>"; - $form_body .= elgg_echo('installation:' . $field) . "<br />"; - $warning = elgg_echo('installation:warning:' . $field); - if ($warning != 'installation:warning:' . $field) { - echo "<b>" . $warning . "</b><br />"; - } - $value = elgg_get_config($field); - $form_body .= elgg_view("input/text",array('internalname' => $field, 'value' => $value)); - $form_body .= "</p>"; -} - -$form_body .= "<p>" . elgg_echo('admin:site:access:warning') . "<br />"; -$form_body .= elgg_echo('installation:sitepermissions'); -$form_body .= elgg_view('input/access', array( - 'internalname' => 'default_access', - 'value' => elgg_get_config('default_access'), -)) . "</p>"; -$form_body .= "<p>" . elgg_echo('installation:allow_user_default_access:description') . "<br />"; -$form_body .= elgg_view("input/checkboxes", array( - 'options' => array(elgg_echo('installation:allow_user_default_access:label')), - 'internalname' => 'allow_user_default_access', - 'value' => (elgg_get_config('allow_user_default_access') ? elgg_echo('installation:allow_user_default_access:label') : ""), -)) . "</p>"; -$form_body .= "<p>" . elgg_echo('installation:simplecache:description') . "<br />"; -$form_body .= elgg_view("input/checkboxes", array( - 'options' => array(elgg_echo('installation:simplecache:label')), - 'internalname' => 'simplecache_enabled', - 'value' => (elgg_get_config('simplecache_enabled') ? elgg_echo('installation:simplecache:label') : ""), -)) . "</p>"; -$form_body .= "<p>" . elgg_echo('installation:viewpathcache:description') . "<br />"; -$form_body .= elgg_view("input/checkboxes", array( - 'options' => array(elgg_echo('installation:viewpathcache:label')), - 'internalname' => 'viewpath_cache_enabled', - 'value' => (elgg_get_config('viewpath_cache_enabled') ? elgg_echo('installation:viewpathcache:label') : ""), -)) . "</p>"; - -$debug_options = array('0' => elgg_echo('installation:debug:none'), 'ERROR' => elgg_echo('installation:debug:error'), 'WARNING' => elgg_echo('installation:debug:warning'), 'NOTICE' => elgg_echo('installation:debug:notice')); -$form_body .= "<p>" . elgg_echo('installation:debug'); -$form_body .= elgg_view('input/dropdown', array( - 'options_values' => $debug_options, - 'internalname' => 'debug', - 'value' => elgg_get_config('debug'), -)); -$form_body .= '</p>'; - -// control new user registration -$options = array( - 'options' => array(elgg_echo('installation:registration:label')), - 'internalname' => 'allow_registration', - 'value' => elgg_get_config('allow_registration') ? elgg_echo('installation:registration:label') : '', -); -$form_body .= '<p>' . elgg_echo('installation:registration:description'); -$form_body .= '<br />' .elgg_view('input/checkboxes', $options) . '</p>'; - -// control walled garden -$walled_garden = elgg_get_config(walled_garden); -$options = array( - 'options' => array(elgg_echo('installation:walled_garden:label')), - 'internalname' => 'walled_garden', - 'value' => $walled_garden ? elgg_echo('installation:walled_garden:label') : '', -); -$form_body .= '<p>' . elgg_echo('installation:walled_garden:description'); -$form_body .= '<br />' . elgg_view('input/checkboxes', $options) . '</p>'; - -$form_body .= "<p>" . elgg_echo('installation:httpslogin') . "<br />"; -$form_body .= elgg_view("input/checkboxes", array( - 'options' => array(elgg_echo('installation:httpslogin:label')), - 'internalname' => 'https_login', - 'value' => (elgg_get_config('https_login') ? elgg_echo('installation:httpslogin:label') : "") -)) . "</p>"; - -$form_body .= "<p>" . elgg_echo('installation:disableapi') . "<br />"; -$on = elgg_echo('installation:disableapi:label'); -$disable_api = elgg_get_config('disable_api'); -if ($disable_api) { - $on = (disable_api ? "" : elgg_echo('installation:disableapi:label')); -} -$form_body .= elgg_view("input/checkboxes", array( - 'options' => array(elgg_echo('installation:disableapi:label')), - 'internalname' => 'api', - 'value' => $on, -)); -$form_body .= "</p>"; - -$form_body .= elgg_view('input/hidden', array('internalname' => 'settings', 'value' => 'go')); - -$form_body .= "<div class='divider'></div>".elgg_view('input/submit', array('value' => elgg_echo("save"))); -$form_body = "<div class='admin_settings site_admin'>" . $form_body . "</div>"; - -echo elgg_view('input/form', array('action' => $action, 'body' => $form_body)); diff --git a/views/default/admin/site/basic.php b/views/default/admin/site/basic.php deleted file mode 100644 index 4adef7e45..000000000 --- a/views/default/admin/site/basic.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php -/** - * Elgg administration site basic settings - * - * @package Elgg - * @subpackage Core - */ - -$action = elgg_get_site_url() . "action/admin/site/update_basic"; - -$form_body = ""; - -foreach (array('sitename','sitedescription', 'siteemail') as $field) { - $form_body .= "<p>"; - $form_body .= elgg_echo('installation:' . $field) . "<br />"; - $warning = elgg_echo('installation:warning:' . $field); - if ($warning != 'installation:warning:' . $field) { - echo "<b>" . $warning . "</b><br />"; - } - $value = elgg_get_config($field); - $form_body .= elgg_view("input/text",array('internalname' => $field, 'value' => $value)); - $form_body .= "</p>"; -} - -$languages = get_installed_translations(); -$form_body .= "<p>" . elgg_echo('installation:language'); -$form_body .= elgg_view("input/dropdown", array( - 'internalname' => 'language', - 'value' => elgg_get_config('language'), - 'options_values' => $languages, -)) . "</p>"; - -$form_body .= "<div class='divider'></div>".elgg_view('input/submit', array('value' => elgg_echo("save"))); -$form_body = "<div class='admin_settings site_admin'>".$form_body."</div>"; - -echo elgg_view('input/form', array('action' => $action, 'body' => $form_body)); diff --git a/views/default/admin/statistics/overview.php b/views/default/admin/statistics/overview.php index 52bd4ddb2..ac5aaac36 100644 --- a/views/default/admin/statistics/overview.php +++ b/views/default/admin/statistics/overview.php @@ -6,79 +6,8 @@ * @subpackage Core */ -// Work out number of users -$users_stats = get_number_users(); -$total_users = get_number_users(true); - -// Get version information -$version = get_version(); -$release = get_version(true); - echo elgg_view('admin/statistics/extend'); -?> -<div class="elgg-module elgg-inline-module"> - <div class="elgg-head"> - <h3><?php echo elgg_echo('admin:statistics:label:basic'); ?></h3> - </div> - <div class="elgg-body"> - <table class="elgg-table-alt"> - <tr class="odd"> - <td><b><?php echo elgg_echo('admin:statistics:label:version'); ?> :</b></td> - <td><?php echo elgg_echo('admin:statistics:label:version:release'); ?> - <?php echo $release; ?>, <?php echo elgg_echo('admin:statistics:label:version:version'); ?> - <?php echo $version; ?></td> - </tr> - <tr class="even"> - <td><b><?php echo elgg_echo('admin:statistics:label:numusers'); ?> :</b></td> - <td><?php echo $users_stats; ?> <?php echo elgg_echo('active'); ?> / <?php echo $total_users; ?> <?php echo elgg_echo('total') ?></td> - </tr> - </table> - </div> -</div> - -<?php - -// Get entity statistics -$entity_stats = get_entity_statistics(); -$even_odd = ""; -?> -<div class="elgg-module elgg-inline-module"> - <div class="elgg-head"> - <h3><?php echo elgg_echo('admin:statistics:label:numentities'); ?></h3> - </div> - <div class="elgg-body"> - <table class="elgg-table-alt"> - <?php - foreach ($entity_stats as $k => $entry) { - arsort($entry); - foreach ($entry as $a => $b) { - - //This function controls the alternating class - $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; - - if ($a == "__base__") { - $a = elgg_echo("item:{$k}"); - if (empty($a)) - $a = $k; - } else { - if (empty($a)) { - $a = elgg_echo("item:{$k}"); - } else { - $a = elgg_echo("item:{$k}:{$a}"); - } +echo elgg_view_module('inline', elgg_echo('admin:statistics:label:basic'), elgg_view('admin/statistics/overview/basic')); - if (empty($a)) { - $a = "$k $a"; - } - } - echo <<< END - <tr class="{$even_odd}"> - <td>{$a}:</td> - <td>{$b}</td> - </tr> -END; - } - } - ?> - </table> - </div> -</div>
\ No newline at end of file +echo elgg_view_module('inline', elgg_echo('admin:statistics:label:numentities'), elgg_view('admin/statistics/overview/numentities')); diff --git a/views/default/admin/statistics/overview/basic.php b/views/default/admin/statistics/overview/basic.php new file mode 100644 index 000000000..2c9b3b88e --- /dev/null +++ b/views/default/admin/statistics/overview/basic.php @@ -0,0 +1,19 @@ +<?php +// Work out number of users +$users_stats = get_number_users(); +$total_users = get_number_users(true); + +// Get version information +$version = get_version(); +$release = get_version(true); +?> +<table class="elgg-table-alt"> + <tr class="odd"> + <td><b><?php echo elgg_echo('admin:statistics:label:version'); ?> :</b></td> + <td><?php echo elgg_echo('admin:statistics:label:version:release'); ?> - <?php echo $release; ?>, <?php echo elgg_echo('admin:statistics:label:version:version'); ?> - <?php echo $version; ?></td> + </tr> + <tr class="even"> + <td><b><?php echo elgg_echo('admin:statistics:label:numusers'); ?> :</b></td> + <td><?php echo $users_stats; ?> <?php echo elgg_echo('active'); ?> / <?php echo $total_users; ?> <?php echo elgg_echo('total') ?></td> + </tr> +</table>
\ No newline at end of file diff --git a/views/default/admin/statistics/overview/numentities.php b/views/default/admin/statistics/overview/numentities.php new file mode 100644 index 000000000..af4ae2773 --- /dev/null +++ b/views/default/admin/statistics/overview/numentities.php @@ -0,0 +1,40 @@ +<?php +// Get entity statistics +$entity_stats = get_entity_statistics(); +$even_odd = ""; +?> +<table class="elgg-table-alt"> +<?php +foreach ($entity_stats as $k => $entry) { + arsort($entry); + foreach ($entry as $a => $b) { + + //This function controls the alternating class + $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; + + if ($a == "__base__") { + $a = elgg_echo("item:{$k}"); + if (empty($a)) + $a = $k; + } else { + if (empty($a)) { + $a = elgg_echo("item:{$k}"); + } else { + $a = elgg_echo("item:{$k}:{$a}"); + } + + if (empty($a)) { + $a = "$k $a"; + } + } + + echo <<< END + <tr class="{$even_odd}"> + <td>{$a}:</td> + <td>{$b}</td> + </tr> +END; + } + } +?> +</table> diff --git a/views/default/admin/statistics/server.php b/views/default/admin/statistics/server.php new file mode 100644 index 000000000..9d21addc1 --- /dev/null +++ b/views/default/admin/statistics/server.php @@ -0,0 +1,8 @@ +<?php +/** + * Server information + */ + +echo elgg_view_module('inline', elgg_echo('admin:server:label:web_server'), elgg_view('admin/statistics/server/web_server')); + +echo elgg_view_module('inline', elgg_echo('admin:server:label:php'), elgg_view('admin/statistics/server/php')); diff --git a/views/default/admin/statistics/server/php.php b/views/default/admin/statistics/server/php.php new file mode 100644 index 000000000..7c6a51383 --- /dev/null +++ b/views/default/admin/statistics/server/php.php @@ -0,0 +1,50 @@ +<?php +/** + * Server PHP info + */ + +$php_log = ini_get('error_log'); +if (!$php_log) { + $php_log = elgg_echo('admin:server:error_log'); +} + +$post_max_size = elgg_get_ini_setting_in_bytes('post_max_size'); +$upload_max_filesize = elgg_get_ini_setting_in_bytes('upload_max_filesize'); + +$post_max_size_warning = ''; +if ($upload_max_filesize > $post_max_size) { + // @todo show a link to something like http://nigel.mcnie.name/blog/uploadmaxfilesizepostmaxsize-experimentation ? + $post_max_size_warning = elgg_echo('admin:server:warning:post_max_too_small'); +} + +?> +<table class="elgg-table-alt"> + <tr class="odd"> + <td><b><?php echo elgg_echo('admin:server:label:php_version'); ?> :</b></td> + <td><?php echo phpversion(); ?></td> + </tr> + <tr class="even"> + <td><b><?php echo elgg_echo('admin:server:label:php_ini'); ?> :</b></td> + <td><?php echo php_ini_loaded_file(); ?></td> + </tr> + <tr class="odd"> + <td><b><?php echo elgg_echo('admin:server:label:php_log'); ?> :</b></td> + <td><?php echo $php_log; ?></td> + </tr> + <tr class="even"> + <td><b><?php echo elgg_echo('admin:server:label:mem_avail'); ?> :</b></td> + <td><?php echo number_format(elgg_get_ini_setting_in_bytes('memory_limit')); ?></td> + </tr> + <tr class="odd"> + <td><b><?php echo elgg_echo('admin:server:label:mem_used'); ?> :</b></td> + <td><?php echo number_format(memory_get_peak_usage()); ?></td> + </tr> + <tr class="even"> + <td><b><?php echo elgg_echo('admin:server:label:post_max_size'); ?> :</b></td> + <td><?php echo number_format($post_max_size); ?></td> + </tr> + <tr class="odd"> + <td><b><?php echo elgg_echo('admin:server:label:upload_max_filesize'); ?> :</b></td> + <td><?php echo number_format($upload_max_filesize) . ' ' . $post_max_size_warning; ?></td> + </tr> +</table> diff --git a/views/default/admin/statistics/server/web_server.php b/views/default/admin/statistics/server/web_server.php new file mode 100644 index 000000000..904a54f4b --- /dev/null +++ b/views/default/admin/statistics/server/web_server.php @@ -0,0 +1,16 @@ +<?php +/** + * Web server info + */ + +?> +<table class="elgg-table-alt"> + <tr class="odd"> + <td><b><?php echo elgg_echo('admin:server:label:server'); ?> :</b></td> + <td><?php echo $_SERVER['SERVER_SOFTWARE']; ?></td> + </tr> + <tr class="even"> + <td><b><?php echo elgg_echo('admin:server:label:log_location'); ?> :</b></td> + <td><?php echo getenv('APACHE_LOG_DIR'); ?></td> + </tr> +</table> diff --git a/views/default/admin/users/add.php b/views/default/admin/users/add.php index 83cad6106..6d22b9c29 100644 --- a/views/default/admin/users/add.php +++ b/views/default/admin/users/add.php @@ -3,4 +3,7 @@ * Display an add user form. */ -echo elgg_view('forms/useradd', array('show_admin'=>true));
\ No newline at end of file +$title = elgg_echo('adduser'); +$body = elgg_view_form('useradd', array(), array('show_admin' => true)); + +echo elgg_view_module('inline', $title, $body);
\ No newline at end of file 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/admin/users/newest.php b/views/default/admin/users/newest.php index 25bd55cbc..91a6fa338 100644 --- a/views/default/admin/users/newest.php +++ b/views/default/admin/users/newest.php @@ -8,7 +8,7 @@ $users = elgg_list_entities(array( ?> -<div class="elgg-module elgg-inline-module"> +<div class="elgg-module elgg-module-inline"> <div class="elgg-head"> <h3><?php echo elgg_echo('admin:users:newest'); ?></h3> </div> diff --git a/views/default/admin/users/online.php b/views/default/admin/users/online.php index 328132a4c..dbda06066 100644 --- a/views/default/admin/users/online.php +++ b/views/default/admin/users/online.php @@ -3,7 +3,7 @@ $users_online = get_online_users(); ?> -<div class="elgg-module elgg-inline-module"> +<div class="elgg-module elgg-module-inline"> <div class="elgg-head"> <h3><?php echo elgg_echo('admin:statistics:label:onlineusers'); ?></h3> </div> |
