-
-
Couldn't load subscription status.
- Fork 5
New api to support Two form in one page. #36
Changes from 7 commits
cfbbebe
8621ae7
f20390b
b24a389
94bf691
1913c3c
c85bfba
f6b4e26
67378bc
d1ab5b1
e4dff1c
055aefa
fd710fa
987c095
791173f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,14 +34,15 @@ abstract class JHtmlJGrid | |
| * @param string $inactive_class An optional inactive HTML class | ||
| * @param boolean $enabled An optional setting for access control on the action. | ||
| * @param boolean $translate An optional setting for translation. | ||
| * @param string $checkbox An optional prefix for checkboxes. | ||
| * @param string $checkbox An optional prefix for checkboxes. | ||
| * @param string $formId An optional form selector. | ||
| * | ||
| * @return string The HTML markup | ||
| * | ||
| * @since 1.6 | ||
| */ | ||
| public static function action($i, $task, $prefix = '', $text = '', $active_title = '', $inactive_title = '', $tip = false, $active_class = '', | ||
| $inactive_class = '', $enabled = true, $translate = true, $checkbox = 'cb') | ||
| $inactive_class = '', $enabled = true, $translate = true, $checkbox = 'cb', $formId = null) | ||
| { | ||
| if (is_array($prefix)) | ||
| { | ||
|
|
@@ -67,7 +68,16 @@ public static function action($i, $task, $prefix = '', $text = '', $active_title | |
| if ($enabled) | ||
| { | ||
| $html[] = '<a class="tbody-icon' . ($active_class === 'publish' ? ' active' : '') . ($tip ? ' hasTooltip' : '') . '"'; | ||
| $html[] = ' href="javascript:void(0);" onclick="return listItemTask(\'' . $checkbox . $i . '\',\'' . $prefix . $task . '\')"'; | ||
|
|
||
| if ($formId !== null) | ||
| { | ||
| $html[] = ' href="javascript:void(0);" onclick="return listItemTask(\'' . $checkbox . $i . '\',\'' . $prefix . $task . '\',\'' . $formId . '\')"'; | ||
| } | ||
| else | ||
| { | ||
| $html[] = ' href="javascript:void(0);" onclick="return listItemTask(\'' . $checkbox . $i . '\',\'' . $prefix . $task . '\')"'; | ||
| } | ||
|
|
||
| $html[] = $tip ? ' title="' . $title . '"' : ''; | ||
| $html[] = '>'; | ||
| $html[] = '<span class="icon-' . $active_class . '" aria-hidden="true"></span>'; | ||
|
|
@@ -108,12 +118,13 @@ public static function action($i, $task, $prefix = '', $text = '', $active_title | |
| * @param boolean $enabled An optional setting for access control on the action. | ||
| * @param boolean $translate An optional setting for translation. | ||
| * @param string $checkbox An optional prefix for checkboxes. | ||
| * @param string $formId An optional form selector. | ||
| * | ||
| * @return string The HTML markup | ||
| * | ||
| * @since 1.6 | ||
| */ | ||
| public static function state($states, $value, $i, $prefix = '', $enabled = true, $translate = true, $checkbox = 'cb') | ||
| public static function state($states, $value, $i, $prefix = '', $enabled = true, $translate = true, $checkbox = 'cb', $formId = null) | ||
| { | ||
| if (is_array($prefix)) | ||
| { | ||
|
|
@@ -135,7 +146,8 @@ public static function state($states, $value, $i, $prefix = '', $enabled = true, | |
|
|
||
| return static::action( | ||
| $i, $task, $prefix, $text, $active_title, $inactive_title, $tip, | ||
| $active_class, $inactive_class, $enabled, $translate, $checkbox | ||
| $active_class, $inactive_class, $enabled, $translate, $checkbox, | ||
| $formId | ||
| ); | ||
| } | ||
|
|
||
|
|
@@ -146,6 +158,7 @@ public static function state($states, $value, $i, $prefix = '', $enabled = true, | |
| * @param integer $i The row index | ||
| * @param string|array $prefix An optional task prefix or an array of options | ||
| * @param boolean $enabled An optional setting for access control on the action. | ||
| * @param string $formId An optional form selector. | ||
| * @param string $checkbox An optional prefix for checkboxes. | ||
| * @param string $publish_up An optional start publishing date. | ||
| * @param string $publish_down An optional finish publishing date. | ||
|
|
@@ -155,7 +168,7 @@ public static function state($states, $value, $i, $prefix = '', $enabled = true, | |
| * @see JHtmlJGrid::state() | ||
| * @since 1.6 | ||
| */ | ||
| public static function published($value, $i, $prefix = '', $enabled = true, $checkbox = 'cb', $publish_up = null, $publish_down = null) | ||
| public static function published($value, $i, $prefix = '', $enabled = true, $formId = null, $checkbox = 'cb', $publish_up = null, $publish_down = null) | ||
|
||
| { | ||
| if (is_array($prefix)) | ||
| { | ||
|
|
@@ -229,10 +242,10 @@ public static function published($value, $i, $prefix = '', $enabled = true, $che | |
| } | ||
| } | ||
|
|
||
| return static::state($states, $value, $i, array('prefix' => $prefix, 'translate' => !$tip), $enabled, true, $checkbox); | ||
| return static::state($states, $value, $i, array('prefix' => $prefix, 'translate' => !$tip), $enabled, true, $checkbox, $formId); | ||
| } | ||
|
|
||
| return static::state($states, $value, $i, $prefix, $enabled, true, $checkbox); | ||
| return static::state($states, $value, $i, $prefix, $enabled, true, $checkbox, $formId); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -242,14 +255,15 @@ public static function published($value, $i, $prefix = '', $enabled = true, $che | |
| * @param integer $i The row index | ||
| * @param string|array $prefix An optional task prefix or an array of options | ||
| * @param boolean $enabled An optional setting for access control on the action. | ||
| * @param string $formId An optional form selector. | ||
| * @param string $checkbox An optional prefix for checkboxes. | ||
| * | ||
| * @return string The HTML markup | ||
| * | ||
| * @see JHtmlJGrid::state() | ||
| * @since 1.6 | ||
| */ | ||
| public static function isdefault($value, $i, $prefix = '', $enabled = true, $checkbox = 'cb') | ||
| public static function isdefault($value, $i, $prefix = '', $enabled = true, $formId = null, $checkbox = 'cb') | ||
|
||
| { | ||
| if (is_array($prefix)) | ||
| { | ||
|
|
@@ -264,7 +278,7 @@ public static function isdefault($value, $i, $prefix = '', $enabled = true, $che | |
| 1 => array('unsetDefault', 'JDEFAULT', 'JLIB_HTML_UNSETDEFAULT_ITEM', 'JDEFAULT', 1, 'featured', 'featured'), | ||
| ); | ||
|
|
||
| return static::state($states, $value, $i, $prefix, $enabled, true, $checkbox); | ||
| return static::state($states, $value, $i, $prefix, $enabled, true, $checkbox, $formId); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -320,13 +334,14 @@ public static function publishedOptions($config = array()) | |
| * @param string $time The time that the object was checked out. | ||
| * @param string|array $prefix An optional task prefix or an array of options | ||
| * @param boolean $enabled True to enable the action. | ||
| * @param string $formId An optional form selector. | ||
| * @param string $checkbox An optional prefix for checkboxes. | ||
| * | ||
| * @return string The HTML markup | ||
| * | ||
| * @since 1.6 | ||
| */ | ||
| public static function checkedout($i, $editorName, $time, $prefix = '', $enabled = false, $checkbox = 'cb') | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And here |
||
| public static function checkedout($i, $editorName, $time, $prefix = '', $enabled = false, $formId = null, $checkbox = 'cb') | ||
| { | ||
| if (is_array($prefix)) | ||
| { | ||
|
|
@@ -342,7 +357,8 @@ public static function checkedout($i, $editorName, $time, $prefix = '', $enabled | |
|
|
||
| return static::action( | ||
| $i, 'checkin', $prefix, JText::_('JLIB_HTML_CHECKED_OUT'), html_entity_decode($active_title, ENT_QUOTES, 'UTF-8'), | ||
| html_entity_decode($inactive_title, ENT_QUOTES, 'UTF-8'), true, 'checkedout', 'checkedout', $enabled, false, $checkbox | ||
| html_entity_decode($inactive_title, ENT_QUOTES, 'UTF-8'), true, 'checkedout', 'checkedout', $enabled, false, $checkbox, | ||
| $formId | ||
| ); | ||
| } | ||
|
|
||
|
|
@@ -354,13 +370,14 @@ public static function checkedout($i, $editorName, $time, $prefix = '', $enabled | |
| * @param string|array $prefix An optional task prefix or an array of options | ||
| * @param string $text An optional text to display | ||
| * @param boolean $enabled An optional setting for access control on the action. | ||
| * @param string $formId An optional form selector. | ||
| * @param string $checkbox An optional prefix for checkboxes. | ||
| * | ||
| * @return string The HTML markup | ||
| * | ||
| * @since 1.6 | ||
| */ | ||
| public static function orderUp($i, $task = 'orderup', $prefix = '', $text = 'JLIB_HTML_MOVE_UP', $enabled = true, $checkbox = 'cb') | ||
| public static function orderUp($i, $task = 'orderup', $prefix = '', $text = 'JLIB_HTML_MOVE_UP', $enabled = true, $formId = null, $checkbox = 'cb') | ||
| { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nope, it needs to be the last one, otherwise, we have a b/c break!!! |
||
| if (is_array($prefix)) | ||
| { | ||
|
|
@@ -371,7 +388,7 @@ public static function orderUp($i, $task = 'orderup', $prefix = '', $text = 'JLI | |
| $prefix = array_key_exists('prefix', $options) ? $options['prefix'] : ''; | ||
| } | ||
|
|
||
| return static::action($i, $task, $prefix, $text, $text, $text, false, 'uparrow', 'uparrow_disabled', $enabled, true, $checkbox); | ||
| return static::action($i, $task, $prefix, $text, $text, $text, false, 'uparrow', 'uparrow_disabled', $enabled, true, $checkbox, $formId); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -382,13 +399,14 @@ public static function orderUp($i, $task = 'orderup', $prefix = '', $text = 'JLI | |
| * @param string|array $prefix An optional task prefix or an array of options | ||
| * @param string $text An optional text to display | ||
| * @param boolean $enabled An optional setting for access control on the action. | ||
| * @param string $formId An optional form selector. | ||
| * @param string $checkbox An optional prefix for checkboxes. | ||
| * | ||
| * @return string The HTML markup | ||
| * | ||
| * @since 1.6 | ||
| */ | ||
| public static function orderDown($i, $task = 'orderdown', $prefix = '', $text = 'JLIB_HTML_MOVE_DOWN', $enabled = true, $checkbox = 'cb') | ||
| public static function orderDown($i, $task = 'orderdown', $prefix = '', $text = 'JLIB_HTML_MOVE_DOWN', $enabled = true, $formId = null, $checkbox = 'cb') | ||
| { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And here |
||
| if (is_array($prefix)) | ||
| { | ||
|
|
@@ -399,6 +417,6 @@ public static function orderDown($i, $task = 'orderdown', $prefix = '', $text = | |
| $prefix = array_key_exists('prefix', $options) ? $options['prefix'] : ''; | ||
| } | ||
|
|
||
| return static::action($i, $task, $prefix, $text, $text, $text, false, 'downarrow', 'downarrow_disabled', $enabled, true, $checkbox); | ||
| return static::action($i, $task, $prefix, $text, $text, $text, false, 'downarrow', 'downarrow_disabled', $enabled, true, $checkbox, $formId); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,19 +67,31 @@ protected function prepareOptions(array &$options) | |
| * @param string $text Button text. | ||
| * @param string $task Task associated with the button. | ||
| * @param boolean $list True to allow lists | ||
| * @param string $formId The id of action form. | ||
| * | ||
| * @return string HTML string for the button | ||
| * | ||
| * @since 3.0 | ||
| * | ||
| * @deprecated 5.0 Use render() instead. | ||
| */ | ||
| public function fetchButton($type = 'Standard', $name = '', $text = '', $task = '', $list = true) | ||
| public function fetchButton($type = 'Standard', $name = '', $text = '', $task = '', $list = true, $formId = null) | ||
| { | ||
| $this->name($name) | ||
| ->text($text) | ||
| ->task($task) | ||
| ->listCheck($list); | ||
| if ($formId !== null) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we save some lines if we do it like this |
||
| { | ||
| $this->name($name) | ||
| ->text($text) | ||
| ->task($task) | ||
| ->listCheck($list) | ||
| ->form($formId); | ||
| } | ||
| else | ||
| { | ||
| $this->name($name) | ||
| ->text($text) | ||
| ->task($task) | ||
| ->listCheck($list); | ||
| } | ||
|
|
||
| return $this->renderButton($this->options); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to add the new parameter at the end or you’re breaking b/c