diff --git a/e107_core/url/news/sef_full_url.php b/e107_core/url/news/sef_full_url.php
index 00df439f5..42c637bcf 100644
--- a/e107_core/url/news/sef_full_url.php
+++ b/e107_core/url/news/sef_full_url.php
@@ -6,6 +6,9 @@
*
* Full SEF URLs support and the most risky one, almost the same as sef_noid, just working with rules only
*/
+
+if (!defined('e107_INIT')){ exit; }
+
class core_news_sef_full_url extends eUrlConfig
{
public function config()
diff --git a/e107_core/url/news/sef_noid_url.php b/e107_core/url/news/sef_noid_url.php
index 274634623..82a6a5765 100644
--- a/e107_core/url/news/sef_noid_url.php
+++ b/e107_core/url/news/sef_noid_url.php
@@ -6,6 +6,8 @@
*
* SEF URLs support, example of manually (rules-less) created/parsed urls
*/
+if (!defined('e107_INIT')){ exit; }
+
class core_news_sef_noid_url extends eUrlConfig
{
public function config()
diff --git a/e107_core/url/news/sef_url.php b/e107_core/url/news/sef_url.php
index 7f30f7b82..ef968f6d8 100644
--- a/e107_core/url/news/sef_url.php
+++ b/e107_core/url/news/sef_url.php
@@ -9,6 +9,8 @@
* Generally, things are much more simpler...
*
*/
+if (!defined('e107_INIT')){ exit; }
+
class core_news_sef_url extends eUrlConfig
{
public function config()
diff --git a/e107_core/url/news/url.php b/e107_core/url/news/url.php
index 0563a3064..4eb210775 100644
--- a/e107_core/url/news/url.php
+++ b/e107_core/url/news/url.php
@@ -8,6 +8,8 @@
* All possible config options added here - to be used as a reference.
* A good programming practice is to remove all non-used options.
*/
+if (!defined('e107_INIT')){ exit; }
+
class core_news_url extends eUrlConfig
{
public function config()
diff --git a/e107_core/url/page/sef_noid_url.php b/e107_core/url/page/sef_noid_url.php
index 93c049964..fc92c1d30 100644
--- a/e107_core/url/page/sef_noid_url.php
+++ b/e107_core/url/page/sef_noid_url.php
@@ -5,6 +5,8 @@
*
* Custom page routing config
*/
+if (!defined('e107_INIT')){ exit; }
+
class core_page_sef_noid_url extends eUrlConfig
{
public function config()
diff --git a/e107_core/url/page/sef_url.php b/e107_core/url/page/sef_url.php
index 576cf90c6..1f06d46be 100644
--- a/e107_core/url/page/sef_url.php
+++ b/e107_core/url/page/sef_url.php
@@ -5,6 +5,8 @@
*
* Custom page routing config
*/
+if (!defined('e107_INIT')){ exit; }
+
class core_page_sef_url extends eUrlConfig
{
public function config()
diff --git a/e107_core/url/page/url.php b/e107_core/url/page/url.php
index c9ee89867..57423accc 100644
--- a/e107_core/url/page/url.php
+++ b/e107_core/url/page/url.php
@@ -5,6 +5,8 @@
*
* Custom page routing config
*/
+if (!defined('e107_INIT')){ exit; }
+
class core_page_url extends eUrlConfig
{
public function config()
diff --git a/e107_core/url/search/rewrite_url.php b/e107_core/url/search/rewrite_url.php
index fbda39063..8afd9fdf9 100644
--- a/e107_core/url/search/rewrite_url.php
+++ b/e107_core/url/search/rewrite_url.php
@@ -5,6 +5,8 @@
*
* Search routing config
*/
+if (!defined('e107_INIT')){ exit; }
+
class core_search_rewrite_url extends eUrlConfig
{
public function config()
diff --git a/e107_core/url/search/url.php b/e107_core/url/search/url.php
index 931b5ce99..151aded93 100644
--- a/e107_core/url/search/url.php
+++ b/e107_core/url/search/url.php
@@ -5,6 +5,8 @@
*
* Search routing config
*/
+if (!defined('e107_INIT')){ exit; }
+
class core_search_url extends eUrlConfig
{
public function config()
diff --git a/e107_core/url/system/rewrite_url.php b/e107_core/url/system/rewrite_url.php
index 0745a24b5..fbce810f5 100644
--- a/e107_core/url/system/rewrite_url.php
+++ b/e107_core/url/system/rewrite_url.php
@@ -5,6 +5,8 @@
*
* System routing config
*/
+if (!defined('e107_INIT')){ exit; }
+
class core_system_rewrite_url extends eUrlConfig
{
public function config()
diff --git a/e107_core/url/system/url.php b/e107_core/url/system/url.php
index cc5b2e550..ee2113d6f 100644
--- a/e107_core/url/system/url.php
+++ b/e107_core/url/system/url.php
@@ -5,6 +5,8 @@
*
* System routing config
*/
+if (!defined('e107_INIT')){ exit; }
+
class core_system_url extends eUrlConfig
{
public function config()
diff --git a/e107_core/url/user/rewrite_url.php b/e107_core/url/user/rewrite_url.php
index 4ae2d5bcf..deef2a3b0 100644
--- a/e107_core/url/user/rewrite_url.php
+++ b/e107_core/url/user/rewrite_url.php
@@ -5,6 +5,8 @@
*
* User routing config
*/
+if (!defined('e107_INIT')){ exit; }
+
class core_user_rewrite_url extends eUrlConfig
{
public function config()
diff --git a/e107_core/url/user/url.php b/e107_core/url/user/url.php
index 6d390a835..4aee53935 100644
--- a/e107_core/url/user/url.php
+++ b/e107_core/url/user/url.php
@@ -5,6 +5,8 @@
*
* User routing config
*/
+if (!defined('e107_INIT')){ exit; }
+
class core_user_url extends eUrlConfig
{
public function config()
diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php
index 5714c7901..4c5c9f3d0 100644
--- a/e107_handlers/admin_ui.php
+++ b/e107_handlers/admin_ui.php
@@ -24,6 +24,9 @@
/**
* @todo core request handler (non-admin), core response
*/
+if (!defined('e107_INIT')){ exit; }
+
+
class e_admin_request
{
/**
diff --git a/e107_plugins/chatbox_menu/chatbox_menu.php b/e107_plugins/chatbox_menu/chatbox_menu.php
index 7ee8d5127..1a233c6db 100644
--- a/e107_plugins/chatbox_menu/chatbox_menu.php
+++ b/e107_plugins/chatbox_menu/chatbox_menu.php
@@ -21,6 +21,7 @@
* @subpackage chatbox
* @version $Id$;
*/
+error_reporting(0);
global $tp, $e107cache, $e_event, $e107, $pref;
if (!plugInstalled('chatbox_menu'))
diff --git a/e107_plugins/download/includes/admin.php b/e107_plugins/download/includes/admin.php
index 2edea2ca5..d9b99a334 100644
--- a/e107_plugins/download/includes/admin.php
+++ b/e107_plugins/download/includes/admin.php
@@ -13,6 +13,8 @@
*/
//require_once(e_HANDLER.'admin_handler.php'); - autoloaded - see class2.php __autoload()
+if (!defined('e107_INIT')){ exit; }
+
class plugin_download_admin extends e_admin_dispatcher
{
/**
diff --git a/e107_plugins/faqs/e_search.php b/e107_plugins/faqs/e_search.php
index ebcc8cfbc..75216ef16 100644
--- a/e107_plugins/faqs/e_search.php
+++ b/e107_plugins/faqs/e_search.php
@@ -1,5 +1,5 @@
e_PLUGIN.'faqs/search.php', 'qtype' => 'FAQ', 'refpage' => 'faqs.php');
?>
\ No newline at end of file
diff --git a/e107_plugins/faqs/search.php b/e107_plugins/faqs/search.php
index 808027a08..d21489e15 100644
--- a/e107_plugins/faqs/search.php
+++ b/e107_plugins/faqs/search.php
@@ -1,6 +1,6 @@
db_Select("faqs", "*", "faq_question REGEXP('".$query."') OR faq_answer REGEXP('".$query."') ORDER BY faq_id DESC ")){
diff --git a/e107_plugins/featurebox/e_header.php b/e107_plugins/featurebox/e_header.php
index 3b91ba156..3f8dd3921 100644
--- a/e107_plugins/featurebox/e_header.php
+++ b/e107_plugins/featurebox/e_header.php
@@ -1,5 +1,5 @@
array('controller' =>'CONTROLLER_CLASS'[, 'index' => 'list', 'path' => 'CONTROLLER SCRIPT PATH', 'ui' => 'UI CLASS NAME child of e_admin_ui', 'uipath' => 'UI SCRIPT PATH']);
+ * Note - default mode/action is autodetected in this order:
+ * - $defaultMode/$defaultAction (owned by dispatcher - see below)
+ * - $adminMenu (first key if admin menu array is not empty)
+ * - $modes (first key == mode, corresponding 'index' key == action)
+ * @var array
+ */
+ protected $modes = array (
+ 'main' => array (
+ 'controller' => 'gallery_cat_admin_ui',
+ 'path' => null,
+ 'ui' => 'gallery_cat_admin_form_ui',
+ 'uipath' => null
+ ),
+ 'cat' => array (
+ 'controller' => 'gallery_cat_ui',
+ 'path' => null,
+ 'ui' => 'gallery_cat_form_ui',
+ 'uipath' => null
+ )
+ );
+
+ /* Both are optional
+ protected $defaultMode = null;
+ protected $defaultAction = null;
+ */
+
+ /**
+ * Format: 'MODE/ACTION' => array('caption' => 'Menu link title'[, 'url' => '{e_PLUGIN}release/admin_config.php', 'perm' => '0']);
+ * Additionally, any valid e_admin_menu() key-value pair could be added to the above array
+ * @var array
+ */
+ protected $adminMenu = array(
+ // 'main/list' => array('caption'=> LAN_CATEGORY, 'perm' => 'P'),
+ // 'main/create' => array('caption'=> LAN_CREATE, 'perm' => 'P'),
+ //'main/gallery' => array('caption'=> 'Info', 'perm' => 'P'),//, 'url'=>'{e_ADMIN}image.php'
+ 'main/prefs' => array('caption'=> LAN_PREFS, 'perm' => 'P')
+ );
+
+
+ /**
+ * Optional, mode/action aliases, related with 'selected' menu CSS class
+ * Format: 'MODE/ACTION' => 'MODE ALIAS/ACTION ALIAS';
+ * This will mark active main/list menu item, when current page is main/edit
+ * @var array
+ */
+ protected $adminMenuAliases = array(
+ /// 'main/edit' => 'main/list',
+ // 'cat/edit' => 'cat/list'
+ );
+
+ /**
+ * Navigation menu title
+ * @var string
+ */
+ protected $menuTitle = 'Gallery';
+
+
+}
+
+
+class gallery_cat_admin_ui extends e_admin_ui
+{
+ protected $pluginTitle = 'Gallery Categories';
+ protected $pluginName = 'gallery';
+ protected $table = "core_media_cat";
+ protected $pid = "media_cat_id";
+ protected $perPage = 10; //no limit
+ protected $listOrder = 'media_cat_order';
+
+ protected $listQry = "SELECT * FROM #core_media_cat WHERE media_cat_owner = 'gallery' "; // without any Order or Limit.
+ // protected $editQry = "SELECT * FROM #faq_info WHERE faq_info_id = {ID}";
+
+ protected $fields = array(
+ 'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'5%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'),
+ // 'media_cat_id' => array('title'=> LAN_ID, 'type' => 'number', 'width' =>'5%', 'forced'=> TRUE, 'readonly'=>TRUE),
+ 'media_cat_image' => array('title'=> LAN_IMAGE, 'type' => 'image', 'data' => 'str', 'width' => '100px', 'thclass' => 'center', 'class'=>'center', 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60','readonly'=>FALSE, 'batch' => FALSE, 'filter'=>FALSE),
+ 'media_cat_owner' => array('title'=> "Owner", 'type' => 'hidden', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE, 'writeParms' =>'value=gallery'),
+ 'media_cat_category' => array('title'=> LAN_CATEGORY, 'type' => 'hidden', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>TRUE),
+ 'media_cat_title' => array('title'=> LAN_TITLE, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE),
+ 'media_cat_diz' => array('title'=> LAN_DESCRIPTION, 'type' => 'bbarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=150&bb=1','readonly'=>FALSE), // Display name
+ 'media_cat_class' => array('title'=> LAN_VISIBILITY, 'type' => 'userclass', 'width' => 'auto', 'data' => 'int', 'filter'=>TRUE, 'batch'=>TRUE),
+ 'media_cat_order' => array('title'=> LAN_ORDER, 'type' => 'text', 'width' => '5%', 'thclass' => 'right', 'class'=> 'right' ),
+ 'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'width' => '10%', 'forced'=>TRUE, 'thclass' => 'center last', 'class' => 'center')
+ );
+
+
+
+ public function beforeCreate($new_data)
+ {
+
+ $replace = array("_"," ","'",'"',"."); //FIXME Improve
+ $new_data['media_cat_category'] = strtolower(str_replace($replace,"",$new_data['media_cat_title']));
+ return $new_data;
+ }
+
+ function galleryPage()
+ {
+ $mes = e107::getMessage();
+ $message = "Gallery is active. Simply import and assign images to the gallery categories using the Media Manager";
+
+ $mes->addInfo($message);
+ }
+
+
+ protected $prefs = array(
+ 'popup_w' => array('title'=> 'Image Max. Width', 'type' => 'text', 'data' => 'int', 'help'=>'Images will be auto-resized if greater than the width given here'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
+ 'popup_h' => array('title'=> 'Image Max. Height', 'type' => 'text', 'data' => 'int', 'help'=>'Images will be auto-resized if greater than the height given here'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
+
+
+ 'slideshow_category' => array('title'=> 'Slideshow category', 'type' => 'dropdown', 'data' => 'str', 'help'=>'Images from this category will be used in the sliding menu.'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
+ // 'slideshow_thumb_w' => array('title'=> 'Thumbnail Width', 'type' => 'number', 'data' => 'integer', 'help'=>'Width in px'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
+ // 'slideshow_thumb_h' => array('title'=> 'Thumbnail Height', 'type' => 'number', 'data' => 'integer', 'help'=>'Height in px'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
+
+ // 'slideshow_perslide' => array('title'=> 'Images per slide', 'type' => 'number', 'data' => 'integer', 'help'=>'Number of images to show per slide.'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
+ 'slideshow_duration' => array('title'=> 'Slide duration', 'type' => 'number', 'data' => 'integer', 'help'=>'The duration (in seconds) of a full jump.'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
+ 'slideshow_auto' => array('title'=> 'Slide auto-start', 'type'=>'boolean', 'data' => 'integer','help' => 'When enabled image-rotation begins automatically when the page is loaded.'),
+ 'slideshow_freq' => array('title'=> 'Slide frequency', 'type' => 'number', 'data' => 'integer', 'help'=>'When auto-start is enabled, this dictates how long a slides stays put before the next jump. '), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
+ // 'slideshow_circular' => array('title'=> 'Slide circular-mode', 'type' => 'boolean', 'data' => 'integer', 'help'=>'By default when the first/last slide is reached, calling prev/next does nothing. If you want the effect to continue enable this option.'), //
+ 'slideshow_effect' => array('title'=> 'Slide effect', 'type' => 'dropdown', 'data' => 'str', 'help'=>'Type of effect. '), //
+ // 'slideshow_transition' => array('title'=> 'Slide transition', 'type' => 'dropdown', 'data' => 'str', 'help'=>'Type of transition. ') //
+ );
+
+
+
+ function init()
+ {
+ $effects = array(
+ 'scrollHorz' => 'slide left',
+ 'scrollVert' => 'slide down',
+ // 'turnDown' => 'turn Down',
+ // 'turnUp' => 'turn Up',
+ // 'curtainX' => 'curtainX',
+ // 'curtainY' => 'curtainY',
+ 'fade' => 'fade',
+ // 'zoom' => 'zoom'
+ );
+
+
+
+ $this->prefs['slideshow_effect']['writeParms'] = $effects;
+ $this->prefs['slideshow_effect']['readParms'] = $effects;
+
+ $transitions = array('sinoidal'=>'sinoidal','spring'=>'spring');
+ $this->prefs['slideshow_transition']['writeParms'] = $transitions;
+ $this->prefs['slideshow_transition']['readParms'] = $transitions;
+
+ $categories = e107::getMedia()->getCategories('gallery');
+ $cats = array();
+ foreach($categories as $k=>$var)
+ {
+ list($tmp,$id) = explode("_",$k);
+ $cats[$id] = $var['media_cat_title'];
+ }
+
+ $this->prefs['slideshow_category']['writeParms'] = $cats;
+ $this->prefs['slideshow_category']['readParms'] = $cats;
+
+ $mes = e107::getMessage();
+ $message = "Gallery is active. Simply import and assign images to the gallery categories using the Media Manager";
+
+ $mes->addInfo($message);
+ }
+
+
+}
+
+class gallery_cat_admin_form_ui extends e_admin_form_ui
+{
+
+ // Override the default Options field.
+
+ public function gallery_category_parent($curVal,$mode)
+ {
+ // TODO - catlist combo without current cat ID in write mode, parents only for batch/filter
+ // Get UI instance
+ $controller = $this->getController();
+ switch($mode)
+ {
+ case 'read':
+ return e107::getParser()->toHTML($controller->getDownloadCategoryTree($curVal), false, 'TITLE');
+ break;
+
+ case 'write':
+ return $this->selectbox('gallery_category_parent', $controller->getDownloadCategoryTree(), $curVal);
+ break;
+
+ case 'filter':
+ case 'batch':
+ return $controller->getDownloadCategoryTree();
+ break;
+ }
+ }
+}
+
+
+
+
+
+
+
+class gallery_main_admin_ui extends e_admin_ui
+{
+
+
+
+}
+
+class gallery_main_admin_form_ui extends e_admin_form_ui
+{
+
+
+
+
+}
+
+
new plugin_gallery_admin();
require_once(e_ADMIN."auth.php");
e107::getAdminUI()->runPage(); //gallery/includes/admin.php is auto-loaded.
diff --git a/e107_plugins/gallery/includes/admin.php b/e107_plugins/gallery/includes/admin.php
deleted file mode 100644
index 5e695b82d..000000000
--- a/e107_plugins/gallery/includes/admin.php
+++ /dev/null
@@ -1,237 +0,0 @@
- array('controller' =>'CONTROLLER_CLASS'[, 'index' => 'list', 'path' => 'CONTROLLER SCRIPT PATH', 'ui' => 'UI CLASS NAME child of e_admin_ui', 'uipath' => 'UI SCRIPT PATH']);
- * Note - default mode/action is autodetected in this order:
- * - $defaultMode/$defaultAction (owned by dispatcher - see below)
- * - $adminMenu (first key if admin menu array is not empty)
- * - $modes (first key == mode, corresponding 'index' key == action)
- * @var array
- */
- protected $modes = array (
- 'main' => array (
- 'controller' => 'gallery_cat_admin_ui',
- 'path' => null,
- 'ui' => 'gallery_cat_admin_form_ui',
- 'uipath' => null
- ),
- 'cat' => array (
- 'controller' => 'gallery_cat_ui',
- 'path' => null,
- 'ui' => 'gallery_cat_form_ui',
- 'uipath' => null
- )
- );
-
- /* Both are optional
- protected $defaultMode = null;
- protected $defaultAction = null;
- */
-
- /**
- * Format: 'MODE/ACTION' => array('caption' => 'Menu link title'[, 'url' => '{e_PLUGIN}release/admin_config.php', 'perm' => '0']);
- * Additionally, any valid e_admin_menu() key-value pair could be added to the above array
- * @var array
- */
- protected $adminMenu = array(
- // 'main/list' => array('caption'=> LAN_CATEGORY, 'perm' => 'P'),
- // 'main/create' => array('caption'=> LAN_CREATE, 'perm' => 'P'),
- //'main/gallery' => array('caption'=> 'Info', 'perm' => 'P'),//, 'url'=>'{e_ADMIN}image.php'
- 'main/prefs' => array('caption'=> LAN_PREFS, 'perm' => 'P')
- );
-
-
- /**
- * Optional, mode/action aliases, related with 'selected' menu CSS class
- * Format: 'MODE/ACTION' => 'MODE ALIAS/ACTION ALIAS';
- * This will mark active main/list menu item, when current page is main/edit
- * @var array
- */
- protected $adminMenuAliases = array(
- /// 'main/edit' => 'main/list',
- // 'cat/edit' => 'cat/list'
- );
-
- /**
- * Navigation menu title
- * @var string
- */
- protected $menuTitle = 'Gallery';
-
-
-}
-
-
-class gallery_cat_admin_ui extends e_admin_ui
-{
- protected $pluginTitle = 'Gallery Categories';
- protected $pluginName = 'gallery';
- protected $table = "core_media_cat";
- protected $pid = "media_cat_id";
- protected $perPage = 10; //no limit
- protected $listOrder = 'media_cat_order';
-
- protected $listQry = "SELECT * FROM #core_media_cat WHERE media_cat_owner = 'gallery' "; // without any Order or Limit.
- // protected $editQry = "SELECT * FROM #faq_info WHERE faq_info_id = {ID}";
-
- protected $fields = array(
- 'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'5%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'),
- // 'media_cat_id' => array('title'=> LAN_ID, 'type' => 'number', 'width' =>'5%', 'forced'=> TRUE, 'readonly'=>TRUE),
- 'media_cat_image' => array('title'=> LAN_IMAGE, 'type' => 'image', 'data' => 'str', 'width' => '100px', 'thclass' => 'center', 'class'=>'center', 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60','readonly'=>FALSE, 'batch' => FALSE, 'filter'=>FALSE),
- 'media_cat_owner' => array('title'=> "Owner", 'type' => 'hidden', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE, 'writeParms' =>'value=gallery'),
- 'media_cat_category' => array('title'=> LAN_CATEGORY, 'type' => 'hidden', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>TRUE),
- 'media_cat_title' => array('title'=> LAN_TITLE, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE),
- 'media_cat_diz' => array('title'=> LAN_DESCRIPTION, 'type' => 'bbarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=150&bb=1','readonly'=>FALSE), // Display name
- 'media_cat_class' => array('title'=> LAN_VISIBILITY, 'type' => 'userclass', 'width' => 'auto', 'data' => 'int', 'filter'=>TRUE, 'batch'=>TRUE),
- 'media_cat_order' => array('title'=> LAN_ORDER, 'type' => 'text', 'width' => '5%', 'thclass' => 'right', 'class'=> 'right' ),
- 'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'width' => '10%', 'forced'=>TRUE, 'thclass' => 'center last', 'class' => 'center')
- );
-
-
-
- public function beforeCreate($new_data)
- {
-
- $replace = array("_"," ","'",'"',"."); //FIXME Improve
- $new_data['media_cat_category'] = strtolower(str_replace($replace,"",$new_data['media_cat_title']));
- return $new_data;
- }
-
- function galleryPage()
- {
- $mes = e107::getMessage();
- $message = "Gallery is active. Simply import and assign images to the gallery categories using the Media Manager";
-
- $mes->addInfo($message);
- }
-
-
- protected $prefs = array(
- 'popup_w' => array('title'=> 'Image Max. Width', 'type' => 'text', 'data' => 'int', 'help'=>'Images will be auto-resized if greater than the width given here'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
- 'popup_h' => array('title'=> 'Image Max. Height', 'type' => 'text', 'data' => 'int', 'help'=>'Images will be auto-resized if greater than the height given here'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
-
-
- 'slideshow_category' => array('title'=> 'Slideshow category', 'type' => 'dropdown', 'data' => 'str', 'help'=>'Images from this category will be used in the sliding menu.'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
- // 'slideshow_thumb_w' => array('title'=> 'Thumbnail Width', 'type' => 'number', 'data' => 'integer', 'help'=>'Width in px'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
- // 'slideshow_thumb_h' => array('title'=> 'Thumbnail Height', 'type' => 'number', 'data' => 'integer', 'help'=>'Height in px'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
-
- // 'slideshow_perslide' => array('title'=> 'Images per slide', 'type' => 'number', 'data' => 'integer', 'help'=>'Number of images to show per slide.'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
- 'slideshow_duration' => array('title'=> 'Slide duration', 'type' => 'number', 'data' => 'integer', 'help'=>'The duration (in seconds) of a full jump.'), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
- 'slideshow_auto' => array('title'=> 'Slide auto-start', 'type'=>'boolean', 'data' => 'integer','help' => 'When enabled image-rotation begins automatically when the page is loaded.'),
- 'slideshow_freq' => array('title'=> 'Slide frequency', 'type' => 'number', 'data' => 'integer', 'help'=>'When auto-start is enabled, this dictates how long a slides stays put before the next jump. '), // 'validate' => 'regex', 'rule' => '#^[\d]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')),
- // 'slideshow_circular' => array('title'=> 'Slide circular-mode', 'type' => 'boolean', 'data' => 'integer', 'help'=>'By default when the first/last slide is reached, calling prev/next does nothing. If you want the effect to continue enable this option.'), //
- 'slideshow_effect' => array('title'=> 'Slide effect', 'type' => 'dropdown', 'data' => 'str', 'help'=>'Type of effect. '), //
- // 'slideshow_transition' => array('title'=> 'Slide transition', 'type' => 'dropdown', 'data' => 'str', 'help'=>'Type of transition. ') //
- );
-
-
-
- function init()
- {
- $effects = array(
- 'scrollHorz' => 'slide left',
- 'scrollVert' => 'slide down',
- // 'turnDown' => 'turn Down',
- // 'turnUp' => 'turn Up',
- // 'curtainX' => 'curtainX',
- // 'curtainY' => 'curtainY',
- 'fade' => 'fade',
- // 'zoom' => 'zoom'
- );
-
-
-
- $this->prefs['slideshow_effect']['writeParms'] = $effects;
- $this->prefs['slideshow_effect']['readParms'] = $effects;
-
- $transitions = array('sinoidal'=>'sinoidal','spring'=>'spring');
- $this->prefs['slideshow_transition']['writeParms'] = $transitions;
- $this->prefs['slideshow_transition']['readParms'] = $transitions;
-
- $categories = e107::getMedia()->getCategories('gallery');
- $cats = array();
- foreach($categories as $k=>$var)
- {
- list($tmp,$id) = explode("_",$k);
- $cats[$id] = $var['media_cat_title'];
- }
-
- $this->prefs['slideshow_category']['writeParms'] = $cats;
- $this->prefs['slideshow_category']['readParms'] = $cats;
-
- $mes = e107::getMessage();
- $message = "Gallery is active. Simply import and assign images to the gallery categories using the Media Manager";
-
- $mes->addInfo($message);
- }
-
-
-}
-
-class gallery_cat_admin_form_ui extends e_admin_form_ui
-{
-
- // Override the default Options field.
-
- public function gallery_category_parent($curVal,$mode)
- {
- // TODO - catlist combo without current cat ID in write mode, parents only for batch/filter
- // Get UI instance
- $controller = $this->getController();
- switch($mode)
- {
- case 'read':
- return e107::getParser()->toHTML($controller->getDownloadCategoryTree($curVal), false, 'TITLE');
- break;
-
- case 'write':
- return $this->selectbox('gallery_category_parent', $controller->getDownloadCategoryTree(), $curVal);
- break;
-
- case 'filter':
- case 'batch':
- return $controller->getDownloadCategoryTree();
- break;
- }
- }
-}
-
-
-
-
-
-
-
-class gallery_main_admin_ui extends e_admin_ui
-{
-
-
-
-}
-
-class gallery_main_admin_form_ui extends e_admin_form_ui
-{
-
-
-
-
-}