本文整理汇总了PHP中javascript函数的典型用法代码示例。如果您正苦于以下问题:PHP javascript函数的具体用法?PHP javascript怎么用?PHP javascript使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了javascript函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: miniadmin
public static function miniadmin()
{
if (!Current_User::allow('menu')) {
return;
}
// Default link. Takes user to menu admin screen
MiniAdmin::add('menu', \PHPWS_Text::secureLink('<span class="fa fa-cog"></span> Administrate menus', 'menu', array('command' => 'list')));
$key = \Key::getCurrent();
$link_list = self::getLinkList();
if ($key && !$key->isDummy(true)) {
javascript('jquery');
\Layout::addJSHeader('<script type="text/javascript" src="' . PHPWS_SOURCE_HTTP . 'mod/menu/javascript/administrate/minilink.js"></script>');
$found = false;
$used_menus = array();
foreach ($link_list as $link) {
$menu_id = 0;
extract($link);
if ($key_id == $key->id) {
if (!in_array($menu_id, $used_menus)) {
$used_menus[] = $menu_id;
MiniAdmin::add('menu', '<a href="javascript:void(0)" data-key-id="' . $key->id . '" data-menu-id="' . $menu_id . '" id="menu-remove-page"><span class="fa fa-times"></span> ' . t('Remove from %s', $menu_title) . '</a>');
$found = true;
}
}
}
if (!$found) {
self::miniadminAddMenu($key);
}
self::miniadminPinMenu($key);
self::miniadminUnpin($key);
}
}
示例2: show
public function show()
{
$tpl = array();
if ($this->halls == NULL) {
NQ::simple('hms', hms\NotificationView::ERROR, 'There are no halls available for the selected term.');
$cmd = CommandFactory::getCommand('ShowAdminMaintenanceMenu');
$cmd->redirect();
}
$tpl['TITLE'] = $this->title;
$tpl['TERM'] = Term::getPrintableSelectedTerm();
javascript('jquery');
javascript('modules/hms/select_floor');
# Setup the form
$form = new PHPWS_Form();
$this->onSelectCmd->initForm($form);
$form->setMethod('get');
$form->addDropBox('residence_hall', $this->halls);
$form->setLabel('residence_hall', 'Residence hall');
$form->setMatch('residence_hall', 0);
$form->setClass('residence_hall', 'form-control');
$form->addDropBox('floor', array(0 => ''));
$form->setLabel('floor', 'Floor');
$form->setClass('floor', 'form-control');
$form->addSubmit('submit_button', 'Select');
$form->mergeTemplate($tpl);
$tpl = $form->getTemplate();
Layout::addPageTitle("Select Floor");
return PHPWS_Template::process($tpl, 'hms', 'admin/select_floor.tpl');
}
示例3: show
public function show()
{
PHPWS_Core::initCoreClass('Form.php');
javascript('jquery');
javascript('modules/hms/assign_student');
$unassignCmd = CommandFactory::getCommand('UnassignStudent');
$form = new PHPWS_Form();
$unassignCmd->initForm($form);
$form->addText('username');
if (!is_null($this->student)) {
$form->setValue('username', $this->student->getUsername());
}
$form->addCssClass('username', 'form-control');
$form->setExtra('username', 'autofocus');
// Addition of "Unassignment Type"
$form->addDropBox('unassignment_type', array('-1' => 'Choose a reason...', UNASSIGN_ADMIN => 'Administrative', UNASSIGN_REASSIGN => 'Re-assign', UNASSIGN_CANCEL => 'Contract Cancellation', UNASSIGN_PRE_SPRING => 'Pre-spring room change', UNASSIGN_RELEASE => 'Contract Release'));
//$form->setMatch('unassignment_type', UNASSIGN_ADMIN);
$form->setLabel('unassignment_type', 'Unassignment Type: ');
$form->addCssClass('unassignment_type', 'form-control');
$form->addText('refund');
$form->setLabel('refund', 'Refund Percentage');
$form->setSize('refund', 4);
$form->setMaxSize('refund', 3);
$form->addCssClass('refund', 'form-control');
$form->addTextarea('note');
$form->setLabel('note', 'Note: ');
$form->addCssClass('note', 'form-control');
$tpl = $form->getTemplate();
$tpl['TERM'] = Term::getPrintableSelectedTerm();
Layout::addPageTitle("Unassign Student");
return PHPWS_Template::process($tpl, 'hms', 'admin/unassignStudent.tpl');
}
示例4: show
public function show()
{
PHPWS_Core::initModClass('hms', 'HMS_Lottery.php');
PHPWS_Core::initModClass('hms', 'LotteryApplication.php');
$this->setTitle('Special Interest Group');
javascript('jquery');
$tpl = array();
$groups = HMS_Lottery::getSpecialInterestGroupsMap();
// If a group was selected
if (!is_null($this->group) && $this->group != 'none') {
$tpl['GROUP_PAGER'] = LotteryApplication::specialInterestPager($this->group, PHPWS_Settings::get('hms', 'lottery_term'));
$tpl['GROUP'] = $groups[$this->group];
}
// Show the drop down box of groups
$form = new PHPWS_Form('special_interest');
$form->setMethod('get');
$form->addDropBox('group', $groups);
$form->setClass('group', 'form-control');
$form->setMatch('group', $this->group);
$cmd = CommandFactory::getCommand('ShowSpecialInterestGroupApproval');
$cmd->initForm($form);
$form->mergeTemplate($tpl);
$tpl = $form->getTemplate();
return PHPWS_Template::process($tpl, 'hms', 'admin/special_interest_approval.tpl');
}
示例5: 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');
}
示例6: edit
public function edit($id)
{
try {
$result = $this->users->read_user_work_experience_by_id($this->user->id, $id);
} catch (Exception $e) {
$this->set_alert_message('Error', $e->getMessage());
}
$fields = $this->fields;
if ($result->result_id->num_rows > 0) {
$fields = $result->row_array();
if ($fields['is_present'] == 1) {
$fields['month_to'] = 'Present';
}
} else {
}
$post = $this->input->post();
if (is_array($post) === true && count($post) > 1) {
$fields = $post;
}
$this->js_header = javascript(array('angular.min'));
$this->js_footer = javascript(array('work_experiences'));
$this->data['form_data'] = set_form_json_data($fields);
$this->data['id'] = $id;
$this->render($this->_role . '/work_experience_edit', array());
}
示例7: 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');
}
示例8: form
public static function form(\Request $request, $active_tab)
{
javascript('jquery');
\Form::requiredScript();
if (!in_array($active_tab, array('contact-info', 'map', 'social'))) {
$active_tab = 'contact-info';
}
$thumbnail_map = \Settings::get('contact', 'thumbnail_map');
$contact_info = self::load();
$values = self::getValues($contact_info);
require PHPWS_SOURCE_DIR . 'mod/contact/config/states.php';
$values['states'] =& $states;
if (!empty($thumbnail_map)) {
$values['thumbnail_map'] = "<img src='{$thumbnail_map}' />";
} else {
$values['thumbnail_map'] = null;
}
$js_social_links = ContactInfo\Social::getLinksAsJavascriptObject($values['social']);
$js_string = <<<EOF
<script type='text/javascript'>var active_tab = '{$active_tab}';var thumbnail_map = '{$thumbnail_map}';var social_urls = {$js_social_links};</script>
EOF;
\Layout::addJSHeader($js_string);
$script = PHPWS_SOURCE_HTTP . 'mod/contact/javascript/contact.js';
\Layout::addJSHeader("<script type='text/javascript' src='{$script}'></script>");
\Layout::addJSHeader('<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>');
$template = new \Template($values);
$template->setModuleTemplate('contact', 'Contact_Info_Form.html');
return $template->get();
}
示例9: render
public function render()
{
$tpl = array();
\javascript('jquery');
\javascriptMod('intern', 'missing');
return \PHPWS_Template::process($tpl, 'intern', 'addInternship.tpl');
}
示例10: 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');
}
示例11: getFilters
/**
* Generates a template for the rlc sort dropdown box
*
* @return string HTML for community selector drop down
*/
public function getFilters()
{
javascript('jquery');
javascript('modules/hms/page_refresh');
// Get the list of communities
$communities = RlcFactory::getRlcList($this->term);
$communityList = array('0' => 'All');
foreach ($communities as $key => $val) {
$communityList[$key] = $val;
}
// Initialize form and submit command
$submitCmd = CommandFactory::getCommand('ShowAssignRlcApplicants');
$form = new PHPWS_Form('dropdown_selector');
$submitCmd->initForm($form);
$form->setMethod('get');
// Community drop down
$form->addSelect('rlc', $communityList);
if (isset($this->rlc) && !is_null($this->rlc)) {
$form->setMatch('rlc', $this->rlc->getId());
}
$form->setClass('rlc', 'form-control');
$form->setExtra('rlc', 'onChange="refresh_page(\'dropdown_selector\')"');
// Student Type drop down
$form->addSelect('student_type', array(0 => 'All', TYPE_CONTINUING => 'Continuing', TYPE_FRESHMEN => 'Freshmen'));
if (isset($this->studentType)) {
$form->setMatch('student_type', $this->studentType);
}
$form->setClass('student_type', 'form-control');
$form->setExtra('student_type', 'onChange="refresh_page(\'dropdown_selector\')"');
return PHPWS_Template::process($form->getTemplate(), 'hms', 'admin/rlcApplicationListFilters.tpl');
}
示例12: form
public static function form(\Request $request, $command = null)
{
javascript('jquery');
\Form::requiredScript();
if (empty($command)) {
$command = 'run_search';
}
$system_locations = \systemsinventory\Factory\SystemDevice::getSystemLocations();
$location_options = '<option value="0">All</opton>';
foreach ($system_locations as $val) {
$location_options .= '<option value="' . $val['id'] . '">' . $val['display_name'] . '</option>';
}
$vars['locations'] = $location_options;
$system_types = \systemsinventory\Factory\SystemDevice::getSystemTypes();
$type_options = '<option value="0">All</opton>';
foreach ($system_types as $val) {
$type_options .= '<option value="' . $val['id'] . '">' . $val['description'] . '</option>';
}
$vars['system_types'] = $type_options;
$system_dep = \systemsinventory\Factory\SystemDevice::getSystemDepartments();
$dep_optons = '<option value="0">All</opton>';
foreach ($system_dep as $val) {
$dep_optons .= '<option value="' . $val['id'] . '">' . $val['display_name'] . '</option>';
}
$vars['departments'] = $dep_optons;
$vars['form_action'] = "./systemsinventory/search/" . $command;
$template = new \Template($vars);
$template->setModuleTemplate('systemsinventory', 'Search_System.html');
return $template->get();
}
示例13: show
public function show()
{
javascript('jquery');
$home_http = PHPWS_SOURCE_HTTP;
/**
* Uncomment below for DEVELOPMENT
* Comment out for PRODUCTION
*/
// Layout::addJSHeader("<script src='{$home_http}mod/hms/javascript/react/build/react.js'></script>");
// Layout::addJSHeader("<script src='{$home_http}mod/hms/javascript/react/build/JSXTransformer.js'></script>");
// Layout::addJSHeader("<script type='text/jsx' src='{$home_http}mod/hms/javascript/AssignByFloor/src/AssignByFloor.jsx'></script>");
/**
* Uncomment below for PRODUCTION
* Comment out for DEVELOPMENT
*/
Layout::addJSHeader("<script src='{$home_http}mod/hms/javascript/react/build/react.min.js'></script>");
Layout::addJSHeader("<script src='{$home_http}mod/hms/javascript/AssignByFloor/build/AssignByFloor.js'></script>");
/**
* Remainder of code is untouched regardless of development status
*/
Layout::addJSHeader("<script type='text/javascript'>var sourceHttp = '{$home_http}';</script>");
ob_start();
include PHPWS_HOME_HTTP . 'mod/hms/templates/admin/AssignByFloor.html';
return ob_get_clean();
}
示例14: mylist
public function mylist($offset = 0)
{
$vacancies = '';
try {
if ((int) $offset == 0) {
$offset = (int) $this->uri->segment(3);
}
$this->load->library('pagination');
$config = array();
$this->keyword = $this->get_filters();
$config['base_url'] = base_url('vacancies/mylist/');
$config['total_rows'] = (int) $this->vacancies->read_by_public($this->keyword, 5, 0, true);
$config['per_page'] = PUBLIC_LIST_LIMIT;
$config = array_merge($this->miscellaneous->pagination_config(), $config);
$this->pagination->initialize($config);
$vacancies = $this->vacancies->read_by_public($this->keyword, PUBLIC_LIST_LIMIT, $offset, false, $this->_sort, $this->order);
} catch (Exception $e) {
$this->set_alert_message('warning', $e->getMessage());
}
$data = array('vacancies' => $vacancies, 'pagination' => $this->pagination->create_links());
$data['form_data'] = json_encode($this->keyword);
$this->js_header = javascript(array('angular.min', 'constants'));
$this->js_footer = javascript(array('public_vacancy'));
$this->render('public/vacancy_list', $data);
}
示例15: test
public function test()
{
$this->js_header = javascript(array_merge(array('angular.min'), $this->ng_materials()));
$this->js_footer = javascript(array('test'));
$this->main_ng_switch = 'Off';
$this->css_header = css(array('angular-material.min'));
$this->render('public/test', array());
}