本文整理汇总了PHP中URLHelper::getLink方法的典型用法代码示例。如果您正苦于以下问题:PHP URLHelper::getLink方法的具体用法?PHP URLHelper::getLink怎么用?PHP URLHelper::getLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类URLHelper
的用法示例。
在下文中一共展示了URLHelper::getLink方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: map
/**
* Mapping function where to find what
* @param type $object the object
* @param type $function the called function
* @return string output
*/
private static function map($object, $function)
{
/**
* If you want to add an object to the helper simply add to this array
*/
$mapping = array('User' => array('link' => function ($obj) {
return URLHelper::getLink('dispatch.php/profile', array('username' => $obj->username));
}, 'name' => function ($obj) {
return htmlReady($obj->getFullname());
}, 'avatar' => function ($obj) {
return Avatar::getAvatar($obj->id, $obj->username)->getImageTag(Avatar::SMALL, array('title' => htmlReady($obj->getFullname('no_title'))));
}), 'Course' => array('link' => function ($obj) {
return URLHelper::getLink('seminar_main.php', array('auswahl' => $obj->id));
}, 'name' => function ($obj) {
return htmlReady($obj->name);
}, 'avatar' => function ($obj) {
return CourseAvatar::getAvatar($obj->id)->getImageTag($size = CourseAvatar::SMALL, array('title' => htmlReady($obj->name)));
}));
/*
* Some php magic to call the right function if it exists
*/
if ($object && $mapping[get_class($object)]) {
return $mapping[get_class($object)][$function]($object);
}
return "";
}
示例2: getAdminModuleLinks
/**
* get admin module links
*
* returns links add or remove a module from course
* @access public
* @return string returns html-code
*/
function getAdminModuleLinks()
{
global $connected_cms, $view, $search_key, $cms_select, $current_module;
$output .= "<form method=\"POST\" action=\"" . URLHelper::getLink() . "\">\n";
$output .= CSRFProtection::tokenTag();
$output .= "<input type=\"HIDDEN\" name=\"view\" value=\"" . htmlReady($view) . "\">\n";
$output .= "<input type=\"HIDDEN\" name=\"search_key\" value=\"" . htmlReady($search_key) . "\">\n";
$output .= "<input type=\"HIDDEN\" name=\"cms_select\" value=\"" . htmlReady($cms_select) . "\">\n";
$output .= "<input type=\"HIDDEN\" name=\"module_type\" value=\"" . htmlReady($connected_cms[$this->cms_type]->content_module[$current_module]->getModuleType()) . "\">\n";
$output .= "<input type=\"HIDDEN\" name=\"module_id\" value=\"" . htmlReady($connected_cms[$this->cms_type]->content_module[$current_module]->getId()) . "\">\n";
$output .= "<input type=\"HIDDEN\" name=\"module_system_type\" value=\"" . htmlReady($this->cms_type) . "\">\n";
if ($connected_cms[$this->cms_type]->content_module[$current_module]->isConnected()) {
$output .= " " . Button::create(_('Entfernen'), 'remove');
} elseif ($connected_cms[$this->cms_type]->content_module[$current_module]->isAllowed(OPERATION_WRITE)) {
$output .= "<div align=\"left\"><input type=\"CHECKBOX\" value=\"1\" name=\"write_permission\" style=\"vertical-align:middle\">";
$output .= _("Mit Schreibrechten für alle Dozenten/Tutoren dieser Veranstaltung") . "<br>";
$output .= "<input type=\"CHECKBOX\" value=\"1\" style=\"vertical-align:middle\" name=\"write_permission_autor\">";
$output .= _("Mit Schreibrechten für alle Teilnehmer dieser Veranstaltung") . "</div>";
$output .= Button::create(_('Hinzufügen'), 'add') . "<br>";
} else {
$output .= " " . Button::create(_('Hinzufügen'), 'add');
}
$output .= "</form>";
return $output;
// $output .= parent::getAdminModuleLinks();
}
示例3: markupHashtags
public static function markupHashtags($markup, $matches)
{
if (self::$course_hashes) {
$url = URLHelper::getLink("plugins.php/Blubber/forum/forum", array('hash' => $matches[2], 'cid' => self::$course_hashes));
} else {
$url = URLHelper::getLink("plugins.php/Blubber/forum/globalstream", array('hash' => $matches[2]));
}
return $matches[1] . '<a href="' . $url . '" class="hashtag">#' . $markup->quote($matches[2]) . '</a>';
}
示例4: index_action
/**
* show institute overview page
*
* @return void
*/
function index_action()
{
$this->sidebar = Sidebar::get();
$this->sidebar->setImage('sidebar/institute-sidebar.png');
if (get_config('NEWS_RSS_EXPORT_ENABLE') && $this->institute_id) {
$rss_id = StudipNews::GetRssIdFromRangeId($this->institute_id);
if ($rss_id) {
PageLayout::addHeadElement('link', array('rel' => 'alternate', 'type' => 'application/rss+xml', 'title' => 'RSS', 'href' => 'rss.php?id=' . $rss_id));
}
}
URLHelper::bindLinkParam("inst_data", $this->institut_main_data);
// (un)subscribe to institute
if (Config::get()->ALLOW_SELFASSIGN_INSTITUTE && $GLOBALS['user']->id !== 'nobody' && !$GLOBALS['perm']->have_perm('admin')) {
$widget = new ActionsWidget();
if (!$GLOBALS['perm']->have_studip_perm('user', $this->institute_id)) {
$url = URLHelper::getLink('dispatch.php/institute/overview', array('follow_inst' => 'on'));
$widget->addLink(_('Einrichtung abonnieren'), $url);
} elseif (!$GLOBALS['perm']->have_studip_perm('autor', $this->institute_id)) {
$url = URLHelper::getLink('dispatch.php/institute/overview', array('follow_inst' => 'off'));
$widget->addLink(_('Austragen aus der Einrichtung'), $url);
}
$this->sidebar->addWidget($widget);
if (!$GLOBALS['perm']->have_studip_perm('user', $this->institute_id) and Request::option('follow_inst') == 'on') {
$query = "INSERT IGNORE INTO user_inst\n (user_id, Institut_id, inst_perms)\n VALUES (?, ?, 'user')";
$statement = DBManager::get()->prepare($query);
$statement->execute(array($GLOBALS['user']->user_id, $this->institute_id));
if ($statement->rowCount() > 0) {
log_event('INST_USER_ADD', $this->institute_id, $GLOBALS['user']->user_id, 'user');
PageLayout::postMessage(MessageBox::success(_("Sie haben die Einrichtung abonniert.")));
header('Location: ' . URLHelper::getURL('', array('cid' => $this->institute_id)));
die;
}
} elseif (!$GLOBALS['perm']->have_studip_perm('autor', $this->institute_id) and Request::option('follow_inst') == 'off') {
$query = "DELETE FROM user_inst\n WHERE user_id = ? AND Institut_id = ?";
$statement = DBManager::get()->prepare($query);
$statement->execute(array($GLOBALS['user']->user_id, $this->institute_id));
if ($statement->rowCount() > 0) {
log_event('INST_USER_DEL', $this->institute_id, $GLOBALS['user']->user_id, 'user');
PageLayout::postMessage(MessageBox::success(_("Sie haben sich aus der Einrichtung ausgetragen.")));
header('Location: ' . URLHelper::getURL('', array('cid' => $this->institute_id)));
die;
}
}
}
// Fetch news
$response = $this->relay('news/display/' . $this->institute_id);
$this->news = $response->body;
// Fetch votes
if (get_config('VOTE_ENABLE')) {
$response = $this->relay('questionnaire/widget/' . $this->institute_id . '/institute');
$this->questionnaires = $response->body;
}
// Fetch dates
$response = $this->relay("calendar/contentbox/display/{$this->institute_id}/1210000");
$this->dates = $response->body;
}
示例5: getColumnName
function getColumnName($id, $print_view = false)
{
$res_obj = ResourceObject::Factory($this->show_columns[$id]);
if (!$print_view) {
$ret = '<a class="tree" href="' . URLHelper::getLink('?show_object=' . $this->show_columns[$id] . '&view=' . (Request::option('view') == 'openobject_group_schedule' ? 'openobject_schedule' : 'view_schedule')) . '">' . htmlReady($res_obj->getName()) . '</a>' . ($res_obj->getSeats() ? '<br>(' . $res_obj->getSeats() . ')' : '');
} else {
$ret = '<span style="font-size:10pt;">' . htmlReady($res_obj->getName()) . '</span>';
}
return $ret . chr(10);
}
示例6: getNotificationObjects
function getNotificationObjects($course_id, $since, $user_id)
{
$items = array();
$type = get_object_type($course_id, array('sem', 'inst', 'fak'));
if ($type == 'sem') {
$query = 'SELECT wiki.*, seminare.Name, ' . $GLOBALS['_fullname_sql']['full'] . ' as fullname
FROM wiki
JOIN auth_user_md5 USING (user_id)
JOIN user_info USING (user_id)
JOIN seminar_user ON (range_id = Seminar_id)
JOIN seminare USING (Seminar_id)
WHERE seminar_user.user_id = ? AND Seminar_id = ?
AND wiki.chdate > ?';
} else {
$query = 'SELECT wiki.*, Institute.Name, ' . $GLOBALS['_fullname_sql']['full'] . ' as fullname
FROM wiki
JOIN auth_user_md5 USING (user_id)
JOIN user_info USING (user_id)
JOIN user_inst ON (range_id = Institut_id)
JOIN Institute USING (Institut_id)
WHERE user_inst.user_id = ? AND Institut_id = ?
AND wiki.chdate > ?';
}
$wikipage_stmt = DBManager::get()->prepare("SELECT * FROM wiki\n WHERE keyword = ? AND range_id = ?\n AND version = ?");
$stmt = DBManager::get()->prepare($query);
$stmt->execute(array($user_id, $course_id, $since));
while ($row = $stmt->fetch()) {
// use correct text depending on type of object
if ($type == 'sem') {
if ($row['version'] > 1) {
$summary = sprintf('%s hat im Wiki der Veranstaltung "%s" die Seite "%s" geändert.', $row['fullname'], $row['Name'], $row['keyword']);
} else {
$summary = sprintf('%s hat im Wiki der Veranstaltung "%s" die Seite "%s" erstellt.', $row['fullname'], $row['Name'], $row['keyword']);
}
} else {
if ($row['version'] > 1) {
$summary = sprintf('%s hat im Wiki der Einreichtung "%s" die Seite "%s" geändert.', $row['fullname'], $row['Name'], $row['keyword']);
} else {
$summary = sprintf('%s hat im Wiki der Einreichtung "%s" die Seite "%s" erstellt.', $row['fullname'], $row['Name'], $row['keyword']);
}
}
$content = '';
if ($row['version'] > 1) {
$wikipage_stmt->execute(array($row['keyword'], $row['range_id'], $row['version'] - 1));
$old_page = $wikipage_stmt->fetch(PDO::FETCH_ASSOC);
$content = '<table>' . do_diff($old_page['body'], $row['body']) . '</table>';
} else {
$content = wikiReady($row['body']);
}
$items[] = new ContentElement('Wiki: ' . $row['keyword'], $summary, $content, $row['user_id'], $row['fullname'], URLHelper::getLink('wiki.php', array('cid' => $row['range_id'], 'keyword' => $row['keyword'])), $row['chdate']);
}
return $items;
}
示例7: set_sidebar
public function set_sidebar()
{
$sidebar = Sidebar::Get();
$sidebar->setImage('sidebar/studygroup-sidebar.png');
$sidebar->setTitle(_('Meine Studiengruppen'));
if (count($this->studygroups) > 0) {
$setting_widget = new ActionsWidget();
$setting_widget->setTitle(_("Aktionen"));
$setting_widget->addLink(_('Farbgruppierung ändern'), URLHelper::getLink('dispatch.php/my_courses/groups/all/true'), Icon::create('group4', 'clickable'), array('data-dialog' => 'buttons=true'));
$sidebar->addWidget($setting_widget);
}
}
示例8: setUrl
public function setUrl($url)
{
$query = parse_url($url, PHP_URL_QUERY);
if ($query) {
$url = str_replace('?' . $query, '', $url);
parse_str(html_entity_decode($query) ?: '', $query_params);
} else {
$query_params = array();
}
$this->template_variables['url'] = URLHelper::getLink($url);
$this->template_variables['params'] = $query_params;
}
示例9: before_filter
function before_filter(&$action, &$args)
{
parent::before_filter($action, $args);
Navigation::activateItem("/pluginmarket/presenting");
if ($GLOBALS['perm']->have_perm("user")) {
$config = UserConfig::get($GLOBALS['user']->id);
$this->last_pluginmarket_visit = $config->getValue("last_pluginmarket_visit") ?: time();
$_SESSION['last_pluginmarket_visit'] = time();
$config->store("last_pluginmarket_visit", $_SESSION['last_pluginmarket_visit']);
}
PageLayout::addScript($this->plugin->getPluginURL() . "/assets/studiptable.js");
PageLayout::addScript($this->plugin->getPluginURL() . "/assets/pluginmarket.js");
$tags_statement = DBManager::get()->prepare("\n SELECT pluginmarket_tags.tag, COUNT(*) AS number\n FROM pluginmarket_tags\n INNER JOIN pluginmarket_plugins ON (pluginmarket_plugins.plugin_id = pluginmarket_tags.plugin_id)\n WHERE pluginmarket_tags. proposal = '0'\n AND pluginmarket_plugins.approved = 1\n AND pluginmarket_plugins.publiclyvisible = 1\n GROUP BY pluginmarket_tags.tag\n ORDER BY number DESC, RAND()\n LIMIT 25\n ");
$tags_statement->execute();
$this->tags = $tags_statement->fetchAll(PDO::FETCH_ASSOC);
// Set view
$_SESSION['pluginmarket']['view'] = Request::get('view') ?: $_SESSION['pluginmarket']['view'];
if (!isset($_SESSION['pluginmarket']['view'])) {
$_SESSION['pluginmarket']['view'] = 'tiles';
}
// Sidebar
$sidebar = Sidebar::Get();
// Create search widget
$searchWidget = new SearchWidget($this->url_for('presenting/all'));
$searchWidget->addNeedle(_('Suche'), 'search', true);
$sidebar->addWidget($searchWidget);
// Create cloud
$tagWidget = new LinkCloudWidget();
$tagWidget->setTitle(_("Beliebte Tags"));
foreach ($this->tags as $tag) {
$tagWidget->addLink($tag['tag'], $this->url_for('presenting/all', array('tag' => $tag['tag'])), $tag['number']);
}
$sidebar->addWidget($tagWidget);
// Create view widget
if ($action != 'details') {
$viewWidget = new ViewsWidget();
$viewWidget->addLink(_('Kacheln'), URLHelper::getLink('', array('view' => 'tiles')))->setActive($_SESSION['pluginmarket']['view'] == 'tiles');
$viewWidget->addLink(_('Liste'), $this->url_for('presenting/all', array('view' => 'list')))->setActive($_SESSION['pluginmarket']['view'] == 'list');
$sidebar->addWidget($viewWidget);
}
// Create versionfilter widget
$versionWidget = new OptionsWidget();
$versionWidget->setTitle(_('Stud.IP Version'));
// Create options for all studip versions
$_SESSION['pluginmarket']['version'] = Request::submitted('version') ? Request::get('version') : $_SESSION['pluginmarket']['version'];
$options[] = "<option value='" . URLHelper::getLink('', array('version' => 0)) . "'>" . _('Alle Versionen') . "</option>";
foreach (array_reverse(PluginMarket::getStudipReleases()) as $version) {
$options[] = "<option value='" . URLHelper::getLink('', array('version' => $version)) . "' " . ($_SESSION['pluginmarket']['version'] == $version ? "SELECTED" : "") . ">{$version}</option>";
}
$versionWidget->addElement(new WidgetElement('<select style="width: 100%" onchange="location = this.options[this.selectedIndex].value;">' . join("", $options) . '</select>'));
// Add checkbox to ignore older releases (use invese logic to be applied on startup)
$sidebar->addWidget($versionWidget, 'comments');
}
示例10: show_documents
/**
* Returns an overview of certain documents
*
* @param Array $documents Ids of the documents in question
* @param mixed $open Array containing open states of documents
* @return string Overview of documents as html, ready to be displayed
*/
function show_documents($documents, $open = null)
{
if (!is_array($documents)) {
return;
}
if (!is_null($open) && !is_array($open)) {
$open = null;
}
if (is_array($open)) {
reset($open);
$ank = key($open);
}
if (!empty($documents)) {
$query = "SELECT {$GLOBALS['_fullname_sql']['full']} AS fullname, username, user_id,\n dokument_id, filename, filesize, downloads, protected, url, description,\n IF(IFNULL(name, '') = '', filename, name) AS t_name,\n GREATEST(a.chdate, a.mkdate) AS chdate\n FROM dokumente AS a\n LEFT JOIN auth_user_md5 USING (user_id)\n LEFT JOIN user_info USING (user_id)\n WHERE dokument_id IN (?)\n ORDER BY a.chdate DESC";
$statement = DBManager::get()->prepare($query);
$statement->execute(array($documents));
$documents = $statement->fetchAll(PDO::FETCH_ASSOC);
}
foreach ($documents as $index => $document) {
$type = empty($document['url']) ? 0 : 6;
$is_open = is_null($open) || $open[$document['dokument_id']] ? 'open' : 'close';
$extension = getFileExtension($document['filename']);
// Create icon
$icon = sprintf('<a href="%s">%s</a>', GetDownloadLink($document['dokument_id'], $document['filename'], $type), GetFileIcon($extension, true)->asImg());
// Create open/close link
$link = $is_open === 'open' ? URLHelper::getLink('#dok_anker', array('close' => $document['dokument_id'])) : URLHelper::getLink('#dok_anker', array('open' => $document['dokument_id']));
// Create title including filesize and number of downloads
$size = $document['filesize'] > 1024 * 1024 ? sprintf('%u MB', round($document['filesize'] / 1024 / 1024)) : sprintf('%u kB', round($document['filesize'] / 1024));
$downloads = $document['downloads'] == 1 ? '1 ' . _('Download') : $document['downloads'] . ' ' . _('Downloads');
$title = sprintf('<a href="%s"%s class="tree">%s</a> (%s / %s)', $link, $ank == $document['dokument_id'] ? ' name="dok_anker"' : '', htmlReady(mila($document['t_name'])), $size, $downloads);
// Create additional information
$addon = sprintf('<a href="%s">%s</a> %s', URLHelper::getLink('dispatch.php/profile', array('username' => $document['username'])), $document['fullname'], date('d.m.Y H:i', $document['chdate']));
if ($document['protected']) {
$addon = tooltipicon(_('Diese Datei ist urheberrechtlich geschützt!')) . ' ' . $addon;
}
if (!empty($document['url'])) {
$addon .= ' ' . Icon::create('link-extern', 'clickable', ['title' => _('Diese Datei wird von einem externen Server geladen!')])->asImg(16);
}
// Attach created variables to document
$documents[$index]['addon'] = $addon;
$documents[$index]['extension'] = $extension;
$documents[$index]['icon'] = $icon;
$documents[$index]['is_open'] = $is_open;
$documents[$index]['link'] = $link;
$documents[$index]['title'] = $title;
$documents[$index]['type'] = $type;
}
$template = $GLOBALS['template_factory']->open('user_activities/files-details');
$template->documents = $documents;
return $template->render();
}
示例11: getAdminModuleLinks
/**
* get admin module links
*
* returns links add or remove a module from course
* @access public
* @return string returns html-code
*/
function getAdminModuleLinks()
{
global $connected_cms, $view, $search_key, $cms_select, $current_module;
if (!$connected_cms[$this->cms_type]->content_module[$current_module]->isDummy()) {
$result = $connected_cms[$this->cms_type]->soap_client->getPath($connected_cms[$this->cms_type]->content_module[$current_module]->getId());
}
if ($result) {
$output .= "<i>Pfad: " . htmlReady($result) . "</i><br><br>";
}
$output .= "<form method=\"POST\" action=\"" . URLHelper::getLink() . "\">\n";
$output .= CSRFProtection::tokenTag();
$output .= "<input type=\"HIDDEN\" name=\"view\" value=\"" . htmlReady($view) . "\">\n";
$output .= "<input type=\"HIDDEN\" name=\"search_key\" value=\"" . htmlReady($search_key) . "\">\n";
$output .= "<input type=\"HIDDEN\" name=\"cms_select\" value=\"" . htmlReady($cms_select) . "\">\n";
$output .= "<input type=\"HIDDEN\" name=\"module_type\" value=\"" . htmlReady($connected_cms[$this->cms_type]->content_module[$current_module]->getModuleType()) . "\">\n";
$output .= "<input type=\"HIDDEN\" name=\"module_id\" value=\"" . htmlReady($connected_cms[$this->cms_type]->content_module[$current_module]->getId()) . "\">\n";
$output .= "<input type=\"HIDDEN\" name=\"module_system_type\" value=\"" . htmlReady($this->cms_type) . "\">\n";
if ($connected_cms[$this->cms_type]->content_module[$current_module]->isConnected()) {
$output .= " " . Button::create(_('Entfernen'), 'remove');
} elseif ($connected_cms[$this->cms_type]->content_module[$current_module]->isAllowed(OPERATION_WRITE)) {
$output .= "<div align=\"left\">";
if ($connected_cms[$this->cms_type]->content_module[$current_module]->isAllowed(OPERATION_COPY) and !in_array($connected_cms[$this->cms_type]->content_module[$current_module]->module_type, array("lm", "htlm", "sahs", "cat", "crs", "dbk"))) {
$output .= "<input type=\"CHECKBOX\" name=\"copy_object\" value=\"1\">";
$output .= _("Als Kopie anlegen") . " ";
$output .= Icon::create('info-circle', 'inactive', ['title' => _('Wenn Sie diese Option wählen, wird eine identische Kopie als eigenständige Instanz des Lernmoduls erstellt. Anderenfalls wird ein Link zum Lernmodul gesetzt.')])->asImg();
$output .= "<br>";
}
$output .= "<input type=\"RADIO\" name=\"write_permission\" value=\"none\" checked>";
$output .= _("Keine Schreibrechte") . " ";
$output .= Icon::create('info-circle', 'inactive', ['title' => _('Nur der/die BesitzerIn des Lernmoduls hat Schreibzugriff für Inhalte und Struktur des Lernmoduls. Tutor/-innen und Lehrende können die Verknüpfung zur Veranstaltung wieder löschen.')])->asImg();
$output .= "<br>";
$output .= "<input type=\"RADIO\" name=\"write_permission\" value=\"dozent\">";
$output .= _("Mit Schreibrechten für alle Lehrenden dieser Veranstaltung") . " ";
$output .= Icon::create('info-circle', 'inactive', ['title' => _('Lehrende haben Schreibzugriff für Inhalte und Struktur des Lernmoduls. Tutor/-innen und Lehrende können die Verknüpfung zur Veranstaltung wieder löschen.')])->asImg();
$output .= "<br>";
$output .= "<input type=\"RADIO\" name=\"write_permission\" value=\"tutor\">";
$output .= _("Mit Schreibrechten für alle Lehrenden und Tutor/-innen dieser Veranstaltung") . " ";
$output .= Icon::create('info-circle', 'inactive', ['title' => _('Lehrende und Tutor/-innen haben Schreibzugriff für Inhalte und Struktur des Lernmoduls. Tutor/-innen und Lehrende können die Verknüpfung zur Veranstaltung wieder löschen.')])->asImg();
$output .= "<br>";
$output .= "<input type=\"RADIO\" name=\"write_permission\" value=\"autor\">";
$output .= _("Mit Schreibrechten für alle Personen dieser Veranstaltung") . " ";
$output .= Icon::create('info-circle', 'inactive', ['title' => _('Lehrende, Tutor/-innen und Teilnehmer/-innen haben Schreibzugriff für Inhalte und Struktur des Lernmoduls. Tutor/-innen und Lehrende können die Verknüpfung zur Veranstaltung wieder löschen.')])->asImg();
$output .= "</div>";
$output .= "</div><br>" . Button::create(_('Hinzufügen'), 'add') . "<br>";
} else {
$output .= " " . Button::create(_('Hinzufügen'), 'add');
}
$output .= "</form>";
return $output;
}
示例12: getStepTemplate
/**
* Returns the Flexi template for entering the necessary values
* for this step.
*
* @param Array $values Pre-set values
* @param int $stepnumber which number has the current step in the wizard?
* @param String $temp_id temporary ID for wizard workflow
* @return String a Flexi template for getting needed data.
*/
public function getStepTemplate($values, $stepnumber, $temp_id)
{
// We only need our own stored values here.
$values = $values[__CLASS__];
// Load template from step template directory.
$factory = new Flexi_TemplateFactory($GLOBALS['STUDIP_BASE_PATH'] . '/app/views/course/wizard/steps');
$tpl = $factory->open('studyareas/index');
if ($values['studyareas']) {
$tree = $this->buildPartialSemTree(StudipStudyArea::backwards(StudipStudyArea::findMany($values['studyareas'])), false);
$tpl->set_attribute('assigned', $tree);
} else {
$tpl->set_attribute('assigned', array());
}
$tpl->set_attribute('values', $values);
// First tree level is always shown.
$tree = StudipStudyArea::findByParent(StudipStudyArea::ROOT);
if (count($tree) == 0) {
PageLayout::postError(formatReady(_('Das Anlegen einer ' . 'Veranstaltung ist nicht möglich, da keine Studienbereiche ' . 'existieren. Bitte wenden Sie sich an [die ' . 'Stud.IP-Administration]' . URLHelper::getLink('dispatch.php/siteinfo/show') . ' .')));
return false;
}
/*
* Someone works without JS activated, load all ancestors and
* children of open node.
*/
if ($values['open_node']) {
$tpl->set_attribute('open_nodes', $this->buildPartialSemTree(StudipStudyArea::backwards(StudipStudyArea::findByParent($values['open_node'])), false, true));
}
/*
* Someone works without JS and has entered a search term:
* build the partial tree with search results.
*/
if ($values['searchterm']) {
$search = $this->searchSemTree($values['searchterm'], false, true);
if ($search) {
$tpl->set_attribute('open_nodes', $search);
$tpl->set_attribute('search_result', $search);
unset($values['open_node']);
} else {
PageLayout::postMessage(MessageBox::info(_('Es wurde kein Suchergebnis gefunden.')));
unset($values['searchterm']);
}
}
$tpl->set_attribute('tree', $tree);
$tpl->set_attribute('ajax_url', $values['ajax_url'] ?: URLHelper::getLink('dispatch.php/course/wizard/ajax'));
$tpl->set_attribute('no_js_url', $values['no_js_url'] ?: 'dispatch.php/course/wizard/forward/' . $stepnumber . '/' . $temp_id);
$tpl->set_attribute('stepnumber', $stepnumber);
$tpl->set_attribute('temp_id', $temp_id);
return $tpl->render();
}
示例13: onEnable
/**
*
**/
public static function onEnable($pluginId)
{
# TODO performance - use cache on success ?
$role_persistence = new RolePersistence();
$plugin_roles = $role_persistence->getAssignedPluginRoles($pluginId);
$role_names = array_map(function ($role) {
return $role->getRolename();
}, $plugin_roles);
if (!in_array('Nobody', $role_names)) {
$message = _('Das OAuth-Plugin ist aktiviert, aber nicht für die Rolle "Nobody" freigegeben.');
$details = array();
$details[] = _('Dies behindert die Kommunikation externer Applikationen mit dem System.');
$details[] = sprintf(_('Klicken Sie <a href="%s">hier</a>, um die Rollenzuweisung zu bearbeiten.'), URLHelper::getLink('dispatch.php/admin/role/assign_plugin_role/' . $pluginId));
PageLayout::postMessage(Messagebox::info($message, $details));
}
}
示例14: perform
public function perform($unconsumed)
{
if ($unconsumed !== 'read_all') {
return;
}
$global_news = StudipNews::GetNewsByRange('studip', true);
foreach ($global_news as $news) {
object_add_view($news['news_id']);
object_set_visit($news['news_id'], 'news');
}
if (Request::isXhr()) {
echo json_encode(true);
} else {
PageLayout::postMessage(MessageBox::success(_('Alle Ankündigungen wurden als gelesen markiert.')));
header('Location: ' . URLHelper::getLink('dispatch.php/start'));
}
}
示例15: check_terms
function check_terms($userid, $_language_path) {
if (Request::get('i_accept_the_terms') == "yes") {
UserConfig::get($userid)->store('TERMS_ACCEPTED', 1);
return;
}
if ($GLOBALS['auth']->auth['uid'] != 'nobody' && !empty($GLOBALS['user']) && !$GLOBALS['user']->cfg->getValue('TERMS_ACCEPTED'))
{
?>
<table align="center" border="0" cellpadding="1" cellspacing="0">
<tr>
<td class="table_header_bold">
<?= Icon::create('door-enter', 'info_alt')->asImg() ?>
<b><?=_("Nutzungsbedingungen")?></b>
</td>
</tr>
<tr>
<td class="blank">
<p><br><?=_("Stud.IP ist ein Open Source Projekt und steht unter der Gnu General Public License (GPL). Das System befindet sich in der ständigen Weiterentwicklung.")?></p>
<p><?=_("Um den vollen Funktionsumfang von Stud.IP nutzen zu können, müssen Sie sich am System anmelden.")?><br>
<?=_("Das hat viele Vorzüge:")?></p>
<ul>
<li><?=_("Zugriff auf Ihre Daten von jedem internetfähigen Rechner weltweit,")?></li>
<li><?=_("Anzeige neuer Mitteilungen oder Dateien seit Ihrem letzten Besuch,")?></li>
<li><?=_("Ein eigenes Profil im System,")?></li>
<li><?=_("die Möglichkeit anderen Personen Nachrichten zu schicken oder mit ihnen zu chatten,")?></li>
<li><?=_("und vieles mehr.")?></li>
</ul>
<p><?=_("Mit der Anmeldung werden die nachfolgenden Nutzungsbedingungen akzeptiert:")?></p>
<? include("locale/$_language_path/LC_HELP/pages/nutzung.html"); ?>
<p align="center">
<a href="<?= URLHelper::getLink(Request::url(), array('i_accept_the_terms' => 'yes')) ?>"><b><?=_("Ich erkenne die Nutzungsbedingungen an")?></b></a>
</p>
<br>
</td>
</tr>
</table>
<?php
include ('lib/include/html_end.inc.php');
die;
}
}