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


PHP URLHelper::addLinkParam方法代码示例

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


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

示例1: before_filter

 function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     // Remove cid
     URLHelper::removeLinkParam('cid');
     unset($_SESSION['SessionSeminar']);
     $this->set_layout($GLOBALS['template_factory']->open('layouts/base_without_infobox'));
     Navigation::activateItem('/profile/index');
     URLHelper::addLinkParam('username', Request::username('username'));
     PageLayout::setHelpKeyword('Basis.Homepage');
     SkipLinks::addIndex(_('Benutzerprofil'), 'user_profile', 100);
     $this->user = User::findCurrent();
     // current logged in user
     $this->perm = $GLOBALS['perm'];
     // perms of current logged in user
     $this->current_user = User::findByUsername(Request::username('username', $this->user->username));
     // current selected user
     // get additional informations to selected user
     $this->profile = new ProfileModel($this->current_user->user_id, $this->user->user_id);
     // set the page title depending on user selection
     if ($this->current_user['user_id'] == $this->user->id && !$this->current_user['locked']) {
         PageLayout::setTitle(_('Mein Profil'));
         UserConfig::get($this->user->id)->store('PROFILE_LAST_VISIT', time());
     } elseif ($this->current_user['user_id'] && ($this->perm->have_perm('root') || !$this->current_user['locked'] && get_visibility_by_id($this->current_user['user_id']))) {
         PageLayout::setTitle(_('Profil') . ' - ' . $this->current_user->getFullname());
         object_add_view($this->current_user->user_id);
     } else {
         PageLayout::setTitle(_('Profil'));
         $action = 'not_available';
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:31,代码来源:profile.php

示例2: isActive

 /**
  * Determine whether this navigation item is active.
  */
 public function isActive()
 {
     $active = parent::isActive();
     if ($active) {
         URLHelper::addLinkParam('username', Request::username('username'));
     }
     return $active;
 }
开发者ID:ratbird,项目名称:hope,代码行数:11,代码来源:ProfileNavigation.php

示例3: 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

示例4: index_action

 /**
  * Shows the current restrictions for course participation.
  */
 function index_action()
 {
     URLHelper::addLinkParam('return_to_dialog', Request::isDialog());
     $this->sidebar = Sidebar::get();
     $this->sidebar->setImage("sidebar/seminar-sidebar.png");
     if ($GLOBALS['perm']->have_perm('admin')) {
         $list = new SelectorWidget();
         $list->setUrl("?#admin_top_links");
         $list->setSelectParameterName("cid");
         foreach (AdminCourseFilter::get()->getCoursesForAdminWidget() as $seminar) {
             $list->addElement(new SelectElement($seminar['Seminar_id'], $seminar['Name']), 'select-' . $seminar['Seminar_id']);
         }
         $list->setSelection($this->course_id);
         $this->sidebar->addWidget($list);
     }
     $this->all_domains = UserDomain::getUserDomains();
     $this->seminar_domains = array_map(function ($d) {
         return $d->getId();
     }, UserDomain::getUserDomainsForSeminar($this->course_id));
     $this->current_courseset = CourseSet::getSetForCourse($this->course_id);
     $this->activated_admission_rules = AdmissionRule::getAvailableAdmissionRules();
     if (!$this->current_courseset) {
         $available_coursesets = new SimpleCollection();
         foreach (CourseSet::getCoursesetsByInstituteId($this->course->institut_id) as $cs) {
             $cs = new CourseSet($cs['set_id']);
             if ($cs->isUserAllowedToAssignCourse($this->user_id, $this->course_id)) {
                 $available_coursesets[] = array('id' => $cs->getId(), 'name' => $cs->getName(), 'chdate' => $cs->chdate, 'my_own' => $cs->getUserId() === $GLOBALS['user']->id);
             }
         }
         foreach (CourseSet::getglobalCoursesets() as $cs) {
             $cs = new CourseSet($cs['set_id']);
             if ($cs->isUserAllowedToAssignCourse($this->user_id, $this->course_id)) {
                 $available_coursesets[] = array('id' => $cs->getId(), 'name' => $cs->getName(), 'chdate' => $cs->chdate, 'my_own' => $cs->getUserId() === $GLOBALS['user']->id);
             }
         }
         $available_coursesets = $available_coursesets->findBy('chdate', strtotime('-1 year'), '>');
         $available_coursesets->orderBy('name');
         $this->available_coursesets = $available_coursesets;
         PageLayout::postMessage(MessageBox::info(_("Für diese Veranstaltung sind keine Anmelderegeln festgelegt. Die Veranstaltung ist damit für alle Nutzer zugänglich.")));
     } else {
         if ($this->current_courseset->isSeatDistributionEnabled() && !$this->course->admission_turnout) {
             PageLayout::postMessage(MessageBox::info(_("Diese Veranstaltung ist teilnahmebeschränkt, aber die maximale Teilnehmeranzahl ist nicht gesetzt.")));
         }
     }
     $lockdata = LockRules::getObjectRule($this->course_id);
     if ($lockdata['description'] && LockRules::CheckLockRulePermission($this->course_id, $lockdata['permission'])) {
         PageLayout::postMessage(MessageBox::info(formatLinks($lockdata['description'])));
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:52,代码来源:admission.php

示例5: before_filter

 /**
  * common tasks for all actions
  *
  * @param String $action Action that has been called
  * @param Array  $args   List of arguments
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     // user must have root permission
     $GLOBALS['perm']->check('root');
     //setting title and navigation
     PageLayout::setTitle(_('Verwaltung von Ferien'));
     Navigation::activateItem('/admin/locations/holidays');
     // Extract and bind filter option
     $this->filter = Request::option('filter');
     if ($this->filter) {
         URLHelper::addLinkParam('filter', $this->filter);
     }
     $this->setSidebar();
 }
开发者ID:ratbird,项目名称:hope,代码行数:21,代码来源:holidays.php

示例6: before_filter

 /**
  * Callback function being called before an action is executed. If this
  * function does not return FALSE, the action will be called, otherwise
  * an error will be generated and processing will be aborted. If this function
  * already #rendered or #redirected, further processing of the action is
  * withheld.
  *
  * @param string  Name of the action to perform.
  * @param array   An array of arguments to the action.
  *
  * @return bool
  */
 function before_filter(&$action, &$args)
 {
     global $user;
     parent::before_filter($action, $args);
     $zoom = Request::int('zoom');
     $this->my_schedule_settings = UserConfig::get($user->id)->SCHEDULE_SETTINGS;
     // bind zoom, show_hidden and semester_id for all actions, even preserving them after redirect
     if (isset($zoom)) {
         URLHelper::addLinkParam('zoom', Request::int('zoom'));
         $this->my_schedule_settings['zoom'] = Request::int('zoom');
         UserConfig::get($user->id)->store('SCHEDULE_SETTINGS', $this->my_schedule_settings);
     }
     URLHelper::bindLinkParam('semester_id', $this->current_semester['semester_id']);
     URLHelper::bindLinkParam('show_hidden', $this->show_hidden);
     PageLayout::setHelpKeyword('Basis.MyStudIPStundenplan');
     PageLayout::setTitle(_('Mein Stundenplan'));
 }
开发者ID:ratbird,项目名称:hope,代码行数:29,代码来源:schedule.php

示例7: before_filter

 /**
  * Sets up the controller
  *
  * @param String $action Which action shall be invoked
  * @param Array $args Arguments passed to the action method
  */
 public function before_filter(&$action, &$args)
 {
     // Abwärtskompatibilität, erst ab 1.1 bekannt
     if (!isset($GLOBALS['ALLOW_CHANGE_NAME'])) {
         $GLOBALS['ALLOW_CHANGE_NAME'] = TRUE;
     }
     parent::before_filter($action, $args);
     // Ensure user is logged in
     $GLOBALS['auth']->login_if($action !== 'logout' && $GLOBALS['auth']->auth['uid'] === 'nobody');
     // extract username
     $username = Request::username('username', $GLOBALS['user']->username);
     $user = User::findByUsername($username);
     if (!$GLOBALS['perm']->have_profile_perm('user', $user->user_id)) {
         $username = $GLOBALS['user']->username;
     } else {
         $username = $user->username;
         URLHelper::addLinkParam('username', $username);
     }
     $this->about = new about($username, null);
     $this->about->get_user_details();
     if (!$this->about->check) {
         $this->reportErrorWithDetails(_('Zugriff verweigert.'), array(_("Wahrscheinlich ist Ihre Session abgelaufen. Bitte " . "nutzen Sie in diesem Fall den untenstehenden Link, " . "um zurück zur Anmeldung zu gelangen.\n\n" . "Eine andere Ursache kann der Versuch des Zugriffs " . "auf Userdaten, die Sie nicht bearbeiten dürfen, sein. " . "Nutzen Sie den untenstehenden Link, um zurück auf " . "die Startseite zu gelangen."), sprintf(_('%s Hier%s geht es wieder zur Anmeldung beziehungsweise Startseite.'), '<a href="index.php">', '</a>')));
         $this->render_nothing();
         return;
     }
     $this->user = User::findByUsername($username);
     $this->restricted = $GLOBALS['perm']->get_profile_perm($this->user->user_id) !== 'user' && $username !== $GLOBALS['user']->username;
     $this->config = UserConfig::get($this->user->user_id);
     $this->validator = new email_validation_class();
     # Klasse zum Ueberpruefen der Eingaben
     $this->validator->timeout = 10;
     // Default auth plugin to standard
     if (!$this->user->auth_plugin) {
         $this->user->auth_plugin = 'standard';
     }
     PageLayout::addSqueezePackage('settings');
     // Show info message if user is not on his own profile
     if ($username != $GLOBALS['user']->username) {
         $message = sprintf(_('Daten von: %s %s (%s), Status: %s'), htmlReady($this->user->Vorname), htmlReady($this->user->Nachname), $username, $this->user->perms);
         $this->reportInfo($message);
     }
     Sidebar::get()->setImage('sidebar/person-sidebar.png');
     $this->set_layout($GLOBALS['template_factory']->open('layouts/base'));
 }
开发者ID:ratbird,项目名称:hope,代码行数:50,代码来源:settings.php

示例8: testGetLink

 public function testGetLink()
 {
     URLHelper::addLinkParam('foo', '& ;');
     URLHelper::addLinkParam('bar', '"\'');
     $url = 'abc?a=%26&c="d#1';
     $expected = 'abc?foo=%26+%3B&amp;bar=%22%27&amp;a=%26&amp;c=%22d#1';
     $this->assertEquals($expected, URLHelper::getLink($url));
 }
开发者ID:ratbird,项目名称:hope,代码行数:8,代码来源:UrlHelperTest.php

示例9: store_action

 /**
  * Stores the account informations of a user
  */
 public function store_action()
 {
     $this->check_ticket();
     $errors = $info = $success = array();
     $logout = false;
     //erstmal die "unwichtigen" Daten
     $geschlecht = Request::int('geschlecht');
     if ($this->shallChange('user_info.geschlecht', 'gender', $geschlecht)) {
         $this->user->geschlecht = $geschlecht;
     }
     $title_front = Request::get('title_front') ?: Request::get('title_front_chooser');
     if ($this->shallChange('user_info.title_front', 'title', $title_front)) {
         $this->user->title_front = $title_front;
     }
     $title_rear = Request::get('title_rear') ?: Request::get('title_rear_chooser');
     if ($this->shallChange('user_info.title_rear', 'title', $title_rear)) {
         $this->user->title_rear = $title_rear;
     }
     if ($this->user->store()) {
         $success[] = _('Ihre persönlichen Daten wurden geändert.');
         // Inform the user about this change
         setTempLanguage($this->user->user_id);
         $this->postPrivateMessage(_("Ihre persönlichen Daten wurden geändert.\n"));
         restoreLanguage();
     }
     //nur nötig wenn der user selbst seine daten ändert
     if (!$this->restricted) {
         // Vorname verändert ?
         $vorname = trim(Request::get('vorname'));
         if ($this->shallChange('auth_user_md5.Vorname', 'name', $vorname)) {
             // Vorname nicht korrekt oder fehlend
             if (!$this->validator->ValidateName($vorname)) {
                 $errors[] = _('Der Vorname fehlt oder ist unsinnig!');
             } else {
                 $this->user->Vorname = $vorname;
                 $success[] = _('Ihr Vorname wurde geändert!');
             }
         }
         // Nachname verändert ?
         $nachname = trim(Request::get('nachname'));
         if ($this->shallChange('auth_user_md5.Nachname', 'name', $nachname)) {
             // Nachname nicht korrekt oder fehlend
             if (!$this->validator->ValidateName($nachname)) {
                 $errors[] = _('Der Nachname fehlt oder ist unsinnig!');
             } else {
                 $this->user->Nachname = $nachname;
                 $success[] = _('Ihr Nachname wurde geändert!');
             }
         }
         // Username
         $new_username = trim(Request::get('new_username'));
         if ($this->shallChange('auth_user_md5.username', 'username', $new_username)) {
             if (!$this->validator->ValidateUsername($new_username)) {
                 $errors[] = _('Der gewählte Benutzername ist nicht lang genug!');
             } else {
                 if ($check_uname = StudipAuthAbstract::CheckUsername($new_username) && $check_uname['found']) {
                     $errors[] = _('Der Benutzername wird bereits von einem anderen Benutzer verwendet. Bitte wählen Sie einen anderen Usernamen!');
                 } else {
                     $this->user->username = $new_username;
                     $success[] = _('Ihr Benutzername wurde geändert!');
                     URLHelper::addLinkParam('username', $this->user->username);
                     $logout = true;
                 }
             }
         }
         // Email
         $email1 = trim(Request::get('email1'));
         $email2 = trim(Request::get('email2'));
         if ($this->shallChange('auth_user_md5.Email', 'email', $email1)) {
             $auth = StudipAuthAbstract::GetInstance($this->user->auth_plugin ?: 'standard');
             $is_sso = $auth instanceof StudipAuthSSO;
             if (!$is_sso && !$auth->isAuthenticated($this->user->username, Request::get('password'))) {
                 $errors[] = _('Das aktuelle Passwort wurde nicht korrekt eingegeben.');
             } else {
                 if ($email1 !== $email2) {
                     $errors[] = _('Die Wiederholung der E-Mail-Adresse stimmt nicht mit Ihrer Eingabe überein.');
                 } else {
                     $result = edit_email($this->user, $email1);
                     $messages = explode('§', $result[1]);
                     if ($result[0]) {
                         $this->user->Email = $email1;
                         if (count($messages) < 2) {
                             $success[] = _('Ihre E-Mail-Adresse wurde geändert!');
                         }
                     }
                     for ($i = 0; $i < count($messages); $i += 2) {
                         $type = $messages[$i];
                         if ($type === 'msg') {
                             $type = 'success';
                         } else {
                             if ($type === 'error') {
                                 $type = 'errors';
                             }
                         }
                         ${$type}[] = $messages[$i + 1];
                     }
                 }
//.........这里部分代码省略.........
开发者ID:ratbird,项目名称:hope,代码行数:101,代码来源:account.php

示例10: selectInst

/**
 * This function "selects" an Einrichtung to work with it
 *
 * Note: Stud.IP treats Einrichtungen like Veranstaltungen, yu can see this
 * especially if you look at the variable names....
 *
 * The following variables will bet set:
 *   $SessionSeminar                 Einrichtung id<br>
 *   $SessSemName[0]                 Einrichtung name<br>
 *   $SessSemName[1]                 Einrichtung id<br>
 *   $SessSemName["art"]             Einrichtung type in alphanumeric form<br>
 *   $SessSemName["art_num"]         Einrichtung type in numeric form<br>
 *   $SessSemName["art_generic"]     Einrichtung generic type in alhanumeric form (self description)<br>
 *   $SessSemName["class"]               Einrichtung class (sem or inst, in this function always inst)<br>
 *   $SessSemName["header_line"]     the header-line to use on every page of the Einrichtung<br>
 *
 * @param string $inst_id the id of the Veranstaltung
 *
 * @return boolean  true if successful
 *
 */
function selectInst($inst_id)
{
    global $SessionSeminar, $SessSemName, $INST_TYPE, $SemUserStatus, $rechte, $perm, $auth;
    closeObject();
    if (!get_config('ENABLE_FREE_ACCESS') && !$perm->have_perm('user')) {
        // redirect to login page if user is not logged in
        $auth->login_if($auth->auth["uid"] == "nobody");
        throw new AccessDeniedException();
    }
    $SessionSeminar = $inst_id;
    $institute = Institute::findCurrent();
    if ($institute) {
        if (!($SemUserStatus = $perm->get_studip_perm($institute["Institut_id"]))) {
            $SemUserStatus = 'nobody';
        }
        $rechte = $perm->have_studip_perm("tutor", $institute["Institut_id"]);
        $SessionSeminar = $institute["Institut_id"];
        $SessSemName[0] = $institute["Name"];
        $SessSemName[1] = $institute["Institut_id"];
        $SessSemName["art_generic"] = _("Einrichtung");
        $SessSemName["art"] = $INST_TYPE[$row["type"]]["name"];
        if (!$SessSemName["art"]) {
            $SessSemName["art"] = $SessSemName["art_generic"];
        }
        $SessSemName["class"] = "inst";
        $SessSemName["is_fak"] = $institute["is_fak"];
        $SessSemName["art_num"] = $institute["type"];
        $SessSemName["fak"] = $institute["fakultaets_id"];
        $SessSemName["header_line"] = $institute->getFullname();
        $_SESSION['SessionSeminar'] =& $SessionSeminar;
        $_SESSION['SessSemName'] =& $SessSemName;
        URLHelper::addLinkParam('cid', $SessionSeminar);
        return true;
    } else {
        $SessionSeminar = null;
        return false;
    }
}
开发者ID:ratbird,项目名称:hope,代码行数:59,代码来源:functions.php

示例11: elseif

if (in_array(Request::get('view'), words('listnew listall export'))) {
    Navigation::activateItem('/course/wiki/' . $view);
} else {
    Navigation::activateItem('/course/wiki/show');
}
if (Request::option('wiki_comments') == "all") {
    // show all comments
    $show_wiki_comments = "all";
} elseif (Request::option('wiki_comments') == "none") {
    // don't show comments
    $show_wiki_comments = "none";
} else {
    // show comments as icons
    $show_wiki_comments = "icon";
}
URLHelper::addLinkParam('wiki_comments', $show_wiki_comments);
ob_start();
// ---------- Start of main WikiLogic
if ($view == "listall") {
    //
    // list all pages, default sorting = alphabetically
    //
    SkipLinks::addIndex(_("Alle Seiten"), 'main_content', 100);
    listPages("all", Request::option('sortby'));
} else {
    if ($view == "listnew") {
        //
        // list new pages, default sorting = newest first
        //
        SkipLinks::addIndex(_("Neue Seiten"), 'main_content', 100);
        listPages("new", Request::option('sortby'));
开发者ID:ratbird,项目名称:hope,代码行数:31,代码来源:wiki.php

示例12: foreach

?>
                <?php 
echo Icon::create('upload', 'clickable')->asImg(['class' => "text-bottom upload"]);
?>
            </label>
        </div>
    </div>
<? endif ?>

<ul id="blubber_threads" class="profilestream" aria-live="polite" aria-relevant="additions">
    <? foreach ($threads as $thread) : ?>
    <?php 
echo $this->render_partial("streams/_blubber.php", array('thread' => $thread));
?>
    <? endforeach ?>
    <? if ($more_threads) : ?>
    <li class="more"><?php 
echo Assets::img("ajax_indicator_small.gif", array('alt' => "loading"));
?>
</li>
    <? endif ?>
</ul>

<?

$sidebar = Sidebar::get();
$sidebar->setImage("sidebar/blubber-sidebar");
$sidebar->setContextAvatar(Avatar::getAvatar($user->getId()));
URLHelper::addLinkParam('user_id', $user->getId());
$controller->addTagCloudWidgetToSidebar($tags, 'profile');
开发者ID:ratbird,项目名称:hope,代码行数:30,代码来源:profile.php

示例13: edit_element_action

 /**
  * Displays page to add new or edit existing literature element
  */
 public function edit_element_action()
 {
     if (Request::option('reload')) {
         $this->reload = true;
     }
     if (Request::option('cmd') == "new_entry") {
         $_catalog_id = "new_entry";
     } else {
         $_catalog_id = Request::option('_catalog_id', "new_entry");
     }
     if (Request::option('return_range')) {
         $this->return_range = Request::option('return_range');
         URLHelper::addLinkParam('return_range', $this->return_range);
     }
     if ($_catalog_id == "new_entry") {
         $title = _("Literatureintrag anlegen");
     } else {
         $title = _("Literatureintrag bearbeiten");
     }
     PageLayout::setTitle($title);
     Navigation::activateItem('/tools/literature');
     //dump data into db if $_catalog_id points to a search result
     if ($_catalog_id[0] == "_") {
         $parts = explode("__", $_catalog_id);
         if ($fields = $_SESSION[$parts[0]][$parts[1]]) {
             $cat_element = new StudipLitCatElement();
             $cat_element->setValues($fields);
             $cat_element->setValue("catalog_id", "new_entry");
             $cat_element->setValue("user_id", "studip");
             if ($existing_element = $cat_element->checkElement()) {
                 $cat_element->setValue('catalog_id', $existing_element);
             }
             $cat_element->insertData();
             $_catalog_id = $cat_element->getValue("catalog_id");
             $_SESSION[$parts[0]][$parts[1]]['catalog_id'] = $_catalog_id;
             unset($cat_element);
         }
     }
     if (Request::option('cmd') == 'clone_entry') {
         $_the_element = StudipLitCatElement::GetClonedElement($_catalog_id);
         if ($_the_element->isNewEntry()) {
             $_msg = "msg§" . _("Der Eintrag wurde kopiert, Sie können die Daten jetzt ändern.") . "§";
             $_msg .= "info§" . _("Der kopierte Eintrag wurde noch nicht gespeichert.") . "§";
             //$old_cat_id = $_catalog_id;
             $_catalog_id = $_the_element->getValue('catalog_id');
         } else {
             $_msg = "error§" . _("Der Eintrag konnte nicht kopiert werden!.") . "§";
         }
     }
     if (!is_object($_the_element)) {
         $_the_element = new StudipLitCatElement($_catalog_id, true);
     }
     $_the_form = $_the_element->getFormObject();
     $_the_clipboard = StudipLitClipBoard::GetInstance();
     $_the_clip_form = $_the_clipboard->getFormObject();
     if (isset($old_cat_id) && $_the_clipboard->isInClipboard($old_cat_id)) {
         $_the_clipboard->deleteElement($old_cat_id);
         $_the_clipboard->insertElement($_catalog_id);
     }
     $_the_clip_form->form_fields['clip_cmd']['options'][] = array('name' => _("In Merkliste eintragen"), 'value' => 'ins');
     $_the_clip_form->form_fields['clip_cmd']['options'][] = array('name' => _("Markierten Eintrag bearbeiten"), 'value' => 'edit');
     if ($_the_form->IsClicked("reset") || Request::option('cmd') == "new_entry") {
         $_the_form->doFormReset();
     }
     if ($_the_form->IsClicked("delete") && $_catalog_id != "new_entry" && $_the_element->isChangeable()) {
         if ($_the_element->reference_count) {
             $_msg = "info§" . sprintf(_("Sie können diesen Eintrag nicht löschen, da er noch in %s Literaturlisten referenziert wird."), $_the_element->reference_count) . "§";
         } else {
             $_msg = "info§" . _("Wollen Sie diesen Eintrag wirklich löschen?") . "<br>" . LinkButton::createAccept(_('Ja'), URLHelper::getURL('?cmd=delete_element&_catalog_id=' . $_catalog_id), array('title' => _('löschen'))) . "&nbsp;" . LinkButton::createCancel(_('Abbrechen'), URLHelper::getURL('?_catalog_id=' . $_catalog_id), array('title' => _('abbrechen'))) . "§";
         }
     }
     if (Request::option('cmd') == "delete_element" && $_the_element->isChangeable() && !$_the_element->reference_count) {
         $_the_element->deleteElement();
         $this->reload = true;
     }
     if (Request::option('cmd') == "in_clipboard" && $_catalog_id != "new_entry") {
         $_the_clipboard->insertElement($_catalog_id);
         $this->reload = true;
     }
     if (Request::option('cmd') == "check_entry") {
         $lit_plugin_value = $_the_element->getValue('lit_plugin');
         $check_result = StudipLitSearch::CheckZ3950($_the_element->getValue('accession_number'));
         $content = "<div style=\"font-size:70%\"<b>" . _("Verfügbarkeit in externen Katalogen:") . "</b><br>";
         if (is_array($check_result)) {
             foreach ($check_result as $plugin_name => $ret) {
                 $content .= "<b>&nbsp;" . htmlReady(StudipLitSearch::GetPluginDisplayName($plugin_name)) . "&nbsp;</b>";
                 if ($ret['found']) {
                     $content .= _("gefunden") . "&nbsp;";
                     $_the_element->setValue('lit_plugin', $plugin_name);
                     if ($link = $_the_element->getValue("external_link")) {
                         $content .= formatReady(" [" . $_the_element->getValue("lit_plugin_display_name") . "]" . $link);
                     } else {
                         $content .= _("(Kein Link zum Katalog vorhanden.)");
                     }
                 } elseif (count($ret['error'])) {
                     $content .= '<span style="color:red;">' . htmlReady($ret['error'][0]['msg']) . '</span>';
                 } else {
//.........这里部分代码省略.........
开发者ID:ratbird,项目名称:hope,代码行数:101,代码来源:literature.php

示例14: display_action

 /**
  * Widget controller to produce the formally known show_votes()
  *
  * @param String $range_id range id of the news to get displayed
  * @return array() Array of votes
  */
 function display_action($range_id)
 {
     if (!$range_id) {
         $this->set_status(400);
         return $this->render_nothing();
     }
     if (!StudipNews::haveRangePermission('view', $range_id, $GLOBALS['user']->id)) {
         $this->set_status(401);
         return $this->render_nothing();
     }
     // Check if user wrote a comment
     if (Request::submitted('accept') && trim(Request::get('comment_content')) && Request::isPost()) {
         CSRFProtection::verifySecurityToken();
         StudipComment::create(array('object_id' => Request::get('comsubmit'), 'user_id' => $GLOBALS['user']->id, 'content' => trim(Request::get('comment_content'))));
     }
     // Check if user wants to remove a announcement
     if ($news_id = Request::get('remove_news')) {
         $news = new StudipNews($news_id);
         $range = Request::get('news_range');
         if ($news->havePermission('unassign', $range)) {
             if (Request::get('confirm')) {
                 $news->deleteRange($range);
                 $news->store();
             } else {
                 $this->question = createQuestion(_('Ankündigung wirklich aus diesem Bereich entfernen?'), array('remove_news' => $news_id, 'news_range' => $range, 'confirm' => true));
             }
         }
     }
     // Check if user wants to delete an announcement
     if ($news_id = Request::get('delete_news')) {
         $news = new StudipNews($news_id);
         if ($news->havePermission('delete')) {
             if (Request::get('confirm')) {
                 $news->delete();
             } else {
                 $this->question = createQuestion(_('Ankündigung wirklich löschen?'), array('delete_news' => $news_id, 'confirm' => true));
             }
         }
     }
     $this->perm = StudipNews::haveRangePermission('edit', $range_id);
     $this->show_all_news = Request::get('nshow_all') && $this->perm;
     $news = StudipNews::GetNewsByRange($range_id, !$this->show_all_news);
     if ($this->show_all_news) {
         URLHelper::addLinkParam('nshow_all', 1);
     }
     $this->news = StudipNews::GetNewsByRange($range_id, !$this->show_all_news, true);
     $this->count_all_news = $this->show_all_news ? count($this->news) : count(StudipNews::GetNewsByRange($range_id, false));
     $this->rss_id = get_config('NEWS_RSS_EXPORT_ENABLE') ? StudipNews::GetRssIdFromRangeId($range_id) : false;
     $this->range = $range_id;
     $this->nobody = !$GLOBALS['user']->id || $GLOBALS['user']->id == 'nobody';
     $this->visit();
 }
开发者ID:ratbird,项目名称:hope,代码行数:58,代码来源:news.php

示例15: array

$open = Request::option('open');
$close = Request::option('close');
$check_all = Request::option('check_all');

//Switch fuer die Ansichten
URLHelper::bindLinkParam('data', $folder_system_data);
if (Request::option('cmd') == 'tree') {
    URLHelper::removeLinkParam('data');
    $folder_system_data = array();
    $folder_system_data['cmd'] = 'tree';
    URLHelper::addLinkParam('data', $folder_system_data);
} elseif (Request::option('cmd') == 'all') {
    URLHelper::removeLinkParam('data');
    $folder_system_data = array();
    $folder_system_data['cmd'] = 'all';
    URLHelper::addLinkParam('data', $folder_system_data);
} elseif(!isset($folder_system_data['cmd'])) {
    $folder_system_data['cmd'] = 'all';
}

if (Request::option('orderby')) {
    $folder_system_data['orderby'] = Request::option('orderby');
}

///////////////////////////////////////////////////////////
//Zip-Download-Funktionen
///////////////////////////////////////////////////////////
if (Request::get('folderzip')) {
    $zip_file_id = createFolderZip(Request::option('folderzip'), true, true);
    if($zip_file_id){
        $query = "SELECT name FROM folder WHERE folder_id = ?";
开发者ID:ratbird,项目名称:hope,代码行数:31,代码来源:folder.php


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