diff options
author | Cash Costello <cash.costello@gmail.com> | 2009-05-22 01:26:47 +0000 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2009-05-22 01:26:47 +0000 |
commit | c607a2424cec501051b27ce5c1606df5b602231f (patch) | |
tree | 913146846ec14b4857ec0f4b058644ce2823f557 | |
parent | 239610b7ca432c90f9082e6359b29cefa8eed9f2 (diff) | |
download | elgg-c607a2424cec501051b27ce5c1606df5b602231f.tar.gz elgg-c607a2424cec501051b27ce5c1606df5b602231f.tar.bz2 |
Began coding admin settings page
-rw-r--r-- | admin.php | 22 | ||||
-rw-r--r-- | languages/en.php | 1 | ||||
-rw-r--r-- | start.php | 12 | ||||
-rw-r--r-- | views/default/admin/tidypics.php | 13 | ||||
-rw-r--r-- | views/default/tidypics/forms/admin.php | 42 |
5 files changed, 90 insertions, 0 deletions
diff --git a/admin.php b/admin.php new file mode 100644 index 000000000..f44250d71 --- /dev/null +++ b/admin.php @@ -0,0 +1,22 @@ +<?php
+ /******************************************************************
+ *
+ * Tidypics Admin Settings
+ *
+ *******************************************************************/
+
+ include_once dirname(dirname(dirname(__FILE__))) . "/engine/start.php";
+
+ global $CONFIG;
+
+ admin_gatekeeper();
+ set_context('admin');
+ set_page_owner($_SESSION['guid']);
+
+ $body = elgg_view_title(elgg_echo('tidypics:adminsettings'));
+
+ $body .= elgg_view("admin/tidypics");
+
+ page_draw(elgg_echo('tidypics:adminsettings'),elgg_view_layout("two_column_left_sidebar", '', $body));
+
+?>
\ No newline at end of file diff --git a/languages/en.php b/languages/en.php index 094b5aa4c..9edbc6be5 100644 --- a/languages/en.php +++ b/languages/en.php @@ -19,6 +19,7 @@ 'album:group' => "Group albums",
'item:object:image' => "Photos",
'item:object:album' => "Albums",
+ 'tidypics:adminsettings' => 'Tidypics Settings',
'tidypics:settings:download_link' => "Show download link:",
'tidypics:settings:maxfilesize' => "Maximum file size in megabytes (MB):",
'tidypics:settings:watermark' => "Enter text to appear in the watermark - ImageMagick must be selected for the image library",
@@ -162,6 +162,17 @@ }
/**
+ * Sets up tidypics admin menu. Triggered on pagesetup.
+ */
+ function tidypics_adminmenu()
+ {
+ global $CONFIG;
+ if (get_context() == 'admin' && isadminloggedin()) {
+ add_submenu_item(elgg_echo('tidypics:adminsettings'), $CONFIG->url . "mod/tidypics/admin.php");
+ }
+ }
+
+ /**
* tidypics page handler
*
* @param array $page Array of page elements, forwarded by the page handling mechanism
@@ -338,6 +349,7 @@ // Make sure tidypics_init is called on initialisation
register_elgg_event_handler('init','system','tidypics_init');
register_elgg_event_handler('pagesetup','system','tidypics_submenus');
+ register_elgg_event_handler('pagesetup','system','tidypics_adminmenu');
// Register actions
register_action("tidypics/upload", false, $CONFIG->pluginspath . "tidypics/actions/upload.php");
diff --git a/views/default/admin/tidypics.php b/views/default/admin/tidypics.php new file mode 100644 index 000000000..561f3965a --- /dev/null +++ b/views/default/admin/tidypics.php @@ -0,0 +1,13 @@ +<?php + + global $CONFIG; + + + echo '<div class="contentWrapper">'; + + echo elgg_view('output/longtext', array('value' => elgg_echo("tidypics:admin:instructions"))); + + echo elgg_view("tidypics/forms/admin"); + + echo "</div>"; +?>
\ No newline at end of file diff --git a/views/default/tidypics/forms/admin.php b/views/default/tidypics/forms/admin.php new file mode 100644 index 000000000..32e08b561 --- /dev/null +++ b/views/default/tidypics/forms/admin.php @@ -0,0 +1,42 @@ +<?php
+ /**
+ * Tidypics admin settings form
+ */
+
+ // to do
+ // 1. set action and code it
+ // 2. figure out how to load all values since they won't be available in $vars[] by default
+
+
+ $action = $vars['url'];// . "action/";
+
+ $image_lib = $vars['entity']->image_lib;
+ if (!$image_lib) $image_lib = 'GD';
+
+ $form_body = 'Not functional!!!!!!! <p>' . elgg_echo('tidypics:image_lib');
+
+ $form_body .= elgg_view('input/pulldown', array(
+ 'internalname' => 'params[image_lib]',
+ 'options_values' => array(
+ 'GD' => 'GD',
+ 'ImageMagick' => 'ImageMagick',
+ 'ImageMagick Cmdline' => 'ImageMagick Cmdline',
+ ),
+ 'value' => $image_lib
+ ));
+
+ $form_body .= '</p>';
+
+
+ $form_body .= "<p>" . elgg_view("input/checkboxes", array('options' => array('Enable Tagging' => true), 'internalname' => 'tagging', 'value' => ($vars['config']->tagging ? true : false) )) . "</p>";
+
+ $form_body .= "<p>" . elgg_view("input/checkboxes", array('options' => array('Enable Download Link' => true), 'internalname' => 'download', 'value' => ($vars['config']->download ? true : false) )) . "</p>";
+
+
+ $form_body .= "<p>" . elgg_echo('watermark') . "<br />";
+ $form_body .= elgg_view("input/text",array('internalname' => 'watermark', 'value' => $watermark)) . "</p>";
+
+
+ $form_body .= elgg_view('input/submit', array('value' => elgg_echo("save")));
+
+ echo elgg_view('input/form', array('action' => $action, 'body' => $form_body));
\ No newline at end of file |