1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-16 19:44:09 +02:00

Improved editing of e_url custom aliases in admin area.

This commit is contained in:
Cameron
2015-06-18 18:23:25 -07:00
parent a484abea38
commit 7e4c26e458
2 changed files with 71 additions and 13 deletions

View File

@@ -2974,7 +2974,7 @@ class e_form
* @param $type text|textarea|select|date|checklist
* @param $array : array data used in dropdowns etc.
*/
private function renderInline($dbField, $pid, $fieldName, $curVal, $linkText, $type='text', $array=null)
public function renderInline($dbField, $pid, $fieldName, $curVal, $linkText, $type='text', $array=null, $options=array())
{
$jsonArray = array();
@@ -2989,10 +2989,36 @@ class e_form
$mode = preg_replace('/[^\w]/', '', vartrue($_GET['mode'], ''));
if(!isset($options['url']))
{
$options['url'] = e_SELF."?mode={$mode}&action=inline&id={$pid}&ajax_used=1";
}
if(!empty($pid))
{
$options['pk'] = $pid;
}
$title = varset($options['title'] , (LAN_EDIT." ".$fieldName));
unset( $options['title']);
$text = "<a class='e-tip e-editable editable-click' data-name='".$dbField."' ";
$text .= (is_array($array)) ? "data-source=\"".$source."\" " : "";
$text .= " title=\"".LAN_EDIT." ".$fieldName."\" data-type='".$type."' data-inputclass='x-editable-".$this->name2id($dbField)."' data-value=\"{$curVal}\" data-pk='".$pid."' data-url='".e_SELF."?mode={$mode}&amp;action=inline&amp;id={$pid}&amp;ajax_used=1' href='#'>".$linkText."</a>";
$text .= " title=\"".$title."\" data-type='".$type."' data-inputclass='x-editable-".$this->name2id($dbField)."' data-value=\"{$curVal}\" href='#' ";
if(!empty($options))
{
foreach($options as $k=>$opt)
{
if(!empty($opt))
{
$text .= " data-".$k."='".$opt."'";
}
}
}
$text .= ">".$linkText."</a>";
return $text;
}