diff options
Diffstat (limited to 'views/default/forms/admin/plugins')
| -rw-r--r-- | views/default/forms/admin/plugins/change_state.php | 22 | ||||
| -rw-r--r-- | views/default/forms/admin/plugins/filter.php | 26 | ||||
| -rw-r--r-- | views/default/forms/admin/plugins/simple_update_states.php | 101 | ||||
| -rw-r--r-- | views/default/forms/admin/plugins/sort.php | 26 |
4 files changed, 74 insertions, 101 deletions
diff --git a/views/default/forms/admin/plugins/change_state.php b/views/default/forms/admin/plugins/change_state.php new file mode 100644 index 000000000..730c8ff32 --- /dev/null +++ b/views/default/forms/admin/plugins/change_state.php @@ -0,0 +1,22 @@ +<?php +/** + * Activate/deactive all plugins specified by guids array + * + * @uses $vars['guids'] Array of GUIDs + * @uses $vars['action'] 'activate' or 'deactivate' + */ + +$guids = elgg_extract('guids', $vars, array()); +$guids = implode(',', $guids); + +echo '<div>'; +echo elgg_view('input/hidden', array( + 'name' => 'guids', + 'value' => $guids, +)); + +echo elgg_view('input/submit', array( + 'value' => elgg_echo("admin:plugins:{$vars['action']}_all"), + 'class' => 'elgg-button elgg-button-action mrm' +)); +echo '</div>'; diff --git a/views/default/forms/admin/plugins/filter.php b/views/default/forms/admin/plugins/filter.php new file mode 100644 index 000000000..fd1b618bc --- /dev/null +++ b/views/default/forms/admin/plugins/filter.php @@ -0,0 +1,26 @@ +<?php +/** + * Category filter for plugins + * + * @uses $vars['category'] + * @uses $vars['category_options'] + * @uses $vvars['sort'] + */ + +echo '<div>'; +echo elgg_view('input/dropdown', array( + 'name' => 'category', + 'options_values' => $vars['category_options'], + 'value' => $vars['category'], +)); + +echo elgg_view('input/hidden', array( + 'name' => 'sort', + 'value' => $vars['sort'], +)); + +echo elgg_view('input/submit', array( + 'value' => elgg_echo('filter'), + 'class' => 'elgg-button elgg-button-action', +)); +echo '</div>'; diff --git a/views/default/forms/admin/plugins/simple_update_states.php b/views/default/forms/admin/plugins/simple_update_states.php deleted file mode 100644 index bf9f4e4c1..000000000 --- a/views/default/forms/admin/plugins/simple_update_states.php +++ /dev/null @@ -1,101 +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); - -echo <<<___END - <ul> -___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 = 'elgg-state-active'; - $checked = 'checked="checked"'; - } else { - $active_class = 'elgg-state-inactive'; - $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)); - - $plugin_footer = '<ul class="elgg-menu elgg-menu-footer">'; - - if ($author) { - $plugin_footer .= '<li>' . elgg_echo('admin:plugins:author', array($author)) . '</li>'; - } - - if ($version) { - $plugin_footer .= '<li>' . elgg_echo('admin:plugins:version', array($version)) . '</li>'; - } - - if ($website) { - $plugin_footer .= "<li><a href=\"$website\">" . elgg_echo('admin:plugins:plugin_website') . '</a></li>'; - } - - if (elgg_view_exists("settings/$plugin_id/edit")) { - $settings_href = elgg_get_site_url() . "pg/admin/plugin_settings/$plugin_id"; - $plugin_footer .= "<li><a class='plugin_settings link' href='$settings_href'>" . elgg_echo('settings') . "</a></li>"; - } - - $plugin_footer .= "</ul>"; - - echo <<<___END - <li class="elgg-plugin $active_class"> - <div class="elgg-grid"> - <div class="elgg-col elgg-col-1of5"> - <input type="checkbox" id="$plugin_guid" $checked $disabled name="active_plugin_guids[]" value="$plugin_guid"/> - <label for="$plugin_guid">$name</label> - </div> - <div class="elgg-col elgg-col-4of5"> - $description - $plugin_footer - </div> - </div> - </li> -___END; -} - -echo '</ul>'; -echo elgg_view('input/submit', array('value' => elgg_echo('save'))); -echo elgg_view('input/reset', array('value' => elgg_echo('reset'))); diff --git a/views/default/forms/admin/plugins/sort.php b/views/default/forms/admin/plugins/sort.php new file mode 100644 index 000000000..7f2246bad --- /dev/null +++ b/views/default/forms/admin/plugins/sort.php @@ -0,0 +1,26 @@ +<?php +/** + * Sort plugins form body + * + * @uses $vars['sort'] + * @uses $vars['sort_options'] + * @uses $vars['category'] + */ + +echo '<div class="mtm">'; +echo elgg_view('input/dropdown', array( + 'name' => 'sort', + 'options_values' => $vars['sort_options'], + 'value' => $vars['sort'], +)); + +echo elgg_view('input/hidden', array( + 'name' => 'category', + 'value' => $vars['category'], +)); + +echo elgg_view('input/submit', array( + 'value' => elgg_echo('sort'), + 'class' => 'elgg-button elgg-button-action' +)); +echo '</div>'; |
