本文整理汇总了PHP中javascriptMod函数的典型用法代码示例。如果您正苦于以下问题:PHP javascriptMod函数的具体用法?PHP javascriptMod怎么用?PHP javascriptMod使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了javascriptMod函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
public function show()
{
if (\UserStatus::isGuest()) {
return '';
}
$terms = \Term::getTermsAssoc();
$current = \Term::getCurrentTerm();
if (isset($terms[$current])) {
$terms[$current] .= ' (Current)';
}
$form = new \PHPWS_Form('term_selector');
$cmd = \CommandFactory::getCommand('SelectTerm');
$cmd->initForm($form);
$form->addDropBox('term', $terms);
$tags = $form->getTemplate();
$currentTerm = \Term::getSelectedTerm();
$tags['TERM_OPTIONS'] = array();
foreach ($tags['TERM_VALUE'] as $key => $value) {
$selected = '';
if ($key == $currentTerm) {
$selected = 'selected="selected"';
}
$tags['TERM_OPTIONS'][] = array('id' => $key, 'term' => $value, 'selected' => $selected);
}
javascript('jquery');
javascriptMod('hms', 'jqueryCookie');
javascript('modules/hms/SelectTerm');
return \PHPWS_Template::process($tags, 'hms', 'admin/SelectTerm.tpl');
}
示例2: plugInternship
/**
* Loads the form's fields with the internship's information.
* TODO: Use getter methods instead of just accessing Internship member variables directly.
*/
public function plugInternship()
{
$this->plugStudent();
$this->plugDept();
$this->plugFaculty();
$this->plugAgency();
$this->plugInternInfo();
$this->plugCourseInfo();
// We're editing an internship...
// If this internship's term is in the past, then replace the term list with just that term
if (!in_array($this->intern->term, array_keys(Term::getFutureTermsAssoc()))) {
// Remove the term dropdown and repalce it
$this->form->dropElement('term');
$this->form->addSelect('term', array($this->intern->term => Term::rawToRead($this->intern->term)));
$this->form->setLabel('term', 'Select Term');
$this->form->addCssClass('term', 'form-control');
}
$this->form->setMatch('term', $this->intern->term);
$this->form->setMatch('experience_type', $this->intern->getExperienceType());
// Plug
$this->form->plugIn($this->formVals);
/**
* *
* Emergency Contacts
*/
//javascript('jquery');
PHPWS_Core::initModClass('intern', 'EmergencyContactFactory.php');
$contacts = EmergencyContactFactory::getContactsForInternship($this->intern);
$emgContactJson = json_encode($contacts);
Layout::add(javascriptMod('intern', 'emergencyContact', array('existing_contacts_json' => $emgContactJson)));
}
示例3: display
public function display()
{
// permissions...
if (!\Current_User::isDeity()) {
\NQ::simple('intern', NotifyUI::ERROR, 'You cannot edit administrators.');
return false;
}
// set up some stuff for the page template
$tpl = array();
// create the list of admins
$adminList = Admin::getAdminPager();
// get the list of departments
$depts = Department::getDepartmentsAssoc();
// make the form for adding a new admin
$form = new \PHPWS_Form('add_admin');
$form->addSelect('department_id', $depts);
$form->setLabel('department_id', 'Department');
$form->addText('username');
$form->setLabel('username', 'Username');
$form->addCheck('all');
$form->setLabel('all', 'All Departments');
$form->addSubmit('submit', 'Create Admin');
$form->setAction('index.php?module=intern&action=edit_admins');
$form->addHidden('add', 1);
// TODO: Add Javascript autocomplete for usernames.
javascript('jquery');
javascript('jquery_ui');
javascriptMod('intern', 'admin');
$tpl['PAGER'] = $adminList;
$form->mergeTemplate($tpl);
return \PHPWS_Template::process($form->getTemplate(), 'intern', 'edit_admin.tpl');
}
示例4: display
/**
* Returns the proccessed template that will be displayed
* @return template
*/
public function display()
{
$tpl = array();
javascript('jquery');
javascriptMod('appsync', 'organization');
return \PHPWS_Template::process($tpl, 'appsync', 'top.tpl');
}
示例5: render
public function render()
{
$tpl = array();
\javascript('jquery');
\javascriptMod('intern', 'missing');
return \PHPWS_Template::process($tpl, 'intern', 'addInternship.tpl');
}
示例6: show
public function show()
{
$tpl = array();
// Check for an empty array of requests
if (sizeof($this->requests) == 0) {
$tpl['NO_REQUESTS'] = 'No pending requests found.';
return PHPWS_Template::process($tpl, 'hms', 'admin/roomChangeListView.tpl');
}
javascriptMod('hms', 'livestamp');
$tpl['REQUESTS'] = array();
foreach ($this->requests as $request) {
$row = array();
$participants = $request->getParticipants();
$participantNames = array();
foreach ($participants as $p) {
$student = StudentFactory::getStudentByBannerId($p->getBannerId(), $this->term);
$participantNames[] = $student->getName();
}
$row['participants'] = implode(', ', $participantNames);
$mgmtCmd = CommandFactory::getCommand('ShowManageRoomChange');
$mgmtCmd->setRequestId($request->getId());
$row['manage'] = $mgmtCmd->getURI();
$row['last_updated_timestamp'] = $request->getLastUpdatedTimestamp();
$row['last_updated_date'] = date("M j @ g:ia", $request->getLastUpdatedTimestamp());
$tpl['REQUESTS'][] = $row;
}
return PHPWS_Template::process($tpl, 'hms', 'admin/roomChangeListView.tpl');
}
示例7: display
/**
* (non-PHPdoc)
* @see UI::display()
*/
public function display()
{
// Get the list of departments the current user has access to
$departments = Department::getDepartmentsAssocForUsername(\Current_User::getUsername());
$renderedDepts = '';
foreach ($departments as $key => $val) {
$renderedDepts .= \PHPWS_Template::process(array('ID' => $key, 'DEPT' => $val), 'intern', 'facultySelectOption.tpl');
}
$tpl = array();
$tpl['FACULTY_EDIT'] = javascriptMod('intern', 'facultyEdit', array('DEPTS' => $renderedDepts));
return \PHPWS_Template::process($tpl, 'intern', 'editFaculty.tpl');
}
示例8: edit
/**
* @param boolean limited If true, use anonymous submission form
*/
public static function edit(Blog $blog, $version_id = NULL, $limited = false)
{
javascriptMod('blog', 'image_url');
if ($limited) {
throw new \Exception('');
}
$form = new PHPWS_Form('edit-blog');
$form->addHidden('module', 'blog');
$form->addHidden('action', 'admin');
$form->addHidden('command', 'post_entry');
if ($blog->id) {
$form->addHidden('blog_id', $blog->id);
$form->addSubmit('submit', dgettext('blog', 'Update entry'));
} else {
$form->addSubmit('submit', dgettext('blog', 'Add entry'));
}
$link_choices['none'] = dgettext('blog', 'No link and ignore image link setting');
$link_choices['default'] = dgettext('blog', 'No link but allow image link setting');
$link_choices['readmore'] = dgettext('blog', 'Link to read more');
$link_choices['parent'] = dgettext('blog', 'Link resized image to parent');
$link_choices['url'] = dgettext('blog', 'Link the url below');
$form->addText('title', $blog->title);
$form->setSize('title', 40);
$form->setLabel('title', dgettext('blog', 'Title'));
$form->setRequired('title');
$form->addTextArea('summary', $blog->getSummaryAndEntry(false));
if (!$limited) {
$form->useEditor('summary');
}
$form->setRows('summary', '10');
$form->setCols('summary', '60');
$form->setLabel('summary', dgettext('blog', 'Content'));
javascript('datetimepicker', null, false, true, true);
$form->addText('publish_date', $blog->getPublishDate('%Y/%m/%d %H:%M'));
$form->setLabel('publish_date', dgettext('blog', 'Publish date/time'));
$form->setSize('publish_date', 20);
$form->setClass('publish_date', 'datetimepicker');
$form->addText('expire_date', $blog->getExpireDate());
$form->setLabel('expire_date', dgettext('blog', 'Expire date/time'));
$form->setSize('expire_date', 20);
$form->setClass('expire_date', 'datetimepicker');
$template = $form->getTemplate();
$jscal['date_name'] = 'expire_date';
$template['EXAMPLE'] = 'YYYY/MM/DD HH:MM';
if ($blog->_error) {
$template['MESSAGE'] = implode('<br />', $blog->_error);
}
$template['REMINDER'] = dgettext('blog', 'Add a horizontal rule to separate content into summary and body');
return PHPWS_Template::process($template, 'blog', 'edit.tpl');
}
示例9: show
/**
* Main method for creating the view
*/
public function show()
{
javascript('jquery');
javascript('jquery_ui');
javascriptMod('hms', 'jqueryCookie');
//javascriptMod('packageDesk');
Layout::addPageTitle('Package Desk');
$form = new PHPWS_Form('pd');
// Package desk drop down
$form->addDropBox('desk', array('Select a Package Desk...') + $this->packageDesks);
$form->setLabel('desk', 'Package Desk');
$form->addHidden('desk_hidden');
$tpl = $form->getTemplate();
return PHPWS_Template::process($tpl, 'hms', 'admin/packageDesk.tpl');
}
示例10: display
public static function display()
{
javascriptMod('intern', 'pick_state');
$db = new PHPWS_DB('intern_state');
$db->addOrder('full_name');
$states = $db->select();
foreach ($states as $state) {
extract($state);
//abbr, full_name, active
$row = array('ABBR' => $abbr, 'NAME' => $full_name);
if (!$active) {
$tpl['state_row'][] = $row;
} else {
$tpl['active_row'][] = $row;
}
}
return PHPWS_Template::process($tpl, 'intern', 'state_list.tpl');
}
示例11: display
public static function display()
{
/* Permission check */
if (!Current_User::allow('intern', Department::getEditPermission())) {
NQ::simple('intern', INTERN_ERROR, "Uh Uh Uh! You didn't say the magic word!");
return;
}
javascript('/jquery/');
javascriptMod('intern', 'editMajor', array('EDIT_ACTION' => Department::getEditAction()));
// Form for adding new department
$form = new PHPWS_Form('add_department');
$form->addText('name');
$form->setLabel('name', 'Department Name');
$form->addSubmit('submit', 'Add Department');
$form->setAction('index.php?module=intern&action=' . DEPT_EDIT);
$form->addHidden('add', TRUE);
$tpl['PAGER'] = DepartmentUI::doPager();
$form->mergeTemplate($tpl);
return PHPWS_Template::process($form->getTemplate(), 'intern', 'edit_department.tpl');
}
示例12: display
public function display()
{
/* Permission check */
if (!\Current_User::allow('intern', Department::getEditPermission())) {
\NQ::simple('intern', NotifyUI::ERROR, "You do not have permission to edit departments.");
return;
}
javascript('/jquery/');
javascriptMod('intern', 'editMajor', array('EDIT_ACTION' => Department::getEditAction()));
// Form for adding new department
$form = new \PHPWS_Form('add_department');
$form->addText('name');
$form->setLabel('name', 'Department Name');
$form->addSubmit('submit', 'Add Department');
$form->setAction('index.php?module=intern&action=edit_dept');
$form->addHidden('add', TRUE);
$tpl['PAGER'] = DepartmentUI::doPager();
$form->mergeTemplate($tpl);
return \PHPWS_Template::process($form->getTemplate(), 'intern', 'edit_department.tpl');
}
示例13: display
public function display()
{
/* Check if user can add/edit/hide/delete majors. */
if (!\Current_User::allow('intern', 'edit_major') && !\Current_User::allow('intern', 'delete_major')) {
\NQ::simple('intern', NotifyUI::WARNING, 'You do not have permission to edit undergraduate majors.');
return false;
}
$tpl['PAGER'] = MajorUI::doPager();
javascript('/jquery/');
javascriptMod('intern', 'editMajor', array('EDIT_ACTION' => Major::getEditAction()));
/* Form for adding new major */
$form = new \PHPWS_Form('add_major');
$form->addText('name');
$form->setLabel('name', 'Major Title');
$form->addSubmit('submit', 'Add Major');
$form->setAction('index.php?module=intern&action=edit_major');
$form->addHidden('add', TRUE);
$form->mergeTemplate($tpl);
return \PHPWS_Template::process($form->getTemplate(), 'intern', 'edit_major.tpl');
}
示例14: display
public static function display()
{
/* Check if user can add/edit/hide/delete grad programs. */
if (!Current_User::allow('intern', 'edit_grad_prog') && !Current_User::allow('intern', 'delete_grad_prog')) {
NQ::simple('intern', INTERN_WARNING, 'You do not have permission to edit graduate programs.');
return false;
}
$tpl['PAGER'] = self::doPager();
javascript('/jquery/');
javascriptMod('intern', 'editMajor', array('EDIT_ACTION' => GradProgram::getEditAction()));
/* Form for adding new grad program */
$form = new PHPWS_Form('add_prog');
$form->addText('name');
$form->setLabel('name', 'Graduate Program Title');
$form->addSubmit('submit', 'Add Graduate Program');
$form->setAction('index.php?module=intern&action=edit_grad');
$form->addHidden('add', TRUE);
$form->mergeTemplate($tpl);
return PHPWS_Template::process($form->getTemplate(), 'intern', 'edit_grad.tpl');
}
示例15: show
public function show()
{
javascript('jquery');
javascript('jquery_ui');
javascript('select2');
javascriptMod('hms', 'jqueryCookie');
javascriptMod('hms', 'checkinStart');
Layout::addPageTitle('Check-in');
$tpl = array();
$form = new PHPWS_Form('checkin_form');
$submitCmd = CommandFactory::getCommand('StartCheckinSubmit');
$submitCmd->initForm($form);
$form->addDropbox('residence_hall', array(0 => 'Select a hall..') + $this->halls);
$form->setLabel('residence_hall', 'Residence Hall');
$form->addCssClass('residence_hall', 'form-control');
if (count($this->halls) == 1) {
$keys = array_keys($this->halls);
$form->addHidden('residence_hall_hidden', $keys[0]);
setcookie('hms-checkin-hall-id', $keys[0]);
// Force the hall selection cookie to the one hall this user has
setcookie('hms-checkin-hall-name', $this->halls[$keys[0]]);
} else {
$form->addHidden('residence_hall_hidden');
}
$form->addText('banner_id');
$form->setLabel('banner_id', 'Resident');
$form->setExtra('banner_id', 'placeholder = "Swipe AppCard or type Name/Email/Banner ID"');
$form->addCssClass('banner_id', 'form-control');
$form->addCssClass('banner_id', 'input-lg');
$form->addCssClass('banner_id', 'typeahead');
$form->addSubmit('Begin Check-in');
$form->setClass('submit', 'btn btn-lg btn-primary');
$form->mergeTemplate($tpl);
$tpl = $form->getTemplate();
return PHPWS_Template::process($tpl, 'hms', 'admin/checkinStart.tpl');
}