aboutsummaryrefslogtreecommitdiff
path: root/views/default/admin/appearance
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/admin/appearance')
-rw-r--r--views/default/admin/appearance/default_widgets.php82
-rw-r--r--views/default/admin/appearance/menu_items.php10
-rw-r--r--views/default/admin/appearance/profile_fields.php24
-rw-r--r--views/default/admin/appearance/profile_fields/list.php55
4 files changed, 171 insertions, 0 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