本文整理汇总了PHP中Kit::SelectList方法的典型用法代码示例。如果您正苦于以下问题:PHP Kit::SelectList方法的具体用法?PHP Kit::SelectList怎么用?PHP Kit::SelectList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kit
的用法示例。
在下文中一共展示了Kit::SelectList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ScheduleNowForm
public function ScheduleNowForm()
{
$db =& $this->db;
$user =& $this->user;
$response = new ResponseManager();
$date = time();
$dateText = date("d/m/Y", $date);
// We might have a layout id, or a display id
$campaignId = Kit::GetParam('CampaignID', _GET, _INT, 0);
$displayGroupIds = Kit::GetParam('displayGroupId', _GET, _ARRAY);
// Layout list
$layouts = $user->CampaignList();
$layoutList = Kit::SelectList('CampaignID', $layouts, 'campaignid', 'campaign', $campaignId);
$outputForm = false;
$displayList = $this->UnorderedListofDisplays($outputForm, $displayGroupIds);
$token = Kit::Token();
$form = <<<END
<form id="ScheduleNowForm" class="XiboForm" action="index.php?p=schedule&q=ScheduleNow" method="post">
{$token}
<table style="width:100%;">
<tr>
<td><label for="duration" title="How long should this event be scheduled for">Duration<span class="required">*</span></label></td>
<td>H: <input type="text" name="hours" id="hours" size="2" class="number span1">
M: <input type="text" name="minutes" id="minutes" size="2" class="number span1">
S: <input type="text" name="seconds" id="seconds" size="2" class="number span1"></td>
</tr>
<tr>
<td><label for="CampaignID" title="Select which layout this event will show.">Campaign/Layout<span class="required">*</span></label></td>
<td>{$layoutList}</td>
</tr>
<tr>
<td><label for="DisplayOrder" title="Select the Order for this Event">Display Order</label></td>
<td><input type=text" name="DisplayOrder" value="0" />
</tr>
<tr>
<td><label title="Sets whether or not this event has priority. If set the event will be show in preference to other events." for="cb_is_priority">Priority</label></td>
<td><input type="checkbox" id="cb_is_priority" name="is_priority" value="1" title="Sets whether or not this event has priority. If set the event will be show in preference to other events."></td>
</tr>
<tr>
<td>
<div class="FormDisplayList">
{$displayList}
</div>
</td>
</tr>
</table>
</form>
END;
$response->SetFormRequestResponse($form, __('Schedule Now'), '700px', '400px');
$response->AddButton(__('Help'), "XiboHelpRender('index.php?p=help&q=Display&Topic=Schedule&Category=ScheduleNow')");
$response->AddButton(__('Cancel'), 'XiboDialogClose()');
$response->AddButton(__('Save'), '$("#ScheduleNowForm").submit()');
$response->Respond();
}
示例2: TransitionEditForm
/**
* Form to Edit a transition
*/
public function TransitionEditForm()
{
if (!$this->auth->edit) {
$this->response->SetError('You do not have permission to edit this media.');
$this->response->keepOpen = false;
return $this->response;
}
// Are we dealing with an IN or an OUT
$type = Kit::GetParam('type', _REQUEST, _WORD);
switch ($type) {
case 'in':
$transition = $this->GetOption('transIn');
$duration = $this->GetOption('transInDuration', 0);
$direction = $this->GetOption('transInDirection');
break;
case 'out':
$transition = $this->GetOption('transOut');
$duration = $this->GetOption('transOutDuration', 0);
$direction = $this->GetOption('transOutDirection');
break;
default:
trigger_error(_('Unknown transition type'), E_USER_ERROR);
}
// Add none to the list
$transitions = $this->user->TransitionAuth($type);
$transitions[] = array('code' => '', 'transition' => 'None', 'class' => '');
// Prepare a list of options
$transitionDropdown = Kit::SelectList('transitionType', $transitions, 'code', 'transition', $transition, '', 'class');
// Compass points for direction
$compassPoints = array(array('id' => 'N', 'name' => __('North')), array('id' => 'NE', 'name' => __('North East')), array('id' => 'E', 'name' => __('East')), array('id' => 'SE', 'name' => __('South East')), array('id' => 'S', 'name' => __('South')), array('id' => 'SW', 'name' => __('South West')), array('id' => 'W', 'name' => __('West')), array('id' => 'NW', 'name' => __('North West')));
// Prepare a list of compass points
$directionDropdown = Kit::SelectList('transitionDirection', $compassPoints, 'id', 'name', $direction);
// Some messages for the form
$msgTransition = __('What transition should be applied to this media item?');
$msgDuration = __('The duration for this transition, in milliseconds.');
$msgDirection = __('The direction for this transition.');
// Construct the form
$form = <<<END
<form id="TransitionForm" class="XiboTextForm" method="post" action="index.php?p=module&mod={$this->type}&q=Exec&method=TransitionEdit">
<input type="hidden" name="type" value="{$type}">
<input type="hidden" name="layoutid" value="{$this->layoutid}">
<input type="hidden" name="mediaid" value="{$this->mediaid}">
<input type="hidden" name="lkid" value="{$this->lkid}">
<input type="hidden" id="iRegionId" name="regionid" value="{$this->regionid}">
<input type="hidden" name="showRegionOptions" value="{$this->showRegionOptions}" />
<table>
<tr>
<td><label for="tranisitionType" title="{$msgTransition}">{$msgTransition}</label></td>
<td>{$transitionDropdown}</td>
</tr>
<tr class="transitionDuration">
<td><label for="transitionDuration">{$msgDuration}</label></td>
<td><input type="text" class="numeric" name="transitionDuration" id="transitionDuration" value="{$duration}" /></td>
</tr>
<tr class="transitionDirection">
<td><label for="transitionDirection">{$msgDirection}</label></td>
<td>{$directionDropdown}</td>
</tr>
</table>
</form>
END;
// Decide where the cancel button will take us
if ($this->showRegionOptions) {
$this->response->AddButton(__('Cancel'), 'XiboSwapDialog("index.php?p=timeline&layoutid=' . $this->layoutid . '®ionid=' . $this->regionid . '&q=RegionOptions")');
} else {
$this->response->AddButton(__('Cancel'), 'XiboDialogClose()');
}
// Always include the save button
$this->response->AddButton(__('Save'), '$("#TransitionForm").submit()');
// Output the form and dialog
$this->response->html = $form;
$this->response->callBack = 'transitionFormLoad';
$this->response->dialogTitle = 'Edit ' . $type . ' Transition for ' . $this->displayType;
$this->response->dialogSize = true;
$this->response->dialogWidth = '450px';
$this->response->dialogHeight = '280px';
return $this->response;
}