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


PHP words函数代码示例

本文整理汇总了PHP中words函数的典型用法代码示例。如果您正苦于以下问题:PHP words函数的具体用法?PHP words怎么用?PHP words使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: before_filter

 /**
  * common tasks for all actions
  */
 function before_filter(&$action, &$args)
 {
     global $perm;
     parent::before_filter($action, $args);
     $course_id = $args[0];
     $this->course_id = Request::option('cid', $course_id);
     Navigation::activateItem('/course/admin/admission');
     if (!get_object_type($this->course_id, array('sem')) || SeminarCategories::GetBySeminarId($this->course_id)->studygroup_mode || !$perm->have_studip_perm("tutor", $this->course_id)) {
         throw new Trails_Exception(403);
     }
     $this->course = Course::find($this->course_id);
     $this->user_id = $GLOBALS['user']->id;
     PageLayout::setHelpKeyword("Basis.VeranstaltungenVerwaltenZugangsberechtigungen");
     PageLayout::setTitle($this->course->getFullname() . " - " . _("Verwaltung von Zugangsberechtigungen"));
     $lockrules = words('admission_turnout admission_type admission_endtime admission_binding passwort read_level write_level admission_prelim admission_prelim_txt admission_starttime admission_endtime_sem admission_disable_waitlist user_domain admission_binding admission_studiengang');
     foreach ($lockrules as $rule) {
         $this->is_locked[$rule] = LockRules::Check($this->course_id, $rule) ? 'disabled readonly' : '';
     }
     if (!SeminarCategories::GetByTypeId($this->course->status)->write_access_nobody) {
         $this->is_locked['write_level'] = 'disabled readonly';
     }
     update_admission($this->course->id);
     PageLayout::addSqueezePackage('admission');
     URLHelper::addLinkParam('return_to_dialog', Request::get('return_to_dialog'));
 }
开发者ID:ratbird,项目名称:hope,代码行数:28,代码来源:admission.php

示例2: __construct

 /**
  *
  * @param string $query: SQL with at least ":input" as parameter
  * @param array $presets: variables from the same form that should be used
  * in this search. array("input_name" => "placeholder_in_sql_query")
  * @return void
  */
 public function __construct($search, $title = "", $avatarLike = "user_id", $presets = array())
 {
     $this->search = $search;
     $this->presets = $presets;
     $this->title = $title;
     $this->avatarLike = in_array($avatarLike, words('user_id, username')) ? $avatarLike : 'user_id';
 }
开发者ID:ratbird,项目名称:hope,代码行数:14,代码来源:PermissionSearch.class.php

示例3: before_filter

 /**
  * Before filter, set up the page by initializing the session and checking
  * all conditions.
  *
  * @param String $action Name of the action to be invoked
  * @param Array  $args   Arguments to be passed to the action method
  */
 public function before_filter(&$action, &$args)
 {
     $this->priviledged = $GLOBALS['perm']->have_studip_perm('tutor', $GLOBALS['SessSemName'][1]);
     if (Request::isXhr()) {
         $this->set_content_type('text/html;charset=Windows-1252');
     } else {
         $this->set_layout($GLOBALS['template_factory']->open('layouts/base'));
     }
     if (!in_array($action, words('index create edit move delete'))) {
         array_unshift($args, $action);
         $action = 'index';
     }
     if (in_array($action, words('create edit move delete')) && !$this->priviledged) {
         throw new AccessDeniedException(_('Sie sind nicht berechtigt, auf diesen Bereich zuzugreifen'));
     }
     if ($GLOBALS['perm']->have_studip_perm('tutor', $GLOBALS['SessSemName'][1])) {
         $widget = new ActionsWidget();
         $widget->addLink(_('Neuen Eintrag anlegen'), $this->url_for('show/create'), 'icons/16/blue/add.png')->asDialog();
         Sidebar::get()->addWidget($widget);
     }
     PageLayout::setHelpKeyword('Basis.Informationsseite');
     /**
             checkObject(); // do we have an open object?
             checkObjectModule('scm');
             object_set_visit_module('scm');
     	 **/
 }
开发者ID:anantace,项目名称:SCMTabs,代码行数:34,代码来源:show.php

示例4: initialize

 function initialize()
 {
     $styles = $this->combineAssets('plugingenerator', words('form buttons tooltip generator styles'), '.css');
     PageLayout::addStylesheet($styles);
     $scripts = $this->combineAssets('plugingenerator', words('form-protect generator application'), '.js');
     PageLayout::addScript($scripts);
 }
开发者ID:noackorama,项目名称:studip-plugin-generator,代码行数:7,代码来源:Plugingenerator.class.php

示例5: entryToJson

 private static function entryToJson($entry)
 {
     $json = array();
     foreach (words("start end content title color type") as $key) {
         $json[$key] = $entry[$key];
     }
     return $json;
 }
开发者ID:ratbird,项目名称:hope,代码行数:8,代码来源:Schedule.php

示例6: __construct

 /**
  * @param StudipCache $cache       The actual cache object
  * @param mixed       $proxy_these List of operations to proxy (should be
  *                                 an array but a space seperated string
  *                                 is also valid)
  */
 public function __construct(StudipCache $cache, $proxy_these = array('expire'))
 {
     if (!is_array($proxy_these)) {
         $proxy_these = words($proxy_these);
     }
     $this->actual_cache = $cache;
     $this->proxy_these = is_array($proxy_these) ? $proxy_these : words($proxy_these);
 }
开发者ID:ratbird,项目名称:hope,代码行数:14,代码来源:StudipCacheProxy.php

示例7: setVisit

 /**
  * Set the seminar denoted by the passed id as visited by the currently 
  * logged in user
  * 
  * @param string $seminar_id
  */
 static function setVisit($seminar_id)
 {
     $type = get_object_type($seminar_id, words('fak inst sem'));
     if ($type === 'fak') {
         $type = 'inst';
     }
     if (self::getVisit($seminar_id) < object_get_visit($seminar_id, $type, false, false)) {
         self::setVisitdates($seminar_id);
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:16,代码来源:ForumVisit.php

示例8: addWidgetDefaulConfiguration

 private function addWidgetDefaulConfiguration($classnames)
 {
     foreach ($classnames as $key => $classname) {
         $plugin_id = DBManager::get()->query("SELECT pluginid FROM plugins\n                WHERE pluginclassname = '{$classname}'")->fetchColumn();
         $stmt = DBManager::get()->prepare("INSERT INTO widget_default\n                (`pluginid`, `col`, `position`, `perm`) VALUES (?, ?, ?, ?)");
         foreach (words("user autor tutor dozent admin root") as $perm) {
             $stmt->execute(array($plugin_id, 0, $key, $perm));
         }
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:10,代码来源:146_step_00253_startseite.php

示例9: index_action

 /**
  * this action is the main action of the schedule-controller, setting the environment for the timetable,
  * accepting a comma-separated list of days.
  *
  * @param  string  a list of an arbitrary mix of the numbers 0-6, separated with a comma (e.g. 1,2,3,4,5 (for Monday to Friday, the default))
  */
 function index_action($days = false)
 {
     if ($GLOBALS['perm']->have_perm('admin')) {
         $inst_mode = true;
     }
     $my_schedule_settings = $GLOBALS['user']->cfg->SCHEDULE_SETTINGS;
     // set the days to be displayed
     if ($days === false) {
         if (Request::getArray('days')) {
             $this->days = array_keys(Request::getArray('days'));
         } else {
             $this->days = array(0, 1, 2, 3, 4, 5, 6);
         }
     } else {
         $this->days = explode(',', $days);
     }
     // try to find the correct institute-id
     $institute_id = Request::option('institute_id', $SessSemName[1] ? $SessSemName[1] : Request::option('cid', false));
     if (!$institute_id) {
         $institute_id = $GLOBALS['user']->cfg->MY_INSTITUTES_DEFAULT;
     }
     if (!$institute_id || in_array(get_object_type($institute_id), words('inst fak')) === false) {
         throw new Exception(sprintf(_('Kann Einrichtungskalendar nicht anzeigen!' . 'Es wurde eine ungültige Instituts-Id übergeben (%s)!', $institute_id)));
     }
     // load semester-data and current semester
     $semdata = new SemesterData();
     $this->semesters = $semdata->getAllSemesterData();
     if (Request::option('semester_id')) {
         $this->current_semester = $semdata->getSemesterData(Request::option('semester_id'));
     } else {
         $this->current_semester = $semdata->getCurrentSemesterData();
     }
     $this->entries = (array) CalendarInstscheduleModel::getInstituteEntries($GLOBALS['user']->id, $this->current_semester, 8, 20, $institute_id, $this->days);
     Navigation::activateItem('/course/main/schedule');
     PageLayout::setHelpKeyword('Basis.TerminkalenderStundenplan');
     PageLayout::setTitle($GLOBALS['SessSemName']['header_line'] . ' - ' . _('Veranstaltungs-Stundenplan'));
     $zoom = Request::int('zoom', 0);
     $this->controller = $this;
     $this->calendar_view = new CalendarWeekView($this->entries, 'instschedule');
     $this->calendar_view->setHeight(40 + 20 * $zoom);
     $this->calendar_view->setRange($my_schedule_settings['glb_start_time'], $my_schedule_settings['glb_end_time']);
     $this->calendar_view->groupEntries();
     // if enabled, group entries with same start- and end-date
     URLHelper::addLinkParam('zoom', $zoom);
     URLHelper::addLinkParam('semester_id', $this->current_semester['semester_id']);
     $style_parameters = array('whole_height' => $this->calendar_view->getOverallHeight(), 'entry_height' => $this->calendar_view->getHeight());
     $factory = new Flexi_TemplateFactory($this->dispatcher->trails_root . '/views');
     PageLayout::addStyle($factory->render('calendar/stylesheet', $style_parameters));
     if (Request::option('printview')) {
         PageLayout::addStylesheet('print.css');
     } else {
         PageLayout::addStylesheet('print.css', array('media' => 'print'));
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:60,代码来源:instschedule.php

示例10: before_filter

 function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     PageLayout::setTitle(_("Nachrichten"));
     PageLayout::setHelpKeyword("Basis.InteraktionNachrichten");
     if (Request::isXhr() && Request::isGet()) {
         $request = Request::getInstance();
         foreach (words('default_body default_subject') as $key) {
             $request[$key] = Request::removeMagicQuotes($_GET[$key]);
         }
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:12,代码来源:messages.php

示例11: before_filter

 /**
  * Set up this controller.
  *
  * @param String $action Name of the action to be invoked
  * @param Array  $args   Arguments to be passed to the action method
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     if (!in_array($this->user->perms, words('autor tutor dozent'))) {
         throw new AccessDeniedException();
     }
     PageLayout::setHelpKeyword('Basis.HomepageUniversitäreDaten');
     PageLayout::setTitle(_('Studiengang bearbeiten'));
     Navigation::activateItem('/profile/edit/studies');
     SkipLinks::addIndex(_('Fächer und Abschlüsse auswählen'), 'select_fach_abschluss');
     SkipLinks::addIndex(_('Zu Einrichtungen zuordnen'), 'select_institute');
     $this->allow_change = array('sg' => !StudipAuthAbstract::CheckField('studiengang_id', $this->user->auth_plugin) && (Config::get()->ALLOW_SELFASSIGN_STUDYCOURSE || $GLOBALS['perm']->have_perm('admin')), 'in' => Config::get()->ALLOW_SELFASSIGN_INSTITUTE || $GLOBALS['perm']->have_perm('admin'));
 }
开发者ID:ratbird,项目名称:hope,代码行数:19,代码来源:studies.php

示例12: remove

 public static function remove($haystack, $needle, $delim = ',')
 {
     $words = words($haystack, $delim);
     $out = "";
     $last = count($words);
     foreach ($words as $word) {
         if (matches($needle, $word)) {
             continue;
         } else {
             $out .= $word . $delim;
         }
     }
     return rtrim($out, $delim);
 }
开发者ID:h3rb,项目名称:page,代码行数:14,代码来源:ACL.php

示例13: before_filter

 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     $this->institute_id = current($args);
     if ($this->institute_id === '' || !in_array(get_object_type($this->institute_id), words('inst fak')) || !$GLOBALS['perm']->have_studip_perm("admin", $this->institute_id)) {
         $this->set_status(403);
         return FALSE;
     }
     $this->body_id = 'custom_avatar';
     PageLayout::setTitle(getHeaderLine($this->institute_id) . ' - ' . _('Bild ändern'));
     Navigation::activateItem('/admin/institute/details');
     # choose base layout w/o infobox and set tabs
     $layout = $GLOBALS['template_factory']->open('layouts/base_without_infobox');
     $this->set_layout($layout);
 }
开发者ID:ratbird,项目名称:hope,代码行数:15,代码来源:avatar.php

示例14: get_kings_uncached

 private static function get_kings_uncached()
 {
     $types = words('files forum news voter votes wiki');
     $kings = array();
     foreach ($types as $type) {
         $method = "{$type}_kings";
         foreach (self::$method() as $user_id => $amount) {
             if (!isset($kings[$user_id])) {
                 $kings[$user_id] = array();
             }
             $kings[$user_id][$type] = $amount;
         }
     }
     return $kings;
 }
开发者ID:ratbird,项目名称:hope,代码行数:15,代码来源:StudipKing.class.php

示例15: before_filter

 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     $this->cid = self::requireContext();
     self::requireAuthorisation($this->cid);
     // TODO: anders sicherstellen, dass sich #state und #start/stopdate nicht widersprechen
     Question::consolidateState($this->cid);
     # find and set question
     # URL: /cliqr/questions/(show|update|destroy|start|stop)/:question_id
     if (in_array($action, words("show update destroy start stop"))) {
         $question_id = self::ensureMD5($args[0]);
         $this->question = Question::find($question_id);
     }
     # else: index create
 }
开发者ID:swindhab,项目名称:CliqrPlugin,代码行数:15,代码来源:questions.php


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