本文整理汇总了PHP中words函数的典型用法代码示例。如果您正苦于以下问题:PHP words函数的具体用法?PHP words怎么用?PHP words使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了words函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: before_filter
function before_filter(&$action, &$args)
{
parent::before_filter($action, $args);
$course_id = Request::option('cid');
if (isset($_SESSION['seminar_change_view_' . $course_id])) {
unset($_SESSION['seminar_change_view_' . $course_id]);
// Reset simulated view, redirect to administration page.
$this->redirect(URLHelper::getURL('dispatch.php/course/management'));
} elseif (get_object_type($course_id, array('sem')) && !SeminarCategories::GetBySeminarId($course_id)->studygroup_mode && in_array($GLOBALS['perm']->get_studip_perm($course_id), words('tutor dozent'))) {
// Set simulated view, redirect to overview page.
$_SESSION['seminar_change_view_' . $course_id] = 'autor';
$this->redirect(URLHelper::getURL('seminar_main.php'));
} else {
throw new Trails_Exception(400);
}
}
开发者ID:ratbird,项目名称:hope,代码行数:16,代码来源:change_view.php
示例17: before_filter
/**
* common tasks for all actions
*/
function before_filter(&$action, &$args)
{
parent::before_filter($action, $args);
$this->course_id = $args[0];
if (!in_array($action, words('apply claim delete order_down order_up'))) {
$this->redirect($this->url_for('/apply/' . $action));
return false;
}
if (!get_object_type($this->course_id, array('sem'))) {
throw new Trails_Exception(400);
}
$course = Seminar::GetInstance($this->course_id);
$enrolment_info = $course->getEnrolmentInfo($GLOBALS['user']->id);
//Ist bereits Teilnehmer/Admin/freier Zugriff -> gleich weiter
if ($enrolment_info['enrolment_allowed'] && (in_array($enrolment_info['cause'], words('root courseadmin member')) || $enrolment_info['cause'] == 'free_access' && $GLOBALS['user']->id == 'nobody')) {
$redirect_url = UrlHelper::getUrl('seminar_main.php', array('auswahl' => $this->course_id));
if (Request::isXhr()) {
$this->response->add_header('X-Location', $redirect_url);
$this->render_nothing();
} else {
$this->redirect($redirect_url);
}
return false;
}
//Grundsätzlich verboten
if (!$enrolment_info['enrolment_allowed']) {
throw new AccessDeniedException($enrolment_info['description']);
}
PageLayout::setTitle($course->getFullname() . " - " . _("Veranstaltungsanmeldung"));
PageLayout::addSqueezePackage('enrolment');
if (Request::isXhr()) {
$this->set_layout(null);
$this->response->add_header('X-No-Buttons', 1);
$this->response->add_header('X-Title', PageLayout::getTitle());
$request = Request::getInstance();
foreach ($request as $key => $value) {
$request[$key] = studip_utf8decode($value);
}
} else {
$this->set_layout($GLOBALS['template_factory']->open('layouts/base'));
}
$this->set_content_type('text/html;charset=windows-1252');
if (Request::submitted('cancel')) {
$this->redirect(URLHelper::getURL('dispatch.php/course/details/', array('sem_id' => $this->course_id)));
}
}
开发者ID:ratbird,项目名称:hope,代码行数:49,代码来源:enrolment.php
示例18: getObjectRule
/**
* returns the lock rule object for the given id, else null
*
* @param string $object_id id of course, institute or user
* @param bool $renew if true, reloads the rule from database
* @return LockRule
*/
public static function getObjectRule($object_id, $renew = false)
{
if (!array_key_exists($object_id, self::$lockmap) || $renew) {
$object_type = get_object_type($object_id, words('sem inst user'));
if ($object_type) {
$methodmap = array('sem' => 'Seminar', 'inst' => 'Institute', 'fak' => 'Institute', 'user' => 'User');
$lr = call_user_func(array('LockRule', 'FindBy' . $methodmap[$object_type]), $object_id);
if ($lr) {
self::$lockmap[$object_id] = $lr->getId();
self::$lockrules[$lr->getId()] = $lr;
} else {
self::$lockmap[$object_id] = null;
}
}
}
return self::$lockmap[$object_id] ? self::$lockrules[self::$lockmap[$object_id]] : null;
}
开发者ID:ratbird,项目名称:hope,代码行数:24,代码来源:LockRules.class.php
示例19: 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)
{
// Interpret every action other than 'index', 'publish' or 'unpublish'
// as page number
if (!in_array($action, words('index publish unpublish'))) {
array_unshift($args, (int) $action);
$action = 'index';
}
parent::before_filter($action, $args);
if (!Config::Get()->SCORE_ENABLE) {
throw new AccessDeniedException(_('Die Rangliste und die Score-Funktion sind nicht aktiviert.'));
}
PageLayout::setHelpKeyword('Basis.VerschiedenesScore');
// external help keyword
PageLayout::setTitle(_('Rangliste'));
Navigation::activateItem('/community/score');
}
开发者ID:ratbird,项目名称:hope,代码行数:23,代码来源:score.php
示例20: before_filter
function before_filter(&$action, &$args)
{
parent::before_filter($action, $args);
if (Config::Get()->STUDYGROUPS_ENABLE || in_array($action, words('globalmodules savemodules deactivate'))) {
// args at position zero is always the studygroup-id
if ($args[0]) {
if (SeminarCategories::GetBySeminarId($args[0])->studygroup_mode == false) {
throw new Exception(_('Dieses Seminar ist keine Studiengruppe!'));
}
}
PageLayout::setTitle(_("Studiengruppe bearbeiten"));
PageLayout::setHelpKeyword('Basis.Studiengruppen');
PageLayout::addSqueezePackage('tablesorter');
} else {
throw new Exception(_("Die von Ihnen gewählte Option ist im System nicht aktiviert."));
}
Sidebar::get()->setImage('sidebar/studygroup-sidebar.png');
}
开发者ID:ratbird,项目名称:hope,代码行数:18,代码来源:studygroup.php
注:本文中的words函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论