Beispiel #1
0
 /**
  * SystemPlugins may call UpdateInformation::setInformation to set information
  * to be sent via ajax to the main request. Core-functionality-data should be
  * collected and set here.
  * @return array: array(array('js_function' => $data), ...)
  */
 protected function coreInformation()
 {
     $data = array();
     if (PersonalNotifications::isActivated()) {
         $notifications = PersonalNotifications::getMyNotifications();
         if ($notifications && count($notifications)) {
             $ret = array();
             foreach ($notifications as $notification) {
                 $info = $notification->toArray();
                 $info['html'] = $notification->getLiElement();
                 $ret[] = $info;
             }
             $data['PersonalNotifications.newNotifications'] = $ret;
         } else {
             $data['PersonalNotifications.newNotifications'] = array();
         }
     }
     $page_info = Request::getArray("page_info");
     if (stripos(Request::get("page"), "dispatch.php/messages") !== false) {
         $messages = Message::findNew($GLOBALS["user"]->id, $page_info['Messages']['received'], $page_info['Messages']['since'], $page_info['Messages']['tag']);
         $template_factory = $this->get_template_factory();
         foreach ($messages as $message) {
             $data['Messages.newMessages']['messages'][$message->getId()] = $template_factory->open("messages/_message_row.php")->render(compact("message") + array('controller' => $this));
         }
     }
     if (count($page_info['Questionnaire']['questionnaire_ids']) > 0) {
         foreach ($page_info['Questionnaire']['questionnaire_ids'] as $questionnaire_id) {
             $questionnaire = new Questionnaire($questionnaire_id);
             if ($questionnaire->latestAnswerTimestamp() > $page_info['Questionnaire']['last_update']) {
                 $template = $this->get_template_factory()->open("questionnaire/evaluate");
                 $template->set_layout(null);
                 $template->set_attribute("questionnaire", $questionnaire);
                 $data['Questionnaire.updateQuestionnaireResults'][$questionnaire->getId()] = array('html' => $template->render());
             }
         }
     }
     return $data;
 }
Beispiel #2
0
echo $current_page != "" ? _("Aktuelle Seite:") : "";
?>
    </div>
    <div id="barBottommiddle">
        <?php 
echo $current_page != "" ? htmlReady($current_page) : "";
?>
        <?php 
echo $public_hint ? '(' . htmlReady($public_hint) . ')' : '';
?>
    </div>
    <!-- Dynamische Links ohne Icons -->
    <div id="barBottomright">
        <ul>
            <? if (is_object($GLOBALS['perm']) && PersonalNotifications::isActivated() && $GLOBALS['perm']->have_perm("autor")) : ?>
            <? $notifications = PersonalNotifications::getMyNotifications() ?>
            <? $lastvisit = (int) UserConfig::get($GLOBALS['user']->id)->getValue('NOTIFICATIONS_SEEN_LAST_DATE') ?>
            <li id="notification_container"<?php 
echo count($notifications) > 0 ? ' class="hoverable"' : "";
?>
>
                <? foreach ($notifications as $notification) {
                    if ($notification['mkdate'] > $lastvisit) {
                        $alert = true;
                    }
                } ?>
                <div id="notification_marker"<?php 
echo $alert ? ' class="alert"' : "";
?>
 title="<?php 
echo _("Benachrichtigungen");