mirror of
https://github.com/e107inc/e107.git
synced 2025-03-14 17:39:46 +01:00
AdminUI: Simple SEF generation option added. Usage: writeParms='sef=sourceField'. eg. writeParms='sef=news_title'.
This commit is contained in:
parent
42efabc505
commit
71fff6e8d2
@ -488,7 +488,7 @@ class page_admin_ui extends e_admin_ui
|
||||
'page_rating_flag' => array('title'=> LAN_RATING, 'tab' => 1, 'type' => 'boolean', 'data'=>'int', 'width' => '5%', 'thclass' => 'center', 'class' => 'center' ),
|
||||
'page_comment_flag' => array('title'=> LAN_COMMENTS, 'tab' => 1, 'type' => 'boolean', 'data'=>'int', 'width' => '5%', 'thclass' => 'center', 'class' => 'center' ),
|
||||
'page_password' => array('title'=> LAN_PASSWORD, 'tab' => 1, 'type' => 'text', 'data'=>'str', 'width' => 'auto', 'writeParms'=>array('password'=>1, 'nomask'=>1, 'size' => 40, 'class' => 'tbox e-password', 'generate' => 1, 'strength' => 1, 'required'=>0)),
|
||||
'page_sef' => array('title'=> LAN_SEFURL, 'tab' => 1, 'type' => 'text', 'inline'=>true, 'width' => 'auto', 'writeParms'=>'size=xxlarge'),
|
||||
'page_sef' => array('title'=> LAN_SEFURL, 'tab' => 1, 'type' => 'text', 'inline'=>true, 'width' => 'auto', 'writeParms'=>'size=xxlarge&sef=page_title'),
|
||||
'page_metakeys' => array('title'=> LAN_KEYWORDS, 'tab' => 1, 'type' => 'tags', 'width' => 'auto'),
|
||||
'page_metadscr' => array('title'=> CUSLAN_11, 'tab' => 1, 'type' => 'text', 'width' => 'auto', 'writeParms'=>'size=xxlarge'),
|
||||
|
||||
|
@ -403,7 +403,7 @@ class news_admin_ui extends e_admin_ui
|
||||
|
||||
'news_meta_keywords' => array('title' => LAN_KEYWORDS, 'type' => 'tags', 'tab'=>1, 'inline'=>true, 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false),
|
||||
'news_meta_description' => array('title' => LAN_DESCRIPTION,'type' => 'textarea', 'tab'=>1, 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'writeParms'=>array('size'=>'xxlarge')),
|
||||
'news_sef' => array('title' => LAN_SEFURL, 'type' => 'text', 'tab'=>1, 'inline'=>true, 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'writeParms'=>array('size'=>'xxlarge', 'show'=>1, 'tdClassRight'=>'form-inline')),
|
||||
'news_sef' => array('title' => LAN_SEFURL, 'type' => 'text', 'tab'=>1, 'inline'=>true, 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'writeParms'=>array('size'=>'xxlarge', 'show'=>1, 'sef'=>'news_title')),
|
||||
'news_ping' => array('title' => LAN_PING, 'type' => 'checkbox', 'tab'=>1, 'data'=>false, 'writeParms'=>'value=0', 'inline'=>true, 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false),
|
||||
|
||||
'news_author' => array('title' => LAN_AUTHOR, 'type' => 'method', 'tab'=>0, 'readParms'=>'idField=user_id&nameField=user_name', 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false),
|
||||
@ -689,11 +689,7 @@ class news_admin_ui extends e_admin_ui
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$this->fields['news_email_notify']['writeParms']['post'] = "<span class='radio-inline radio inline'><a class='e-modal btn btn-xs btn-mini btn-primary' data-modal-caption='".ADLAN_149."' href='notify.php?iframe=1&type=admin_news_notify#/tab-news-events'>".LAN_CONFIGURE."</a></span>";
|
||||
$this->fields['news_sef']['writeParms']['post'] = "<span class='form-inline input-group-btn'><a class='e-sef-generate btn btn-default' data-src='news-title' data-target='news-sef' data-confirm=\"".LAN_WILL_OVERWRITE_SEF." ".LAN_JSCONFIRM."\">".LAN_GENERATE."</a></span>";
|
||||
|
||||
|
||||
// e107::getMessage()->addDebug(print_a($_POST,true));
|
||||
|
||||
|
@ -1263,7 +1263,7 @@ class e_form
|
||||
{
|
||||
if(is_string($options)) parse_str($options, $options);
|
||||
// auto-height support
|
||||
|
||||
|
||||
if(vartrue($options['size']) && !is_numeric($options['size']))
|
||||
{
|
||||
$options['class'] .= " form-control input-".$options['size'];
|
||||
@ -4040,7 +4040,7 @@ class e_form
|
||||
case 'number':
|
||||
$maxlength = vartrue($parms['maxlength'], 255);
|
||||
unset($parms['maxlength']);
|
||||
if(!vartrue($parms['size'])) $parms['size'] = 'mini';
|
||||
if(!vartrue($parms['size'])) $parms['size'] = 'small';
|
||||
if(!vartrue($parms['class'])) $parms['class'] = 'tbox number e-spinner ';
|
||||
if(!$value) $value = '0';
|
||||
$ret = vartrue($parms['pre']).$this->number($key, $value, $maxlength, $parms).vartrue($parms['post']);
|
||||
@ -4070,21 +4070,31 @@ class e_form
|
||||
$ret = vartrue($parms['pre']).$this->password($key, $value, $maxlength, $parms).vartrue($parms['post']); // vartrue($parms['__options']) is limited. See 'required'=>true
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case 'text':
|
||||
|
||||
$maxlength = vartrue($parms['maxlength'], 255);
|
||||
unset($parms['maxlength']);
|
||||
|
||||
if(!empty($parms['sef']))
|
||||
{
|
||||
$sefSource = $this->name2id($parms['sef']);
|
||||
$sefTarget = $this->name2id($key);
|
||||
$parms['tdClassRight'] .= 'input-group';
|
||||
$parms['post'] = "<span class='form-inline input-group-btn pull-left'><a class='e-sef-generate btn btn-default' data-src='".$sefSource."' data-target='".$sefTarget."' data-confirm=\"".LAN_WILL_OVERWRITE_SEF." ".LAN_JSCONFIRM."\">".LAN_GENERATE."</a></span>";
|
||||
}
|
||||
|
||||
if(!empty($parms['password'])) // password mechanism without the md5 storage.
|
||||
{
|
||||
$ret = vartrue($parms['pre']).$this->password($key, $value, $maxlength, $parms).vartrue($parms['post']);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$ret = vartrue($parms['pre']).$this->text($key, $value, $maxlength, $parms).vartrue($parms['post']); // vartrue($parms['__options']) is limited. See 'required'=>true
|
||||
}
|
||||
|
||||
|
||||
if(!empty($attributes['multilan']))
|
||||
{
|
||||
$ret = "<span class='input-group input-xxlarge'>".$ret."</span>";
|
||||
@ -4717,6 +4727,8 @@ class e_form
|
||||
$label = vartrue($att['note']) ? '<div class="label-note">'.deftrue($att['note'], $att['note']).'</div>' : '';
|
||||
$help = vartrue($att['help']) ? '<div class="field-help">'.deftrue($att['help'], $att['help']).'</div>' : '';
|
||||
|
||||
|
||||
|
||||
$valPath = trim(vartrue($att['dataPath'], $key), '/');
|
||||
$keyName = $key;
|
||||
if(strpos($valPath, '/')) //not TRUE, cause string doesn't start with /
|
||||
@ -4737,8 +4749,11 @@ class e_form
|
||||
{
|
||||
$writeParms = varset($att['writeParms']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(!empty($writeParms['sef'])) // group sef generate button with input element.
|
||||
{
|
||||
$writeParms['tdClassRight'] .= 'input-group';
|
||||
}
|
||||
|
||||
if('hidden' === $att['type'])
|
||||
{
|
||||
|
@ -236,7 +236,7 @@ class download_main_admin_ui extends e_admin_ui
|
||||
'download_id' => array('title'=> ID, 'type' => 'number', 'data' => 'int', 'width'=>'5%', 'thclass' => '', 'forced'=> TRUE, 'primary'=>TRUE/*, 'noedit'=>TRUE*/), //Primary ID is not editable
|
||||
'download_name' => array('title'=> LAN_TITLE, 'type' => 'text', 'data' => 'str', 'inline'=>true, 'width' => 'auto', 'thclass' => ''),
|
||||
'download_url' => array('title'=> DOWLAN_13, 'type' => 'url', 'data' => 'str', 'width'=>'auto', 'thclass' => '', 'batch' => TRUE, 'filter'=>TRUE),
|
||||
'download_sef' => array('title'=> LAN_SEFURL, 'type' => 'text', 'inline'=>true, 'data' => 'str', 'width'=>'auto', 'thclass' => '', 'batch' => TRUE, 'filter'=>TRUE),
|
||||
'download_sef' => array('title'=> LAN_SEFURL, 'type' => 'text', 'inline'=>true, 'data' => 'str', 'width'=>'auto', 'thclass' => '', 'batch' => TRUE, 'filter'=>TRUE, 'writeParms'=>'sef=download_name'),
|
||||
'download_keywords' => array('title'=> LAN_KEYWORDS, 'type' => 'tags', 'inline'=>true, 'data' => 'str', 'width'=>'auto', 'thclass' => ''),
|
||||
|
||||
'download_author' => array('title'=> LAN_AUTHOR, 'type' => 'user', 'data' => 'str', 'width' => 'auto', 'thclass' => 'left'),
|
||||
@ -1342,7 +1342,7 @@ $columnInfo = array(
|
||||
<tr>
|
||||
<td >".DOWLAN_12."</td>
|
||||
<td style='width:80%'>
|
||||
<input class='tbox input-xxlarge' type='text' name='download_name' size='60' value=\"".$tp->toForm($download_name)."\" maxlength='200'/>
|
||||
<input class='tbox input-xxlarge' type='text' id='download-name' name='download_name' size='60' value=\"".$tp->toForm($download_name)."\" maxlength='200'/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -1447,8 +1447,8 @@ $columnInfo = array(
|
||||
|
||||
<tr>
|
||||
<td >".LAN_SEFURL."</td>
|
||||
<td style='width:80%'>
|
||||
<input class='tbox input-xxlarge' type='text' name='download_sef' size='60' value=\"".$tp->toForm($download_sef)."\" maxlength='250'/>
|
||||
<td class='input-group' style='width:80%'>
|
||||
".$frm->renderElement('download_sef',$download_sef, array('type'=>'text', 'writeParms'=>array('sef'=>'download_name','size'=>'xxlarge')))."
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user