diff --git a/e107_admin/download.php b/e107_admin/download.php index 7f0c88631..9c2e12dc7 100644 --- a/e107_admin/download.php +++ b/e107_admin/download.php @@ -56,7 +56,6 @@ $frm = new e_form; $download = new download; require_once("auth.php"); -$pst->save_preset(); // unique name(s) for the presets - comma separated. /* One form example (no arrays needed) diff --git a/e107_admin/header.php b/e107_admin/header.php index 8645f81e2..5f6d258bf 100644 --- a/e107_admin/header.php +++ b/e107_admin/header.php @@ -252,7 +252,7 @@ echo "\n"; // Wysiwyg JS support on or off. // your code should run off e_WYSIWYG -if (varset($pref['wysiwyg'], FALSE) && check_class($pref['post_html'])) +if (varset($pref['wysiwyg'], FALSE) ) // posts bbcode by default. { define("e_WYSIWYG", TRUE); } @@ -291,23 +291,6 @@ if (is_readable(e_FILE.'user.js') && filesize(e_FILE.'user.js')) echo "\n"; } -// XXX - This shouldn't be here as well -if ((strpos(e_SELF, 'fileinspector.php') === FALSE) && getperms("0")) -{ - echo "\n"; -} - - // [JSManager] Load JS Includes - Zone 3 - before e_meta and headerjs() e107::getJs()->renderJs('header', 3); diff --git a/e107_admin/image.php b/e107_admin/image.php index 0fb8011eb..8666dee96 100644 --- a/e107_admin/image.php +++ b/e107_admin/image.php @@ -645,30 +645,12 @@ class media_admin_ui extends e_admin_ui $this->updateSettings(); } + // filepicker stuff. if($this->getQuery('mode') == 'dialog')//TODO Check this actually does something, as it was changed to 'action'. { if(!ADMIN){ exit; } - $cat = $_GET['for']; - if(!isset($this->cats[$cat])) - { - return; - } - $this->listQry = "SELECT m.*,u.user_id,u.user_name FROM #core_media AS m LEFT JOIN #user AS u ON m.media_author = u.user_id WHERE media_category = '".$cat."' "; // without any Order or Limit. - - unset($this->fields['checkboxes']); - $this->fields['options']['type'] = 'method'; - $this->fields['media_category']['nolist'] = true; - $this->fields['media_userclass']['nolist'] = true; - $this->fields['media_dimensions']['nolist'] = true; - $this->fields['media_description']['nolist'] = true; - $this->fields['media_type']['nolist'] = true; - - foreach($this->fields as $k=>$v) - { - $this->fields[$k]['filter'] = false; - } } @@ -736,26 +718,39 @@ class media_admin_ui extends e_admin_ui { $cat = $this->getQuery('for'); $file = (substr($cat,-5) == "_file") ? TRUE : FALSE; + $mes = e107::getMessage(); + $mes->addDebug("For:".$cat); if($file) { + $cat = $_GET['for']; + if(!isset($this->cats[$cat])) + { + return; + } - echo $this->getUI()->getList(); - - return; + $this->listQry = "SELECT m.*,u.user_id,u.user_name FROM #core_media AS m LEFT JOIN #user AS u ON m.media_author = u.user_id WHERE m.media_category = '".$cat."' "; // without any Order or Limit. + + unset($this->fields['checkboxes']); + $this->fields['options']['type'] = 'method'; + $this->fields['media_category']['nolist'] = true; + $this->fields['media_userclass']['nolist'] = true; + $this->fields['media_dimensions']['nolist'] = true; + $this->fields['media_description']['nolist'] = true; + $this->fields['media_type']['nolist'] = true; + + foreach($this->fields as $k=>$v) + { + $this->fields[$k]['filter'] = false; + } + + echo $this->mediaSelectUpload('file'); } - + else + { + echo $this->mediaSelectUpload(); + } - // $this->getModel()->setAction('create'); - // $this->getUI()->getController()->getRequest()->setAction('create'); - //$this->setAction('create');; - - if($_POST['etrigger_submit']) - { - // $data = $this->beforeCreate($_POST); - // e107::getDb()->db_Insert('core_media',$data); // Replace with Generic (needs parm sent) - } - echo $this->imageSelectUpload(); } @@ -774,7 +769,7 @@ class media_admin_ui extends e_admin_ui } - function imageSelectUpload() + function mediaSelectUpload($type='image') { $frm = e107::getForm(); $bbcodeMode = ($this->getQuery('bbcode')=='img') ? 'bbcode=img' : FALSE; @@ -806,7 +801,14 @@ class media_admin_ui extends e_admin_ui $tag = ($bbcodeMode) ? "" : $this->getQuery('tagid'); - $text .= e107::getMedia()->mediaSelect($this->getQuery('for'),$this->getQuery('tagid'),$bbcodeMode); // eg. news, news-thumbnail + if($type == 'file') + { + $text .= $this->getUI()->getList(); //FIXME NOT WORKING! + } + else + { + $text .= e107::getMedia()->mediaSelect($this->getQuery('for'),$this->getQuery('tagid'),$bbcodeMode); // eg. news, news-thumbnail + } $text .= " diff --git a/e107_admin/sql/core_sql.php b/e107_admin/sql/core_sql.php index 37a217e1d..5778bf0ed 100644 --- a/e107_admin/sql/core_sql.php +++ b/e107_admin/sql/core_sql.php @@ -125,7 +125,7 @@ CREATE TABLE core ( CREATE TABLE core_media ( media_id int(10) unsigned NOT NULL auto_increment, - media_type varchar(15) NOT NULL default '', + media_type varchar(50) NOT NULL default '', media_name varchar(255) NOT NULL default '', media_caption varchar(255) NOT NULL default '', media_description varchar(255) NOT NULL default '', diff --git a/e107_admin/wmessage.php b/e107_admin/wmessage.php index b10d0dbe4..d008eb52c 100644 --- a/e107_admin/wmessage.php +++ b/e107_admin/wmessage.php @@ -25,14 +25,8 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); $e_sub_cat = 'wmessage'; -require_once(e_HANDLER."preset_class.php"); -$pst = new e_preset; -$pst->form = "wmform"; -$pst->page = "wmessage.php?create"; -$pst->id = "admin_wmessage"; -require_once("auth.php"); -$pst->save_preset(); // save and render result +require_once("auth.php"); require_once(e_HANDLER.'form_handler.php'); require_once(e_HANDLER.'userclass_class.php'); require_once(e_HANDLER."ren_help.php"); @@ -161,15 +155,6 @@ if ($action == "create" || $action == "edit") $row = $sql->db_Fetch(); } - if ($sub_action != 'edit') - { - $preset = $pst->read_preset("admin_wmessage"); - if (is_array($preset)) - { - extract($preset); - } - } - $text = "