From ee1623e74778ab0026c6438439c34884825bc32a Mon Sep 17 00:00:00 2001 From: Cameron Date: Sun, 1 Feb 2015 17:28:38 -0800 Subject: [PATCH] Html5 validation fixes. Admin SiteLinks for admin-ui now using $frm->url(); for URLs. --- e107_admin/image.php | 16 ++++++- e107_admin/links.php | 2 +- e107_core/templates/chapter_template.php | 2 +- e107_handlers/form_handler.php | 16 ++++++- e107_handlers/sitelinks_class.php | 5 +++ .../gallery/templates/gallery_template.php | 43 +------------------ 6 files changed, 36 insertions(+), 48 deletions(-) diff --git a/e107_admin/image.php b/e107_admin/image.php index 2a6d8d186..93441b4a8 100644 --- a/e107_admin/image.php +++ b/e107_admin/image.php @@ -591,7 +591,7 @@ class media_form_ui extends e_admin_form_ui } - function media_preview($curVal, $mode, $attributes, $id) + function media_preview($curVal, $mode, $attributes, $id='') { $attributes['type'] = 'image'; @@ -690,7 +690,7 @@ class media_admin_ui extends e_admin_ui 'media_caption' => array('title'=> "Caption", 'type' => 'text', 'data'=> 'str', 'inline'=>true, 'width' => 'auto'), // media_description is type = textarea until bbarea can be reduced to not include youtube etc 'media_description' => array('title'=> LAN_DESCRIPTION, 'type' => 'textarea', 'data'=> 'str', 'width' => 'auto', 'thclass' => 'left first', 'readParms' => 'truncate=100', 'writeParms' => 'counter=0'), - 'media_type' => array('title'=> "Mime Type", 'type' => 'text', 'data'=> 'str', 'width' => 'auto', 'noedit'=>TRUE), + 'media_type' => array('title'=> "Mime Type", 'type' => 'dropdown', 'data'=> 'str', 'filter'=>true, 'width' => 'auto', 'noedit'=>TRUE), 'media_author' => array('title'=> LAN_USER, 'type' => 'user', 'data'=> 'int', 'width' => 'auto', 'thclass' => 'center', 'class'=>'center','readParms' => 'link=1', 'filter' => true, 'batch' => true, 'noedit'=>TRUE ), 'media_datestamp' => array('title'=> LAN_DATESTAMP, 'type' => 'datestamp', 'data'=> 'int', 'width' => '10%', 'noedit'=>TRUE), // User date 'media_size' => array('title'=> "Size", 'type' => 'number', 'data'=> 'int', 'width' => 'auto', 'readonly'=>2), @@ -837,7 +837,19 @@ class media_admin_ui extends e_admin_ui } asort($this->cats); + + $tmp = $sql->retrieve('core_media','media_type','media_type !="" GROUP BY media_type',true); + $mimeTypes = array(); + foreach($tmp as $val) + { + $id = $val['media_type']; + $mimeTypes[$id] = $id; + } + asort($mimeTypes); + $this->fields['media_category']['writeParms'] = $this->cats; + $this->fields['media_type']['writeParms'] = $mimeTypes; + $pref = e107::getPref(); $tp = e107::getParser(); diff --git a/e107_admin/links.php b/e107_admin/links.php index 33b22e620..0013c68cd 100644 --- a/e107_admin/links.php +++ b/e107_admin/links.php @@ -84,7 +84,7 @@ class links_admin_ui extends e_admin_ui 'link_category' => array('title'=> LAN_TEMPLATE, 'type' => 'dropdown', 'inline'=>true, 'batch'=>true, 'filter'=>true, 'width' => 'auto'), 'link_parent' => array('title'=> 'Sublink of', 'type' => 'method', 'width' => 'auto', 'batch'=>true, 'filter'=>true, 'thclass' => 'left first'), - 'link_url' => array('title'=> LAN_URL, 'width'=>'auto', 'type'=>'text', 'inline'=>true, 'required'=>true,'validate' => true, 'writeParms'=>'size=xxlarge'), + 'link_url' => array('title'=> LAN_URL, 'width'=>'auto', 'type'=>'url', 'inline'=>true, 'required'=>true,'validate' => true, 'writeParms'=>'size=xxlarge'), // 'link_sefurl' => array('title'=> LAN_SEFURL, 'type' => 'text', 'inline'=>true, 'width' => 'auto'), 'link_class' => array('title'=> LAN_USERCLASS, 'type' => 'userclass','inline'=>true, 'writeParms' => 'classlist=public,guest,nobody,member,classes,admin,main', 'batch'=>true, 'filter'=>true, 'width' => 'auto'), 'link_description' => array('title'=> LAN_DESCRIPTION, 'type' => 'textarea', 'width' => 'auto'), // 'method'=>'tinymce_plugins', ? diff --git a/e107_core/templates/chapter_template.php b/e107_core/templates/chapter_template.php index d04e44c94..c834dab0f 100644 --- a/e107_core/templates/chapter_template.php +++ b/e107_core/templates/chapter_template.php @@ -71,7 +71,7 @@ $CHAPTER_TEMPLATE['nav']['listChapters']['item_active'] = ' $CHAPTER_TEMPLATE['nav']['listChapters']['end'] = ''; -$CHAPTER_TEMPLATE['nav']['listChapters']['submenu_start'] = '