Text="<%[ Configure job ]%>"
Visible="<%=!empty($_SESSION['dir'])%>"
OnClick="loadJobConfig"
- CommandParameter="show"
/>
<com:TActiveLinkButton
CssClass="w3-bar-item w3-button tab_btn"
Text="<%[ Configure fileset ]%>"
Visible="<%=!empty($_SESSION['dir'])%>"
OnClick="loadFileSetConfig"
- CommandParameter="show"
/>
<com:TActiveLinkButton
CssClass="w3-bar-item w3-button tab_btn"
Text="<%[ Configure schedule ]%>"
Visible="<%=!empty($_SESSION['dir'])%>"
OnClick="loadScheduleConfig"
- CommandParameter="show"
/>
</div>
<div class="w3-container tab_item" id="job_actions">
Text="<%[ Configure job ]%>"
Visible="<%=!empty($_SESSION['dir'])%>"
OnClick="loadJobConfig"
- CommandParameter="show"
/>
<com:TActiveLinkButton
CssClass="w3-bar-item w3-button tab_btn"
Text="<%[ Configure fileset ]%>"
Visible="<%=!empty($_SESSION['dir'])%>"
OnClick="loadFileSetConfig"
- CommandParameter="show"
/>
<com:TActiveLinkButton
CssClass="w3-bar-item w3-button tab_btn"
Text="<%[ Configure schedule ]%>"
Visible="<%=!empty($_SESSION['dir'])%>"
OnClick="loadScheduleConfig"
- CommandParameter="show"
/>
<com:TActiveLinkButton
CssClass="w3-bar-item w3-button tab_btn"
Text="<%[ Job schedules ]%>"
OnCallback="loadSchedules"
- CommandParameter="show"
Attributes.onclick="W3Tabs.open(this.id, 'job_schedules'); clear_node('#job_config div.directive_field'); clear_node('#fileset_config div.directive_field'); clear_node('#schedule_config div.directive_field');"
/>
</div>
-<div class="w3-row w3-margin-bottom<%=!$this->display_directive ? ' hide' : '';%>">
+<div class="directive_field w3-row w3-margin-bottom<%=!$this->display_directive ? ' hide' : '';%>">
<div class="w3-col w3-quarter"><com:TActiveLabel ID="Label" ActiveControl.EnableUpdate="false" Visible="<%=$this->display_directive%>" />:</div>
<div class="w3-col w3-threequarter directive_value">
<com:TActiveCheckBox
-<div class="w3-row w3-margin-bottom<%=!$this->display_directive ? ' hide' : '';%>">
+<div class="directive_field w3-row w3-margin-bottom<%=!$this->display_directive ? ' hide' : '';%>">
<div class="w3-col w3-quarter"><com:TActiveLabel ID="Label" ActiveControl.EnableUpdate="false" Visible="<%=$this->display_directive%>" />:</div>
<div class="w3-col w3-threequarter directive_value">
<com:TActiveDropDownList ID="Directive"
-<div class="w3-row w3-margin-bottom<%=!$this->display_directive ? ' hide' : '';%>">
+<div class="directive_field w3-row w3-margin-bottom<%=!$this->display_directive ? ' hide' : '';%>">
<div class="w3-col w3-quarter"><com:TActiveLabel ID="Label" ActiveControl.EnableUpdate="false" Visible="<%=$this->display_directive%>" />:</div>
<div class="w3-col w3-threequarter directive_value">
<com:TActiveTextBox ID="Directive"
-<div class="w3-row w3-margin-bottom<%=!$this->display_directive ? ' hide' : '';%>">
+<div class="directive_field w3-row w3-margin-bottom<%=!$this->display_directive ? ' hide' : '';%>">
<div class="w3-col w3-quarter"><com:TActiveLabel ID="Label" ActiveControl.EnableUpdate="false" Visible="<%=$this->display_directive%>" />:</div>
<div class="w3-col w3-threequarter directive_value">
<com:TActiveListBox ID="Directive"
<com:TActiveRepeater ID="MultiComboBoxRepeater" OnItemDataBound="createMultiComboBoxElement">
<prop:ItemTemplate>
- <div class="w3-row w3-margin-bottom<%=!$this->Data['show'] ? ' hide' : '';%>">
+ <div class="directive_field w3-row w3-margin-bottom<%=!$this->Data['show'] ? ' hide' : '';%>">
<div class="w3-col w3-quarter"><com:TActiveLabel ID="Label" ActiveControl.EnableUpdate="false" />:</div>
<div class="w3-col w3-threequarter directive_value">
<com:TActiveDropDownList ID="Directive"
<com:TActiveRepeater ID="MultiTextBoxRepeater" OnItemDataBound="createMultiTextBoxElement">
<prop:ItemTemplate>
- <div class="w3-row w3-margin-bottom<%=!$this->Data['show'] ? ' hide' : '';%>">
+ <div class="directive_field w3-row w3-margin-bottom<%=!$this->Data['show'] ? ' hide' : '';%>">
<div class="w3-col w3-quarter"><com:TActiveLabel ID="Label" ActiveControl.EnableUpdate="false" />:</div>
<div class="w3-col w3-threequarter directive_value">
<com:TActiveTextBox ID="Directive"
-<div class="w3-row w3-margin-bottom<%=!$this->display_directive ? ' hide' : '';%>">
+<div class="directive_field w3-row w3-margin-bottom<%=!$this->display_directive ? ' hide' : '';%>">
<div class="w3-col w3-quarter"><com:TActiveLabel ID="Label" ActiveControl.EnableUpdate="false" Visible="<%=$this->display_directive%>" />:</div>
<div class="w3-col w3-threequarter directive_value">
<com:TActiveTextBox ID="Directive"
Prado::using('Application.Web.Portlets.DirectiveRunscript');
Prado::using('Application.Web.Portlets.DirectiveMessages');
-class DirectiveRenderer extends DirectiveListTemplate implements IItemDataRenderer {
+class DirectiveRenderer extends DirectiveListTemplate implements IDataRenderer {
const DATA = 'Data';
- const ITEM_INDEX = 'ItemIndex';
private $directive_types = array(
'DirectiveCheckBox',
public function onLoad($param) {
parent::onLoad($param);
+ $this->createItemInternal();
+ }
+
+ public function createItemInternal() {
$data = $this->getData();
- $this->createItem($data);
+ $item = $this->createItem($data);
+
+ $this->addParsedObject($item);
+
+ if ($item instanceof DirectiveTemplate) {
+ $item->createDirective();
+ } elseif ($item instanceof DirectiveListTemplate) {
+ $item->loadConfig(null, null);
+ }
}
public function createItem($data) {
$control->setGroupName($data['group_name']);
$control->setParentName($data['parent_name']);
$control->setResourceNames($this->SourceTemplateControl->getResourceNames());
- $this->getControls()->add($control);
- $control->createDirective();
} elseif (in_array($type, $this->directive_list_types)) {
$control->setHost($data['host']);
$control->setComponentType($data['component_type']);
$control->setShow($data['show']);
$control->setGroupName($data['group_name']);
$control->setResource($data['resource']);
- $this->getControls()->add($control);
- if (!$this->getPage()->IsCallBack || $this->getPage()->getCallbackEventParameter() === 'show_all_directives' || $this->getCmdParam() === 'show') {
- /*
- * List types should be loaded only by load request, not by callback request.
- * Otherwise OnLoad above is called during callback and overwrites data in controls.
- */
- $control->raiseEvent('OnDirectiveListLoad', $this, null);
- }
}
- }
-
- public function getItemIndex() {
- return $this->getViewState(self::ITEM_INDEX, 0);
- }
-
- public function setItemIndex($item_index) {
- $this->setViewState(self::ITEM_INDEX, $item_index);
- }
-
- public function getItemType() {
- }
-
- public function setItemType($item_type) {
+ return $control;
}
public function getData() {
-<div class="w3-row w3-margin-bottom<%=!$this->display_directive ? ' hide' : '';%>">
+<div class="directive_field w3-row w3-margin-bottom<%=!$this->display_directive ? ' hide' : '';%>">
<div class="w3-col w3-quarter"><com:TActiveLabel ID="Label" ActiveControl.EnableUpdate="false" Visible="<%=$this->display_directive%>" />:</div>
<div class="w3-col w3-threequarter directive_value">
<com:TActiveTextBox ID="Directive"
-<div class="w3-row w3-margin-bottom<%=!$this->display_directive ? ' hide' : '';%>">
+<div class="directive_field w3-row w3-margin-bottom<%=!$this->display_directive ? ' hide' : '';%>">
<div class="w3-col w3-quarter"><com:TActiveLabel ID="Label" ActiveControl.EnableUpdate="false" Visible="<%=$this->display_directive%>" />:</div>
<div class="w3-col w3-threequarter directive_value">
<com:TActiveTextBox ID="Directive"
-<div class="w3-row w3-margin-bottom<%=!$this->display_directive ? ' hide' : '';%>">
+<div class="directive_field w3-row w3-margin-bottom<%=!$this->display_directive ? ' hide' : '';%>">
<div class="w3-col w3-quarter"><com:TActiveLabel ID="Label" ActiveControl.EnableUpdate="false" Visible="<%=$this->display_directive%>" />:</div>
<div class="w3-col w3-threequarter directive_value">
<com:TActiveTextBox ID="Directive"
-<div class="w3-row w3-margin-bottom<%=!$this->display_directive ? ' hide' : '';%>">
+<div class="directive_field w3-row w3-margin-bottom<%=!$this->display_directive ? ' hide' : '';%>">
<div class="w3-col w3-quarter"><com:TActiveLabel ID="Label" ActiveControl.EnableUpdate="false" Visible="<%=$this->display_directive%>" />:</div>
<div class="w3-col w3-threequarter directive_value">
<com:TActiveTextBox ID="Directive"
for ($i = 0; $i < count($clients); $i++) {
$client_list[$clients[$i]->clientid] = $clients[$i]->name;
}
- asort($client_list);
- $this->Client->dataSource = $client_list;
+ uksort($client_list, 'sort_client_list');
+ $this->Client->DataSource = $client_list;
$this->Client->dataBind();
}
return $this->getViewState(self::PATH, '/');
}
}
+
+function sort_client_list($a, $b) {
+ if ($a === 'none') {
+ return -1;
+ } else {
+ return strcmp($a, $b);
+ }
+}
?>
<div class="w3-container">
- <div class="w3-container">
+ <div class="directive_field w3-container">
<div class="w3-third"><com:TLabel ForControl="Client" Text="<%[ Client: ]%>" /></div>
<div class="w3-third">
<com:TActiveDropDownList
this.clear_content();
this.clear_includes();
this.path_field.value = '';
- document.getElementById('<%=$this->Client->ClientID%>').value = '';
+ document.getElementById('<%=$this->Client->ClientID%>').value = 'none';
},
ls_items: function(path) {
var dpath;