本文整理汇总了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'));
}
示例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';
}
示例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');
**/
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
}
示例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));
}
}
}
示例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'));
}
}
示例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]);
}
}
}
示例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'));
}
示例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);
}
示例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);
}
示例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;
}
示例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
}