当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPWS_Settings::get方法代码示例

本文整理汇总了PHP中PHPWS_Settings::get方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPWS_Settings::get方法的具体用法?PHP PHPWS_Settings::get怎么用?PHP PHPWS_Settings::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPWS_Settings的用法示例。


在下文中一共展示了PHPWS_Settings::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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');
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:25,代码来源:SpecialInterestGroupView.php

示例2: show

 public function show()
 {
     PHPWS_Core::initModClass('hms', 'HMS_Lottery.php');
     $tpl = array();
     $form = new PHPWS_Form();
     $submitCmd = CommandFactory::getCommand('LotterySettingsSubmit');
     $submitCmd->initForm($form);
     $form->addDropBox('lottery_term', Term::getTermsAssoc());
     $form->setMatch('lottery_term', PHPWS_Settings::get('hms', 'lottery_term'));
     $form->setLabel('lottery_term', 'Lottery Term');
     $form->setClass('lottery_term', 'form-control');
     $form->addText('hard_cap');
     $form->setLabel('hard_cap', 'Max # Returning Students (hard cap):');
     $form->setValue('hard_cap', PHPWS_Settings::get('hms', 'lottery_hard_cap'));
     $form->setClass('hard_cap', 'form-control');
     /*
     $form->addText('soph_goal');
     $form->setLabel('soph_goal', 'Sophomores:');
     $form->setValue('soph_goal', PHPWS_Settings::get('hms', 'lottery_soph_goal'));
     */
     $form->addText('jr_goal');
     $form->setLabel('jr_goal', 'Juniors:');
     $form->setValue('jr_goal', PHPWS_Settings::get('hms', 'lottery_jr_goal'));
     $form->setClass('jr_goal', 'form-control');
     $form->addText('sr_goal');
     $form->setLabel('sr_goal', 'Senior:');
     $form->setValue('sr_goal', PHPWS_Settings::get('hms', 'lottery_sr_goal'));
     $form->setClass('sr_goal', 'form-control');
     $form->addSubmit('submit', 'Save');
     $form->mergeTemplate($tpl);
     Layout::addPageTitle("Lottery Settings");
     return PHPWS_Template::process($form->getTemplate(), 'hms', 'admin/lottery_settings.tpl');
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:33,代码来源:LotterySettingsFormView.php

示例3: searchBox

 public static function searchBox()
 {
     if (SEARCH_DEFAULT) {
         $onclick = sprintf('onclick="if(this.value == \'%s\')this.value = \'\';"', SEARCH_DEFAULT);
     }
     PHPWS_Core::initCoreClass('Form.php');
     $form = new PHPWS_Form('search_box');
     $form->setProtected(false);
     $form->setMethod('get');
     $form->addHidden('module', 'search');
     $form->addHidden('user', 'search');
     $form->addText('search', SEARCH_DEFAULT);
     $form->setLabel('search', dgettext('search', 'Search'));
     if (PHPWS_Settings::get('search', 'show_alternates')) {
         Search_User::addAlternates($form);
     }
     if (isset($onclick)) {
         $form->setExtra('search', $onclick);
     }
     $form->addSubmit('go', dgettext('search', 'Search'));
     $mod_list = Search_User::getModList();
     $form->addSelect('mod_title', $mod_list);
     $key = Key::getCurrent();
     if (!empty($key) && !$key->isDummy()) {
         $form->setMatch('mod_title', $key->module);
     } elseif (isset($_REQUEST['mod_title'])) {
         $form->setMatch('mod_title', $_REQUEST['mod_title']);
     }
     $template = $form->getTemplate();
     $content = PHPWS_Template::process($template, 'search', 'search_box.tpl');
     Layout::add($content, 'search', 'search_box');
 }
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:32,代码来源:User.php

示例4: getVotingData

 private function getVotingData()
 {
     $election = Factory::getCurrent();
     // If there's no election going on, then return empty data
     if (empty($election)) {
         return array('hasVoted' => false, 'election' => null, 'single' => array(), 'multiple' => array(), 'referendum' => array(), 'unqualified' => array());
     }
     // Check if student has voted already
     $hasVoted = $this->student->hasVoted($election['id']);
     // If already voted, return minimal voting info
     if ($hasVoted) {
         return array('hasVoted' => true, 'election' => $election, 'single' => array(), 'multiple' => array(), 'referendum' => array(), 'unqualified' => array());
     }
     // Assemble the voting data
     $single = \election\Factory\Single::getListWithTickets($election['id']);
     $multiple = \election\Factory\Multiple::getListWithCandidates($election['id']);
     if (!empty($multiple)) {
         $unqualified = \election\Factory\Multiple::filter($multiple, $this->student);
     } else {
         $unqualified = array();
     }
     $referendum = \election\Factory\Referendum::getList($election['id']);
     $voting_data = array('hasVoted' => false, 'election' => $election, 'single' => $single, 'multiple' => $multiple, 'referendum' => $referendum, 'unqualified' => $unqualified, 'supportLink' => \PHPWS_Settings::get('election', 'supportLink'));
     return $voting_data;
 }
开发者ID:AppStateESS,项目名称:election,代码行数:25,代码来源:Election.php

示例5: getMenuBlockView

 public function getMenuBlockView(Student $student)
 {
     PHPWS_Core::initModClass('hms', 'ReapplicationWaitingListMenuBlockView.php');
     PHPWS_Core::initModClass('hms', 'HousingApplication.php');
     $term = PHPWS_Settings::get('hms', 'lottery_term');
     $application = HousingApplication::getApplicationByUser(UserStatus::getUsername(), $term, 'lottery');
     return new ReapplicationWaitingListMenuBlockView($this->term, $this->getStartDate(), $this->getEndDate(), $application);
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:8,代码来源:ReappWaitingList.php

示例6: __construct

 /**
  * @param string $currentUserName - Username of the user currently logged in. Will be sent to web service
  */
 public function __construct($currentUserName)
 {
     $this->currentUserName = $currentUserName;
     // Get the WSDL URI from module's settings
     $wsdlUri = \PHPWS_Settings::get('intern', 'wsdlUri');
     // Create the SOAP instance
     $this->client = new \SoapClient($wsdlUri, array('WSDL_CACHE_MEMORY'));
 }
开发者ID:jlbooker,项目名称:InternshipInventory,代码行数:11,代码来源:BannerStudentProvider.php

示例7: propertiesLoginLink

function propertiesLoginLink()
{
    $login = \PHPWS_Settings::get('properties', 'login_link');
    if (empty($login)) {
        $login = './admin';
    }
    return $login;
}
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:8,代码来源:init.php

示例8: __construct

 public function __construct()
 {
     $this->apiUrl = \PHPWS_Settings::get('election', 'studentOrgApiUrl');
     if (is_null($this->apiUrl)) {
         throw new \InvalidArgumentException('Student org API url is not configured.');
     }
     // Create a Guzzle instance
     $this->client = new Client($this->apiUrl, array('request.options' => array('verify' => false)));
 }
开发者ID:AppStateESS,项目名称:election,代码行数:9,代码来源:ClubCategoriesProvider.php

示例9: execute

 public function execute(CommandContext $context)
 {
     PHPWS_Core::initModClass('hms', 'HousingApplication.php');
     PHPWS_Core::initModClass('hms', 'StudentFactory.php');
     PHPWS_Core::initModClass('hms', 'RlcMembershipFactory.php');
     PHPWS_Core::initModClass('hms', 'RlcAssignmentSelfAssignedState.php');
     $requestId = $context->get('requestId');
     $mealPlan = $context->get('mealPlan');
     $errorCmd = CommandFactory::getCommand('LotteryShowConfirmRoommateRequest');
     $errorCmd->setRequestId($requestId);
     $errorCmd->setMealPlan($mealPlan);
     // Confirm the captcha
     PHPWS_Core::initCoreClass('Captcha.php');
     $captcha = Captcha::verify(TRUE);
     if ($captcha === FALSE) {
         NQ::simple('hms', hms\NotificationView::ERROR, 'The words you entered were incorrect. Please try again.');
         $errorCmd->redirect();
     }
     // Check for a meal plan
     if (!isset($mealPlan) || $mealPlan == '') {
         NQ::simple('hms', hms\NotificationView::ERROR, 'Please choose a meal plan.');
         $errorCmd->redirect();
     }
     $term = PHPWS_Settings::get('hms', 'lottery_term');
     $student = StudentFactory::getStudentByUsername(UserStatus::getUsername(), $term);
     // Update the meal plan field on the application
     $app = HousingApplication::getApplicationByUser(UserStatus::getUsername(), $term);
     $app->setMealPlan($mealPlan);
     try {
         $app->save();
     } catch (Exception $e) {
         PHPWS_Error::log('hms', $e->getMessage());
         NQ::simple('hms', hms\NotificationView::ERROR, 'Sorry, there was an error confirming your roommate invitation. Please contact University Housing.');
         $errorCmd->redirect();
     }
     // Try to actually make the assignment
     PHPWS_Core::initModClass('hms', 'HMS_Lottery.php');
     try {
         HMS_Lottery::confirm_roommate_request(UserStatus::getUsername(), $requestId, $mealPlan);
     } catch (Exception $e) {
         PHPWS_Error::log('hms', $e->getMessage());
         NQ::simple('hms', hms\NotificationView::ERROR, 'Sorry, there was an error confirming your roommate invitation. Please contact University Housing.');
         $errorCmd->redirect();
     }
     # Log the fact that the roommate was accepted and successfully assigned
     HMS_Activity_Log::log_activity(UserStatus::getUsername(), ACTIVITY_LOTTERY_CONFIRMED_ROOMMATE, UserStatus::getUsername(), "Captcha: \"{$captcha}\"");
     // Check for an RLC membership and update status if necessary
     // If this student was an RLC self-select, update the RLC memberhsip state
     $rlcAssignment = RlcMembershipFactory::getMembership($student, $term);
     if ($rlcAssignment != null && $rlcAssignment->getStateName() == 'selfselect-invite') {
         $rlcAssignment->changeState(new RlcAssignmentSelfAssignedState($rlcAssignment));
     }
     $invite = HMS_Lottery::get_lottery_roommate_invite_by_id($requestId);
     $successCmd = CommandFactory::getCommand('LotteryShowConfirmedRoommateThanks');
     $successCmd->setRequestId($requestId);
     $successCmd->redirect();
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:57,代码来源:LotteryConfirmRoommateRequestCommand.php

示例10: execute

 public function execute(CommandContext $context)
 {
     PHPWS_Core::initModClass('hms', 'HMS_Lottery.php');
     PHPWS_Core::initModClass('hms', 'LotteryDenyRoommateRequestView.php');
     $request = HMS_Lottery::get_lottery_roommate_invite_by_id($context->get('requestId'));
     $term = PHPWS_Settings::get('hms', 'lottery_term');
     $view = new LotteryDenyRoommateRequestView($request, $term);
     $context->setContent($view->show());
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:9,代码来源:LotteryShowDenyRoommateRequestCommand.php

示例11: execute

 public function execute(CommandContext $context)
 {
     $roomId = $context->get('roomId');
     $roommates = $context->get('roommates');
     $mealPlan = $context->get('mealPlan');
     $term = PHPWS_Settings::get('hms', 'lottery_term');
     PHPWS_Core::initModClass('hms', 'LotteryConfirmView.php');
     $view = new LotteryConfirmView($roomId, $mealPlan, $roommates, $term);
     $context->setContent($view->show());
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:10,代码来源:LotteryShowConfirmCommand.php

示例12: show

 public function show()
 {
     $basePath = PHPWS_Settings::get('faxmaster', 'fax_path');
     if (is_null($basePath) || !isset($basePath)) {
         throw new InvalidArgumentException('Please set fax_path setting.');
     }
     header('Content-Disposition: attachment; filename="' . $this->fax->getFileName() . '"');
     readfile($basePath . $this->fax->getFileName());
     exit;
 }
开发者ID:sinkdb,项目名称:faxserv,代码行数:10,代码来源:FaxDownload.php

示例13: show

 public function show()
 {
     $basePath = PHPWS_Settings::get('faxmaster', 'archive_path');
     if (is_null($basePath) || !isset($basePath)) {
         throw new InvalidArgumentException('Please set archive_path setting.');
     }
     header('Content-Type: application/x-gtar');
     header('Content-Disposition: attachment; filename="' . $this->tar . '"');
     header('Content-Length: ' . filesize($basePath . $this->tar));
     readfile($basePath . $this->tar);
     exit;
 }
开发者ID:sinkdb,项目名称:faxserv,代码行数:12,代码来源:ArchiveDownload.php

示例14: showForStudent

 public function showForStudent(Student $student, $term)
 {
     // for freshmen
     if ($student->getApplicationTerm() > Term::getCurrentTerm()) {
         return true;
     }
     // for returning students (summer terms)
     if ($term > $student->getApplicationTerm() && $term != PHPWS_Settings::get('hms', 'lottery_term') && (Term::getTermSem($term) == TERM_SUMMER1 || Term::getTermSem($term) == TERM_SUMMER2)) {
         return true;
     }
     return false;
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:12,代码来源:Application.php

示例15: execute

 public function execute(CommandContext $context)
 {
     PHPWS_Core::initModClass('hms', 'StudentFactory.php');
     PHPWS_Core::initModClass('hms', 'LotteryChooseRoommatesView.php');
     $term = PHPWS_Settings::get('hms', 'lottery_term');
     $student = StudentFactory::getStudentByUsername(UserStatus::getUsername(), $term);
     $roomId = $context->get('roomId');
     if (!isset($roomId) || is_null($roomId) || empty($roomId)) {
         throw new InvalidArgumentException('Missing room id.');
     }
     $view = new LotteryChooseRoommatesView($student, $term, $roomId);
     $context->setContent($view->show());
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:13,代码来源:LotteryShowChooseRoommatesCommand.php


注:本文中的PHPWS_Settings::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。