Exemple #1
0
    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();
    }
Exemple #2
0
    /**
     * 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 . '&regionid=' . $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;
    }