1
0
mirror of https://github.com/e107inc/e107.git synced 2025-03-14 01:19:44 +01:00

Html5 validation fixes. Admin SiteLinks for admin-ui now using $frm->url(); for URLs.

This commit is contained in:
Cameron 2015-02-01 17:28:38 -08:00
parent 274069184f
commit ee1623e747
6 changed files with 36 additions and 48 deletions

View File

@ -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();

View File

@ -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', ?

View File

@ -71,7 +71,7 @@ $CHAPTER_TEMPLATE['nav']['listChapters']['item_active'] = '
$CHAPTER_TEMPLATE['nav']['listChapters']['end'] = '</ul>';
$CHAPTER_TEMPLATE['nav']['listChapters']['submenu_start'] = '<ul class="page-nav" id="page-nav-{LINK_PARENT}" role="menu" >';
$CHAPTER_TEMPLATE['nav']['listChapters']['submenu_start'] = '<ul class="page-nav" id="{LINK_IDENTIFIER}" role="menu" >';
$CHAPTER_TEMPLATE['nav']['listChapters']['submenu_item'] = '

View File

@ -338,8 +338,15 @@ class e_form
}
/**
* Same as $this->text() except it adds input validation for urls.
* At this stage, checking only for spaces. Should include sef-urls.
*/
function url($name, $value = '', $maxlength = 80, $options= array())
{
$options['pattern'] = '^\S*$';
return $this->text($name, $value, $maxlength, $options);
}
/**
* Text-Field Form Element
@ -3559,6 +3566,11 @@ class e_form
break;
case 'url':
$maxlength = vartrue($parms['maxlength'], 255);
unset($parms['maxlength']);
$ret = vartrue($parms['pre']).$this->url($key, $value, $maxlength, $parms).vartrue($parms['post']); // vartrue($parms['__options']) is limited. See 'required'=>true
break;
// case 'email':
case 'text':
case 'password': // encrypts to md5 when saved.

View File

@ -1687,6 +1687,11 @@ class navigation_shortcodes extends e_shortcode
}
function sc_link_identifier($parm='')
{
return $this->var['link_identifier'];
}
/**
* Return the URL of the current link
* @return string

View File

@ -27,7 +27,7 @@ $GALLERY_TEMPLATE['list_end'] =
"</div>
<div class='center' >
<div class='gallery-list-nextprev'>{GALLERY_NEXTPREV}</div>
<div class='gallery-list-back'><a class='btn btn-default' href='{GALLERY_BASEURL}'>Back to Categories</a></div>
<div class='gallery-list-back'><a class='btn btn-default' href='{GALLERY_BASEURL}'>".LAN_BACK."</a></div>
</div>
";
@ -54,47 +54,6 @@ $GALLERY_TEMPLATE['cat_end'] =
";
/* //Bootstrap2
$GALLERY_TEMPLATE['list_start'] =
'{GALLERY_BREADCRUMB}
<ul class="thumbnails gallery">';
$GALLERY_TEMPLATE['list_item'] = '
<li class="span2">
<div class="thumbnail">
{GALLERY_THUMB}
<h5>{GALLERY_CAPTION}</h5>
</div>
</li>';
$GALLERY_TEMPLATE['list_end'] =
"</ul>
<div class='center' >
<div class='gallery-list-nextprev'>{GALLERY_NEXTPREV}</div>
<div class='gallery-list-back'><a class='btn' href='{GALLERY_BASEURL}'>Back to Categories</a></div>
</div>
";
$GALLERY_TEMPLATE['cat_start'] =
'{GALLERY_BREADCRUMB}
<ul class="thumbnails gallery-cat">';
$GALLERY_TEMPLATE['cat_item'] = '
<li class="span3">
<div >
{GALLERY_CAT_THUMB}
<h3>{GALLERY_CAT_TITLE}</h3>
</div>
</li>';
$GALLERY_TEMPLATE['cat_end'] =
"</ul>
";
*/
// {GALLERY_SLIDESHOW=X} X = Gallery Category. Default: 1 (ie. 'gallery_1') Overrides preference in admin.
// {GALLERY_SLIDES=X} X = number of items per slide.