diff options
Diffstat (limited to 'views/default/admin')
37 files changed, 674 insertions, 439 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 new file mode 100644 index 000000000..1d5c95cf9 --- /dev/null +++ b/views/default/admin/appearance/menu_items.php @@ -0,0 +1,10 @@ +<?php +/** + * Elgg administration menu items + * + * @package Elgg + * @subpackage Core + */ + + +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 new file mode 100644 index 000000000..f1d78c19f --- /dev/null +++ b/views/default/admin/appearance/profile_fields.php @@ -0,0 +1,24 @@ +<?php +/** + * Admin area: edit default profile fields + */ + +$add = elgg_view_form('profile/fields/add', array('class' => 'elgg-form-settings'), array()); +$list = elgg_view('admin/appearance/profile_fields/list'); + +$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="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 new file mode 100644 index 000000000..b9440a95d --- /dev/null +++ b/views/default/admin/appearance/profile_fields/list.php @@ -0,0 +1,55 @@ +<?php +/** + * Profile fields. + * + * @todo Needs some review + */ + +// List form elements +$n = 0; +$loaded_defaults = array(); +$items = array(); +$fieldlist = elgg_get_config('profile_custom_fields'); +if ($fieldlist) { + $fieldlistarray = explode(',', $fieldlist); + foreach ($fieldlistarray as $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_echo("profile:field:$type"); + $items[] = $item; + } + } +} +?> +<ul id="elgg-profile-fields" class="mvm"> +<?php + +$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>
\ No newline at end of file diff --git a/views/default/admin/dashboard.php b/views/default/admin/dashboard.php new file mode 100644 index 000000000..d3976ca38 --- /dev/null +++ b/views/default/admin/dashboard.php @@ -0,0 +1,12 @@ +<?php + +elgg_set_page_owner_guid(elgg_get_logged_in_user_guid()); + +$params = array( + 'num_columns' => 2, + 'exact_match' => true, + 'show_access' => false, +); +$widgets = elgg_view_layout('widgets', $params); + +echo $widgets;
\ No newline at end of file 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/main.php b/views/default/admin/main.php deleted file mode 100644 index df1b32cde..000000000 --- a/views/default/admin/main.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php
-
- /**
- * Elgg administration main screen
- *
- * @package Elgg
- * @subpackage Core
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd
- * @copyright Curverider Ltd 2008-2009
- * @link http://elgg.org/
- */
-
- // Description of what's going on
- echo "<p>" . autop(elgg_echo("admin:description")) . "</p>";
-
-
-
-?>
\ No newline at end of file diff --git a/views/default/admin/main_opt/plugins.php b/views/default/admin/main_opt/plugins.php deleted file mode 100644 index 80472c771..000000000 --- a/views/default/admin/main_opt/plugins.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - /** - * Elgg plugin sub-component on the main menu. - * - * @package Elgg - * @subpackage Core - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd - * @copyright Curverider Ltd 2008-2009 - * @link http://elgg.org/ - */ - - global $CONFIG; -?> -<div class="admin-menu-option"> - <h2><?php echo elgg_echo('admin:plugins'); ?> </h2> - <p><?php echo elgg_echo('admin:plugins:opt:description'); ?><br /> - <a href="<?php echo $CONFIG->wwwroot . "pg/admin/plugins/"; ?>"><?php echo elgg_echo('admin:plugins:opt:linktext'); ?></a></p> -</div>
\ No newline at end of file diff --git a/views/default/admin/main_opt/site.php b/views/default/admin/main_opt/site.php deleted file mode 100644 index 00f37c2c8..000000000 --- a/views/default/admin/main_opt/site.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - /** - * Elgg site sub-component on the main menu. - * - * @package Elgg - * @subpackage Core - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd - * @copyright Curverider Ltd 2008-2009 - * @link http://elgg.org/ - */ -?> -<div class="admin-menu-option"> - <h2><?php echo elgg_echo('admin:site'); ?> </h2> - <p><?php echo elgg_echo('admin:site:opt:description'); ?><br /> - <a href="<?php echo $CONFIG->wwwroot . "pg/admin/site/"; ?>"><?php echo elgg_echo('admin:site:opt:linktext'); ?></a></p> -</div>
\ No newline at end of file diff --git a/views/default/admin/main_opt/statistics.php b/views/default/admin/main_opt/statistics.php deleted file mode 100644 index 4c16153ef..000000000 --- a/views/default/admin/main_opt/statistics.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - /** - * Elgg satistics sub-component on the main menu. - * - * @package Elgg - * @subpackage Core - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd - * @copyright Curverider Ltd 2008-2009 - * @link http://elgg.org/ - */ -?> -<div class="admin-menu-option"> - <h2><?php echo elgg_echo('admin:statistics'); ?> </h2> - <p><?php echo elgg_echo('admin:statistics:opt:description'); ?><br /> - <a href="<?php echo $CONFIG->wwwroot . "pg/admin/statistics/"; ?>"><?php echo elgg_echo('admin:statistics:opt:linktext'); ?></a></p> -</div> diff --git a/views/default/admin/main_opt/user.php b/views/default/admin/main_opt/user.php deleted file mode 100644 index 8e87bae66..000000000 --- a/views/default/admin/main_opt/user.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php - /** - * Elgg user sub-component on the main menu. - * - * @package Elgg - * @subpackage Core - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd - * @copyright Curverider Ltd 2008-2009 - * @link http://elgg.org/ - */ -?> -<div class="admin-menu-option"> - <h2><?php echo elgg_echo('admin:user'); ?> </h2> - <p><?php echo elgg_echo('admin:user:opt:description'); ?><br /> - <a href="<?php echo $CONFIG->wwwroot . "pg/admin/user/"; ?>"><?php echo elgg_echo('admin:user:opt:linktext'); ?></a></p> -</div>
\ 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 index fc044f128..42f153d0f 100644 --- a/views/default/admin/plugins.php +++ b/views/default/admin/plugins.php @@ -1,51 +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 administration plugin main screen - * - * @package Elgg - * @subpackage Core - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd - * @copyright Curverider Ltd 2008-2009 - * @link http://elgg.org/ - */ - - // Description of what's going on - echo "<p>" . autop(elgg_echo("admin:plugins:description")) . "</p>"; - - $limit = get_input('limit', 10); - $offset = get_input('offset', 0); - - - // Get the installed plugins - $installed_plugins = $vars['installed_plugins']; - $count = count($installed_plugins); -
- $plugin_list = get_plugin_list();
- $max = 0;
- foreach($plugin_list as $key => $foo)
- if ($key > $max) $max = $key;
- - // Display list of plugins - $n = 0; - foreach ($installed_plugins as $plugin => $data) - { - //if (($n>=$offset) && ($n < $offset+$limit)) - echo elgg_view("admin/plugins_opt/plugin", array('plugin' => $plugin, 'details' => $data, 'maxorder' => $max, 'order' => array_search($plugin, $plugin_list))); - - $n++; +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); + } } - - // Diplay nav
- /* - if ($count) - { - echo elgg_view('navigation/pagination',array( - 'baseurl' => $_SERVER['REQUEST_URI'], - 'offset' => $offset, - 'count' => $count, - )); - }
- */ -?>
\ No newline at end of file + } +} + +$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_opt/plugin.php b/views/default/admin/plugins_opt/plugin.php deleted file mode 100644 index 5cb1797c4..000000000 --- a/views/default/admin/plugins_opt/plugin.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php - /** - * Elgg plugin manifest class - * - * This file renders a plugin for the admin screen, including active/deactive, manifest details & display plugin - * settings. - * - * @package Elgg - * @subpackage Core - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd - * @copyright Curverider Ltd 2008-2009 - * @link http://elgg.org/ - */ - - - $plugin = $vars['plugin']; - $details = $vars['details']; - - $active = $details['active']; - $manifest = $details['manifest']; - - $ts = time(); - $token = generate_action_token($ts); -?> -<div class="plugin_details <?php if ($active) echo "active"; else echo "not-active" ?>"> - <div class="admin_plugin_reorder"> - <?php - if ($vars['order'] > 10) { -?> - <a href="<?php echo $vars['url']; ?>actions/admin/plugins/reorder?plugin=<?php echo $plugin; ?>&order=1&__elgg_token=<?php echo $token; ?>&__elgg_ts=<?php echo $ts; ?>"><?php echo elgg_echo("top"); ?></a> - <a href="<?php echo $vars['url']; ?>actions/admin/plugins/reorder?plugin=<?php echo $plugin; ?>&order=<?php echo $vars['order'] - 11; ?>&__elgg_token=<?php echo $token; ?>&__elgg_ts=<?php echo $ts; ?>"><?php echo elgg_echo("up"); ?></a> -<?php - } - ?> - <?php - if ($vars['order'] < $vars['maxorder']) { -?> - <a href="<?php echo $vars['url']; ?>actions/admin/plugins/reorder?plugin=<?php echo $plugin; ?>&order=<?php echo $vars['order'] + 11; ?>&__elgg_token=<?php echo $token; ?>&__elgg_ts=<?php echo $ts; ?>"><?php echo elgg_echo("down"); ?></a> - <a href="<?php echo $vars['url']; ?>actions/admin/plugins/reorder?plugin=<?php echo $plugin; ?>&order=<?php echo $vars['maxorder'] + 11; ?>&__elgg_token=<?php echo $token; ?>&__elgg_ts=<?php echo $ts; ?>"><?php echo elgg_echo("bottom"); ?></a> -<?php - } - ?> - </div><div class="clearfloat"></div> - <div class="admin_plugin_enable_disable"> - <?php if ($active) { ?> - <a href="<?php echo $vars['url']; ?>actions/admin/plugins/disable?plugin=<?php echo $plugin; ?>&__elgg_token=<?php echo $token; ?>&__elgg_ts=<?php echo $ts; ?>"><?php echo elgg_echo("disable"); ?></a> - <?php } else { ?> - <a href="<?php echo $vars['url']; ?>actions/admin/plugins/enable?plugin=<?php echo $plugin; ?>&__elgg_token=<?php echo $token; ?>&__elgg_ts=<?php echo $ts; ?>"><?php echo elgg_echo("enable"); ?></a> - <?php } ?> - </div> - - <h3><?php echo $plugin; ?></h3> - <p><a class="manifest_details"><?php echo elgg_echo("admin:plugins:label:moreinfo"); ?></a></p> - - <div class="manifest_file"> - - <?php if ($manifest) { ?> - <div><?php echo $manifest['description'] ?></div> - <div><?php echo elgg_echo('admin:plugins:label:author') . ": ". $manifest['author'] ?></div> - <div><?php echo elgg_echo('admin:plugins:label:copyright') . ": ". $manifest['copyright'] ?></div> - <div><?php echo elgg_echo('admin:plugins:label:licence') . ": ". $manifest['licence'] . $manifest['license'] ?></div> - <div><?php echo elgg_echo('admin:plugins:label:website') . ": "; ?><a href="<?php echo $manifest['website']; ?>"><?php echo $manifest['website']; ?></a></div> - <?php } ?> - - <?php if (elgg_view("settings/{$plugin}/edit")) { ?> - <div class="pluginsettings"> - <h3><?php echo elgg_echo("settings"); ?></h3> - <div id="<?php echo $plugin; ?>_settings"> - <?php echo elgg_view("object/plugin", array('plugin' => $plugin, 'entity' => find_plugin_settings($plugin))) ?> - </div> - </div> - <?php } ?> - - </div> - -</div>
\ 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.php b/views/default/admin/site.php deleted file mode 100644 index 080a35b9d..000000000 --- a/views/default/admin/site.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - - /** - * Elgg administration site main screen - * - * @package Elgg - * @subpackage Core - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd - * @copyright Curverider Ltd 2008-2009 - * @link http://elgg.org/ - */ - - global $CONFIG; - - // Description of what's going on - echo "<p>" . autop(elgg_echo("admin:site:description")) . "</p>"; - - echo elgg_view("settings/system",array("action" => $CONFIG->wwwroot."action/admin/site/update_basic")); // Always want to do this first. -?>
\ No newline at end of file diff --git a/views/default/admin/statistics.php b/views/default/admin/statistics.php deleted file mode 100644 index 75ece8eb1..000000000 --- a/views/default/admin/statistics.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php
- /**
- * Elgg statistics screen
- *
- * @package Elgg
- * @subpackage Core
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd
- * @copyright Curverider Ltd 2008-2009
- * @link http://elgg.org/
- */
-
- global $CONFIG;
-
- // echo "<p>" . autop(elgg_echo("admin:statistics:description")) . "</p>";
-
-?>
-
- <!-- <p>
- <?php echo elgg_echo('admin:statistics:description'); ?>
- <a href="http://elgg.com/"><?php echo elgg_echo('learnmore'); ?></a>
- </p> -->
\ No newline at end of file diff --git a/views/default/admin/statistics/overview.php b/views/default/admin/statistics/overview.php new file mode 100644 index 000000000..ac5aaac36 --- /dev/null +++ b/views/default/admin/statistics/overview.php @@ -0,0 +1,13 @@ +<?php +/** + * Elgg statistics screen + * + * @package Elgg + * @subpackage Core + */ + +echo elgg_view('admin/statistics/extend'); + +echo elgg_view_module('inline', elgg_echo('admin:statistics:label:basic'), elgg_view('admin/statistics/overview/basic')); + +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/statistics_opt/basic.php b/views/default/admin/statistics_opt/basic.php deleted file mode 100644 index 59545081e..000000000 --- a/views/default/admin/statistics_opt/basic.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - /** - * Elgg statistics screen - * - * @package Elgg - * @subpackage Core - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd - * @copyright Curverider Ltd 2008-2009 - * @link http://elgg.org/ - */ - - // Work out number of users - $users_stats = get_number_users(); - $total_users = get_number_users(true); - - - global $CONFIG; - - // Get version information - $version = get_version(); - $release = get_version(true); - -?> -<div class="admin_statistics"> - <h3><?php echo elgg_echo('admin:statistics:label:basic'); ?></h3> - <table> - <tr class="odd"> - <td class="column_one"><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 class="column_one"><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>
\ No newline at end of file diff --git a/views/default/admin/statistics_opt/numentities.php b/views/default/admin/statistics_opt/numentities.php deleted file mode 100644 index f7e96fb94..000000000 --- a/views/default/admin/statistics_opt/numentities.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php
- /**
- * Elgg statistics screen
- *
- * @package Elgg
- * @subpackage Core
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd
- * @copyright Curverider Ltd 2008-2009
- * @link http://elgg.org/
- */
-
-
- // Get entity statistics
- $entity_stats = get_entity_statistics(); - $even_odd = "";
-?>
-<div class="admin_statistics">
- <h3><?php echo elgg_echo('admin:statistics:label:numentities'); ?></h3>
- <table>
- <?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 class="column_one">{$a}:</td>
- <td>{$b}</td>
- </tr>
-END;
- }
- }
- ?>
- </table>
-</div>
\ No newline at end of file diff --git a/views/default/admin/statistics_opt/online.php b/views/default/admin/statistics_opt/online.php deleted file mode 100644 index 9add25d02..000000000 --- a/views/default/admin/statistics_opt/online.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php
- /**
- * Elgg statistics screen
- *
- * @package Elgg
- * @subpackage Core
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd
- * @copyright Curverider Ltd 2008-2009
- * @link http://elgg.org/
- */
-
- // users online
- get_context('search');
- $users_online = get_online_users();
- get_context('admin');
-?>
-
-<div class="admin_users_online">
- <h3><?php echo elgg_echo('admin:statistics:label:onlineusers'); ?></h3>
- <?php echo $users_online; ?>
-</div>
diff --git a/views/default/admin/user.php b/views/default/admin/user.php deleted file mode 100644 index 75bc74b82..000000000 --- a/views/default/admin/user.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - - /** - * Elgg administration user main screen - * - * @package Elgg - * @subpackage Core - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd - * @copyright Curverider Ltd 2008-2009 - * @link http://elgg.org/ - */ - - // Description of what's going on - echo "<p>" . autop(elgg_echo("admin:user:description")) . "</p>"; - - echo elgg_view("admin/user_opt/adduser"); - - echo elgg_view("admin/user_opt/search"); - - if ($vars['list']) echo $vars['list']; - -?>
\ No newline at end of file diff --git a/views/default/admin/user_opt/adduser.php b/views/default/admin/user_opt/adduser.php deleted file mode 100644 index 0c274bcd4..000000000 --- a/views/default/admin/user_opt/adduser.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - /** - * Add a user. - * Form to add a new user. - * - * @package Elgg - * @subpackage Core - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd - * @copyright Curverider Ltd 2008-2009 - * @link http://elgg.org/ - */ -?> - -<div class="admin_adduser_link"> - <a href="#" onclick="$('#add_user_showhide').toggle()"><?php echo elgg_echo('admin:user:adduser:label'); ?></a> -</div> -<div id="add_user_showhide" style="display:none" > -<?php echo elgg_view('account/forms/useradd', array('show_admin'=>true)); ?> -</div>
\ No newline at end of file diff --git a/views/default/admin/user_opt/search.php b/views/default/admin/user_opt/search.php deleted file mode 100644 index b201c0384..000000000 --- a/views/default/admin/user_opt/search.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - /** - * Elgg user search box. - * - * @package Elgg - * @subpackage Core - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd - * @copyright Curverider Ltd 2008-2009 - * @link http://elgg.org/ - */ -?> -<div id="search-box"> - <form action="<?php echo $vars['url']; ?>search/" method="get"> - <b><?php echo elgg_echo('admin:user:label:search'); ?></b> - <?php
-
- echo elgg_view('input/text',array('internalname' => 'tag'));
-
- ?>
- <input type="hidden" name="object" value="user" /> - <input type="submit" name="<?php echo elgg_echo('admin:user:label:seachbutton'); ?>" - value="<?php echo elgg_echo('admin:user:label:seachbutton'); ?>" /> - </form> -</div> diff --git a/views/default/admin/users/add.php b/views/default/admin/users/add.php new file mode 100644 index 000000000..6d22b9c29 --- /dev/null +++ b/views/default/admin/users/add.php @@ -0,0 +1,9 @@ +<?php +/** + * Display an add user form. + */ + +$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 new file mode 100644 index 000000000..91a6fa338 --- /dev/null +++ b/views/default/admin/users/newest.php @@ -0,0 +1,18 @@ +<?php +// newest users +$users = elgg_list_entities(array( + 'type' => 'user', + 'subtype'=> null, + 'full_view' => FALSE +)); + +?> + +<div class="elgg-module elgg-module-inline"> + <div class="elgg-head"> + <h3><?php echo elgg_echo('admin:users:newest'); ?></h3> + </div> + <div class="elgg-body"> + <?php echo $users; ?> + </div> +</div> diff --git a/views/default/admin/users/online.php b/views/default/admin/users/online.php new file mode 100644 index 000000000..dbda06066 --- /dev/null +++ b/views/default/admin/users/online.php @@ -0,0 +1,13 @@ +<?php + +$users_online = get_online_users(); + +?> +<div class="elgg-module elgg-module-inline"> + <div class="elgg-head"> + <h3><?php echo elgg_echo('admin:statistics:label:onlineusers'); ?></h3> + </div> + <div class="elgg-body"> + <?php echo $users_online; ?> + </div> +</div> |
