Beispiel #1
0
/**
 * \brief Smarty modifier plugin to create user links with optional mouseover info
 *
 * - type:     modifier
 * - name:     userlink
 * - purpose:  to return a user link
 *
 * @author
 * @param string class (optional)
 * @param string idletime (optional)
 * @param string fullname (optional)
 * @param integer max_length (optional)
 * @return string user link
 *
 * Syntax: {$foo|userlink[:"<class>"][:"<idletime>"][:"<fullname>"][:<max_length>]} (optional params in brackets)
 *
 * Example: {$userinfo.login|userlink:'link':::25}
 */
function smarty_modifier_userlink($other_user, $class = 'userlink', $idletime = 'not_set', $fullname = '', $max_length = 0, $popup = 'y')
{
    if (empty($other_user)) {
        return "";
    }
    if (is_array($other_user)) {
        if (count($other_user) > 1) {
            $other_user = array_map(function ($username) use($class, $idletime, $popup) {
                return smarty_modifier_userlink($username, $class, $idletime, '', 0, $popup);
            }, $other_user);
            $last = array_pop($other_user);
            return tr('%0 and %1', implode(', ', $other_user), $last);
        } else {
            $other_user = reset($other_user);
        }
    }
    if (!$fullname) {
        $fullname = TikiLib::lib('user')->clean_user($other_user);
    }
    if ($max_length) {
        TikiLib::lib('smarty')->loadPlugin('smarty_modifier_truncate');
        $fullname = smarty_modifier_truncate($fullname, $max_length, '...', true);
    }
    if ($popup === 'y') {
        return TikiLib::lib('user')->build_userinfo_tag($other_user, $fullname, $class);
    } else {
        return $fullname;
    }
}
function smarty_function_object_link_user($smarty, $user, $title = null)
{
    $smarty->loadPlugin('smarty_modifier_userlink');
    return smarty_modifier_userlink($user, 'link', 'not_set', $title ? $title : '');
}
 function since_last_visit_new($user, $params = null)
 {
     if (!$user) {
         return false;
     }
     global $tikilib, $userlib, $prefs;
     $ret = array();
     $ret["label"] = tra("Since your last visit");
     if ($params == null) {
         $params = array();
     }
     if ((empty($params['calendar_focus']) || $params['calendar_focus'] != 'ignore') && strpos($_SERVER["SCRIPT_NAME"], "tiki-calendar.php") && isset($_REQUEST["todate"]) && $_REQUEST["todate"]) {
         $last = $_REQUEST["todate"];
         $_SESSION["slvn_last_login"] = $last;
         $ret["label"] = tra("Changes") . " " . tra("since");
     } else {
         if (isset($_SESSION["slvn_last_login"])) {
             $last = $_SESSION["slvn_last_login"];
             $ret["label"] = tra("Changes since");
         } else {
             $last = $tikilib->getOne("select `lastLogin`  from `users_users` where `login`=?", array($user));
             if (!$last) {
                 $last = time();
             }
         }
     }
     $ret["lastLogin"] = $last;
     //if (!isset($_SESSION["slvn_last_login"])) $_SESSION["slvn_last_login"] = $last;
     //$last = strtotime ("-2 week");
     $ret["items"]["comments"]["label"] = tra("new comments");
     $ret["items"]["comments"]["cname"] = "slvn_comments_menu";
     $query = "select `object`,`objectType`,`title`,`commentDate`,`userName`,`threadId`, `parentId` from `tiki_comments` where `commentDate`>? and `objectType` != 'forum' order by `commentDate` desc";
     $result = $tikilib->query($query, array((int) $last));
     $count = 0;
     while ($res = $result->fetchRow()) {
         switch ($res["objectType"]) {
             case "article":
                 $perm = 'tiki_p_read_article';
                 $ret["items"]["comments"]["list"][$count]["href"] = "tiki-read_article.php?articleId=" . $res["object"];
                 break;
             case "post":
                 $perm = 'tiki_p_read_blog';
                 $ret["items"]["comments"]["list"][$count]["href"] = "tiki-view_blog_post.php?postId=" . $res["object"];
                 break;
             case "blog":
                 $perm = 'tiki_p_read_blog';
                 $ret["items"]["comments"]["list"][$count]["href"] = "tiki-view_blog.php?blogId=" . $res["object"];
                 break;
             case "faq":
                 $perm = 'tiki_p_view_faqs';
                 $ret["items"]["comments"]["list"][$count]["href"] = "tiki-view_faq.php?faqId=" . $res["object"];
                 break;
             case "file gallery":
                 $perm = 'tiki_p_view_file_gallery';
                 $ret["items"]["comments"]["list"][$count]["href"] = "tiki-list_file_gallery.php?galleryId=" . $res["object"];
                 break;
             case "image gallery":
                 $perm = 'tiki_p_view_image_gallery';
                 $ret["items"]["comments"]["list"][$count]["href"] = "tiki-browse_gallery.php?galleryId=" . $res["object"];
                 break;
             case "poll":
                 $ret["items"]["comments"]["list"][$count]["href"] = "tiki-poll_results.php?pollId=" . $res["object"];
                 break;
             case "wiki page":
                 $perm = 'tiki_p_view';
                 $ret["items"]["comments"]["list"][$count]["href"] = "tiki-index.php?page=" . urlencode($res["object"]);
                 break;
             default:
                 $perm = 'tiki_p_read_comments';
                 break;
         }
         if (!isset($perm) || $userlib->user_has_perm_on_object($user, $res['object'], $res['objectType'], $perm)) {
             if (isset($ret["items"]["comments"]["list"][$count]["href"])) {
                 $ret["items"]["comments"]["list"][$count]["href"] .= '&comzone=show#threadId' . $res['threadId'];
             }
             $ret["items"]["comments"]["list"][$count]["title"] = $tikilib->get_short_datetime($res["commentDate"]) . " " . tra("by") . " " . trim(strip_tags(smarty_modifier_userlink($res["userName"])));
             $ret["items"]["comments"]["list"][$count]["label"] = $res["title"];
             $count++;
         }
     }
     $ret["items"]["comments"]["count"] = $count;
     if ($prefs['feature_forums'] == 'y') {
         $ret["items"]["posts"]["label"] = tra("new posts");
         $ret["items"]["posts"]["cname"] = "slvn_posts_menu";
         $query = "select `object`,`objectType`,`title`,`commentDate`,`userName`,`threadId`, `parentId` from `tiki_comments` where `commentDate`>? and `objectType` = 'forum' order by `commentDate` desc";
         $result = $tikilib->query($query, array((int) $last));
         $count = 0;
         while ($res = $result->fetchRow()) {
             if ($userlib->user_has_perm_on_object($user, $res['object'], $res['objectType'], 'tiki_p_forum_read')) {
                 $ret["items"]["posts"]["list"][$count]["href"] = "tiki-view_forum_thread.php?forumId=" . $res["object"] . "&comments_parentId=";
                 if ($res["parentId"]) {
                     $ret["items"]["posts"]["list"][$count]["href"] .= $res["parentId"] . '#threadId' . $res['threadId'];
                 } else {
                     $ret["items"]["posts"]["list"][$count]["href"] .= $res["threadId"];
                 }
                 $ret["items"]["posts"]["list"][$count]["title"] = $tikilib->get_short_datetime($res["commentDate"]) . " " . tra("by") . " " . trim(strip_tags(smarty_modifier_userlink($res["userName"])));
                 $ret["items"]["posts"]["list"][$count]["label"] = $res["title"];
                 ++$count;
             }
         }
         $ret["items"]["posts"]["count"] = $count;
     }
     if ($prefs['feature_wiki'] == 'y') {
         // && $tikilib->getOne("select count(*) from `tiki_pages` where `lastModif`>?",array((int)$last))!=0) {
         $ret["items"]["pages"]["label"] = tra("wiki pages changed");
         $ret["items"]["pages"]["cname"] = "slvn_pages_menu";
         $query = "select `pageName`, `user`, `lastModif`  from `tiki_pages` where `lastModif`>? order by `lastModif` desc";
         $result = $tikilib->query($query, array((int) $last));
         $count = 0;
         while ($res = $result->fetchRow()) {
             if ($userlib->user_has_perm_on_object($user, $res['pageName'], 'wiki page', 'tiki_p_view')) {
                 $ret["items"]["pages"]["list"][$count]["href"] = "tiki-index.php?page=" . urlencode($res["pageName"]);
                 $ret["items"]["pages"]["list"][$count]["title"] = $tikilib->get_short_datetime($res["lastModif"]);
                 if ($prefs['wiki_authors_style'] != 'lastmodif') {
                     $ret["items"]["pages"]["list"][$count]["title"] .= " " . tra("by") . " " . trim(strip_tags(smarty_modifier_userlink($res["user"])));
                 }
                 $ret["items"]["pages"]["list"][$count]["label"] = $res["pageName"];
                 $count++;
             }
         }
         $ret["items"]["pages"]["count"] = $count;
     }
     if ($prefs['feature_articles'] == 'y') {
         $ret["items"]["articles"]["label"] = tra("new articles");
         $ret["items"]["articles"]["cname"] = "slvn_articles_menu";
         if ($userlib->user_has_permission($user, "tiki_p_edit_article")) {
             $query = "select `articleId`,`title`,`publishDate`,`authorName` from `tiki_articles` where `created`>? and `expireDate`>?";
             $bindvars = array((int) $last, time());
         } else {
             $query = "select `articleId`,`title`,`publishDate`,`authorName` from `tiki_articles` where `publishDate`>? and `publishDate`<=? and `expireDate`>?";
             $bindvars = array((int) $last, time(), time());
         }
         $result = $tikilib->query($query, $bindvars);
         $count = 0;
         while ($res = $result->fetchRow()) {
             if ($userlib->user_has_perm_on_object($user, $res['articleId'], 'article', 'tiki_p_read_article')) {
                 $ret["items"]["articles"]["list"][$count]["href"] = "tiki-read_article.php?articleId=" . $res["articleId"];
                 $ret["items"]["articles"]["list"][$count]["title"] = $tikilib->get_short_datetime($res["publishDate"]) . " " . tra("by") . " " . $res["authorName"];
                 $ret["items"]["articles"]["list"][$count]["label"] = $res["title"];
                 $count++;
             }
         }
         $ret["items"]["articles"]["count"] = $count;
     }
     if ($prefs['feature_submissions'] == 'y' && $userlib->user_has_permission($user, "tiki_p_edit_submission")) {
         $ret["items"]["submissions"]["label"] = tra("new submissions");
         $ret["items"]["submissions"]["cname"] = "slvn_submissions_menu";
         $query = "select `subId`,`title`,`publishDate`,`authorName` from `tiki_submissions` where `created`>? and `expireDate`>?";
         $bindvars = array((int) $last, time());
         $result = $tikilib->query($query, $bindvars);
         $count = 0;
         while ($res = $result->fetchRow()) {
             if ($userlib->user_has_perm_on_object($user, $res['subId'], 'submission', 'tiki_p_edit_submission')) {
                 $ret["items"]["submissions"]["list"][$count]["href"] = "tiki-edit_submission.php?subId=" . $res["subId"];
                 $ret["items"]["submissions"]["list"][$count]["title"] = $tikilib->get_short_datetime($res["publishDate"]) . " " . tra("by") . " " . $res["authorName"];
                 $ret["items"]["submissions"]["list"][$count]["label"] = $res["title"];
                 $count++;
             }
         }
         $ret["items"]["submissions"]["count"] = $count;
     }
     if ($prefs['feature_faqs'] == 'y') {
         $ret["items"]["faqs"]["label"] = tra("new FAQs");
         $ret["items"]["faqs"]["cname"] = "slvn_faqs_menu";
         $query = "select `faqId`, `title`, `created`  from `tiki_faqs` where `created`>? order by `created` desc";
         $result = $tikilib->query($query, array((int) $last));
         $count = 0;
         while ($res = $result->fetchRow()) {
             if ($userlib->user_has_perm_on_object($user, $res['faqId'], 'faq', 'tiki_p_view_faqs')) {
                 $ret["items"]["faqs"]["list"][$count]["href"] = "tiki-view_faq.php?faqId=" . $res["faqId"];
                 $ret["items"]["faqs"]["list"][$count]["title"] = $tikilib->get_short_datetime($res["created"]);
                 $ret["items"]["faqs"]["list"][$count]["label"] = $res["title"];
                 $count++;
             }
         }
         $ret["items"]["faqs"]["count"] = $count;
     }
     // directories
     if ($prefs['feature_directory'] == 'y') {
         $ret["items"]["dirs"]["label"] = tra("new sites");
         $ret["items"]["dirs"]["cname"] = "slvn_dirs_menu";
         $query = "select `siteId`, `name`, `lastModif`  from `tiki_directory_sites` where lastModif>? order by `lastModif` desc";
         $result = $tikilib->query($query, array((int) $last));
         $count = 0;
         while ($res = $result->fetchRow()) {
             if ($userlib->user_has_perm_on_object($user, $res['siteId'], 'directory', 'tiki_p_view_directory')) {
                 $ret["items"]["dirs"]["list"][$count]["href"] = "tiki-directory_redirect.php?siteId=" . $res["siteId"];
                 $ret["items"]["dirs"]["list"][$count]["title"] = $tikilib->get_short_datetime($res["lastModif"]);
                 $ret["items"]["dirs"]["list"][$count]["label"] = $res["name"];
                 $count++;
             }
         }
         $ret["items"]["dirs"]["count"] = $count;
     }
     if ($prefs['feature_blogs'] == 'y') {
         $ret["items"]["blogs"]["label"] = tra("new blogs");
         $ret["items"]["blogs"]["cname"] = "slvn_blogs_menu";
         $query = "select `blogId`, `title`, `user`, `created`  from `tiki_blogs` where `created`>? order by `created` desc";
         $result = $tikilib->query($query, array((int) $last));
         $count = 0;
         while ($res = $result->fetchRow()) {
             if ($userlib->user_has_perm_on_object($user, $res['blogId'], 'blog', 'tiki_p_read_blog')) {
                 $ret["items"]["blogs"]["list"][$count]["href"] = "tiki-view_blog.php?blogId=" . $res["blogId"];
                 $ret["items"]["blogs"]["list"][$count]["title"] = $tikilib->get_short_datetime($res["created"]) . " " . tra("by") . " " . trim(strip_tags(smarty_modifier_userlink($res["user"])));
                 $ret["items"]["blogs"]["list"][$count]["label"] = $res["title"];
                 $count++;
             }
         }
         $ret["items"]["blogs"]["count"] = $count;
         $ret["items"]["blogPosts"]["label"] = tra("new blog posts");
         $ret["items"]["blogPosts"]["cname"] = "slvn_blogPosts_menu";
         $query = "select `postId`, `blogId`, `title`, `user`, `created`  from `tiki_blog_posts` where `created`>? order by `created` desc";
         $result = $tikilib->query($query, array((int) $last));
         $count = 0;
         while ($res = $result->fetchRow()) {
             if ($userlib->user_has_perm_on_object($user, $res['blogId'], 'blog', 'tiki_p_read_blog')) {
                 $ret["items"]["blogPosts"]["list"][$count]["href"] = "tiki-view_blog_post.php?blogId=" . $res["blogId"] . "&postId=" . $res["postId"];
                 $ret["items"]["blogPosts"]["list"][$count]["title"] = $tikilib->get_short_datetime($res["created"]) . " " . tra("by") . " " . trim(strip_tags(smarty_modifier_userlink($res["user"])));
                 $ret["items"]["blogPosts"]["list"][$count]["label"] = $res["title"];
                 $count++;
             }
         }
         $ret["items"]["blogPosts"]["count"] = $count;
     }
     if ($prefs['feature_galleries'] == 'y') {
         //image galleries
         $ret["items"]["imageGalleries"]["label"] = tra("new image galleries");
         $ret["items"]["imageGalleries"]["cname"] = "slvn_imageGalleries_menu";
         $query = "select `galleryId`,`name`,`created`,`user` from `tiki_galleries` where `created`>? order by `created` desc";
         $result = $tikilib->query($query, array((int) $last));
         $count = 0;
         while ($res = $result->fetchRow()) {
             if ($userlib->user_has_perm_on_object($user, $res['galleryId'], 'image gallery', 'tiki_p_view_image_gallery')) {
                 $ret["items"]["imageGalleries"]["list"][$count]["href"] = "tiki-browse_gallery.php?galleryId=" . $res["galleryId"];
                 $ret["items"]["imageGalleries"]["list"][$count]["title"] = $tikilib->get_short_datetime($res["created"]) . " " . tra("by") . " " . trim(strip_tags(smarty_modifier_userlink($res["user"])));
                 $ret["items"]["imageGalleries"]["list"][$count]["label"] = $res["name"];
                 $count++;
             }
         }
         $ret["items"]["imageGalleries"]["count"] = $count;
         //images
         $ret["items"]["images"]["label"] = tra("new images");
         $ret["items"]["images"]["cname"] = "slvn_images_menu";
         $query = "select `imageId`,`galleryId`,`name`,`created`,`user` from `tiki_images` where `created`>? order by `created` desc";
         $result = $tikilib->query($query, array((int) $last));
         $count = 0;
         while ($res = $result->fetchRow()) {
             if ($userlib->user_has_perm_on_object($user, $res['galleryId'], 'image gallery', 'tiki_p_view_image_gallery')) {
                 $ret["items"]["images"]["list"][$count]["href"] = "tiki-browse_image.php?galleryId=" . $res["galleryId"] . "&imageId=" . $res["imageId"];
                 $ret["items"]["images"]["list"][$count]["title"] = $tikilib->get_short_datetime($res["created"]) . " " . tra("by") . " " . trim(strip_tags(smarty_modifier_userlink($res["user"])));
                 $ret["items"]["images"]["list"][$count]["label"] = $res["name"];
                 $count++;
             }
         }
         $ret["items"]["images"]["count"] = $count;
     }
     if ($prefs['feature_file_galleries'] == 'y') {
         //file galleries
         $ret["items"]["fileGalleries"]["label"] = tra("new file galleries");
         $ret["items"]["fileGalleries"]["cname"] = "slvn_fileGalleries_menu";
         $query = "select `galleryId`,`name`,`created`,`user` from `tiki_file_galleries` where `created`>? order by `created` desc";
         $result = $tikilib->query($query, array((int) $last));
         $count = 0;
         while ($res = $result->fetchRow()) {
             if ($userlib->user_has_perm_on_object($user, $res['galleryId'], 'file gallery', 'tiki_p_view_file_gallery')) {
                 $ret["items"]["fileGalleries"]["list"][$count]["href"] = "tiki-list_file_gallery.php?galleryId=" . $res["galleryId"];
                 $ret["items"]["fileGalleries"]["list"][$count]["title"] = $tikilib->get_short_datetime($res["created"]) . " " . tra("by") . " " . trim(strip_tags(smarty_modifier_userlink($res["user"])));
                 $ret["items"]["fileGalleries"]["list"][$count]["label"] = $res["name"];
                 $count++;
             }
         }
         $ret["items"]["fileGalleries"]["count"] = $count;
         //files
         $ret["items"]["files"]["label"] = tra("new files");
         $ret["items"]["files"]["cname"] = "slvn_files_menu";
         $query = "select `galleryId`,`name`,`filename`,`created`,`user` from `tiki_files` where `created`>? order by `created` desc";
         $result = $tikilib->query($query, array((int) $last));
         $count = 0;
         while ($res = $result->fetchRow()) {
             if ($userlib->user_has_perm_on_object($user, $res['galleryId'], 'file gallery', 'tiki_p_view_file_gallery')) {
                 $ret["items"]["files"]["list"][$count]["href"] = "tiki-list_file_gallery.php?galleryId=" . $res["galleryId"];
                 $ret["items"]["files"]["list"][$count]["title"] = $tikilib->get_short_datetime($res["created"]) . " " . tra("by") . " " . trim(strip_tags(smarty_modifier_userlink($res["user"])));
                 $ret["items"]["files"]["list"][$count]["label"] = $res["name"] . " (" . $res["filename"] . ")";
                 $count++;
             }
         }
         $ret["items"]["files"]["count"] = $count;
     }
     if ($prefs['feature_polls'] == 'y') {
         $ret["items"]["polls"]["label"] = tra("new polls");
         $ret["items"]["polls"]["cname"] = "slvn_polls_menu";
         $query = "select `pollId`, `title`, `publishDate` from `tiki_polls` where `publishDate`>? order by `publishDate` desc";
         $result = $tikilib->query($query, array((int) $last));
         $count = 0;
         while ($res = $result->fetchRow()) {
             $ret["items"]["polls"]["list"][$count]["href"] = "tiki-poll_results.php?pollId=" . $res["pollId"];
             $ret["items"]["polls"]["list"][$count]["title"] = $tikilib->get_short_datetime($res["publishDate"]);
             $ret["items"]["polls"]["list"][$count]["label"] = $res["title"];
             $count++;
         }
         $ret["items"]["polls"]["count"] = $count;
     }
     if (!isset($params['showuser']) || $params['showuser'] != 'n') {
         $ret['items']['users']['label'] = tra('new users');
         $ret['items']['users']['cname'] = 'slvn_users_menu';
         $query = 'select `userId`, `login`, `registrationDate` from `users_users` where `registrationDate`>?';
         $result = $tikilib->query($query, array((int) $last));
         $count = 0;
         while ($res = $result->fetchRow()) {
             $ret['items']['users']['list'][$count]['href'] = 'tiki-user_information.php?userId=' . $res['userId'];
             $ret['items']['users']['list'][$count]['title'] = $tikilib->get_short_datetime($res['registrationDate']);
             $ret['items']['users']['list'][$count]['label'] = $res['login'];
             $count++;
         }
         $ret['items']['users']['count'] = $count;
     }
     if ($prefs['feature_trackers'] == 'y' && (!isset($params['showtracker']) || $params['showtracker'] != 'n')) {
         $ret["items"]["trackers"]["label"] = tra("new tracker items");
         $ret["items"]["trackers"]["cname"] = "slvn_trackers_menu";
         $query = "select `itemId`, `trackerId`, `created`, `lastModif`  from `tiki_tracker_items` where `lastModif`>? order by `lastModif` desc";
         $result = $tikilib->query($query, array((int) $last));
         $count = 0;
         global $cachelib;
         require_once 'lib/cache/cachelib.php';
         while ($res = $result->fetchRow()) {
             if ($userlib->user_has_perm_on_object($user, $res['trackerId'], 'tracker', 'tiki_p_view_trackers')) {
                 $ret["items"]["trackers"]["list"][$count]["href"] = "tiki-view_tracker_item.php?itemId=" . $res["itemId"];
                 $ret["items"]["trackers"]["list"][$count]["title"] = $tikilib->get_short_datetime($res["lastModif"]);
                 //routine to verify field in tracker that should appear as label
                 $cacheKey = 'trackerItemLabel' . $res['itemId'];
                 if (!$cachelib->isCached($cacheKey)) {
                     $query = "select `fieldId` from `tiki_tracker_fields` where `isMain` = ? and `trackerId` = ? order by `position`";
                     $fieldId = $tikilib->getOne($query, array('y', $res['trackerId']));
                     $query = "select `value` from `tiki_tracker_item_fields` where `fieldId` = ? and `itemId` = ?";
                     $label = $tikilib->getOne($query, array($fieldId, $res['itemId']));
                     $cachelib->cacheItem($cacheKey, $label);
                 } else {
                     $label = $cachelib->getCached($cacheKey);
                 }
                 $ret["items"]["trackers"]["list"][$count]["label"] = $label;
                 $count++;
             }
         }
         $ret["items"]["trackers"]["count"] = $count;
     }
     if ($prefs['feature_calendar'] == 'y') {
         $ret["items"]["calendar"]["label"] = tra("new calendar events");
         $ret["items"]["calendar"]["cname"] = "slvn_calendar_menu";
         $query = "select `calitemId`, `calendarId`, `created`, `lastmodif`, `name` from `tiki_calendar_items` where `lastmodif`>? order by `lastmodif` desc";
         $result = $tikilib->query($query, array((int) $last));
         $count = 0;
         while ($res = $result->fetchRow()) {
             if ($userlib->user_has_perm_on_object($user, $res['calendarId'], 'calendar', 'tiki_p_view_calendar')) {
                 $ret["items"]["calendar"]["list"][$count]["href"] = 'tiki-calendar_edit_item.php?viewcalitemId=' . $res['calitemId'];
                 $ret["items"]["calendar"]["list"][$count]["title"] = $tikilib->get_short_datetime($res["lastmodif"]);
                 $ret["items"]["calendar"]["list"][$count]["label"] = $res['name'];
                 $count++;
             }
         }
         $ret["items"]["calendar"]["count"] = $count;
     }
     //get the total of items
     $ret["cant"] = 0;
     foreach ($ret["items"] as $item) {
         $ret["cant"] += $item["count"];
     }
     return $ret;
 }
				$smarty->assign('cellend', $le["endTimeStamp"]);

				$organizers = $le['result']['organizers'];
				$cellorganizers = '';
				foreach ($organizers as $org) {
					if ($org == '') continue;
					if ($cellorganizers != '') $cellorganizers .= ', ';
					$cellorganizers .= smarty_modifier_userlink(trim($org), 'link', 'not_set', '', 0, 'n');
				}
				$smarty->assign('cellorganizers', $cellorganizers);

				$cellparticipants = '';
				foreach ($le['result']['participants'] as $parti) {
					if (empty($parti) || $parti['name'] == '') continue;
					if ($cellparticipants != '') $cellparticipants .= ', ';
					$cellparticipants .= smarty_modifier_userlink(trim($parti['name']), 'link', 'not_set', '', 0, 'n');
				}
				$smarty->assign('cellparticipants', $cellparticipants);

				$smarty->assign('calendar_type', 'calendar');
				$smarty->assign('show_calname', $lec['show_calname']);
				$smarty->assign('show_description', $lec['show_description']);
				$smarty->assign('show_location', $lec['show_location']);
				$smarty->assign('show_category', $lec['show_category']);
				$smarty->assign('show_language', $lec['show_language']);
				$smarty->assign('show_participants', $lec['show_participants']);
				$smarty->assign('show_url', $lec['show_url']);
				$smarty->assign('show_status', $lec['show_status']);
				$leday["{$le['time']}$e"]["over"] = $smarty->fetch("tiki-calendar_box.tpl");
				$e++;
			}
.
</p>
<?php 
} elseif (isset($this->_tpl_vars['wiki_authors_style']) && $this->_tpl_vars['wiki_authors_style'] == 'none') {
} else {
    ?>
<p class="editdate">
  Created by: <?php 
    echo is_array($_tmp = $this->_tpl_vars['creator']) ? $this->_run_mod_handler('userlink', true, $_tmp) : smarty_modifier_userlink($_tmp);
    ?>

  last modification: <?php 
    echo is_array($_tmp = $this->_tpl_vars['lastModif']) ? $this->_run_mod_handler('tiki_long_datetime', true, $_tmp) : smarty_modifier_tiki_long_datetime($_tmp);
    ?>
 by <?php 
    echo is_array($_tmp = $this->_tpl_vars['lastUser']) ? $this->_run_mod_handler('userlink', true, $_tmp) : smarty_modifier_userlink($_tmp);
    ?>

</p>
<?php 
}
?>

<?php 
if ($this->_tpl_vars['wiki_feature_copyrights'] == 'y' && $this->_tpl_vars['wikiLicensePage']) {
    ?>
  <?php 
    if ($this->_tpl_vars['wikiLicensePage'] == $this->_tpl_vars['page']) {
        ?>
    <?php 
        if ($this->_tpl_vars['tiki_p_edit_copyrights'] == 'y') {
&action=removegroup&group=<?php 
                echo $this->_tpl_vars['groupname'];
                if ($this->_tpl_vars['feature_tabs'] != 'y') {
                    ?>
#2<?php 
                }
                ?>
" class="link" title="remove from group"><img src="img/icons2/delete.gif" border="0" width="16" height="16"  alt='remove'></a> <a href="tiki-adminusers.php?user=<?php 
                echo is_array($_tmp = $this->_tpl_vars['memberslist'][$this->_sections['ix']['index']]) ? $this->_run_mod_handler('escape', true, $_tmp, 'url') : smarty_modifier_escape($_tmp, 'url');
                if ($this->_tpl_vars['feature_tabs'] != 'y') {
                    ?>
#2<?php 
                }
                ?>
" class="link" title="edit"><img src="img/icons/edit.gif" border="0" width="20" height="16"  alt='edit'></a> <?php 
                echo is_array($_tmp = $this->_tpl_vars['memberslist'][$this->_sections['ix']['index']]) ? $this->_run_mod_handler('userlink', true, $_tmp) : smarty_modifier_userlink($_tmp);
                ?>
</td><?php 
                echo smarty_function_cycle(array('name' => 'table'), $this);
                ?>

<?php 
            }
        }
        ?>
</tr></table>
<div class="box"><?php 
        echo $this->_sections['ix']['total'];
        ?>
 users in group <?php 
        echo $this->_tpl_vars['groupname'];
"><?php 
            echo is_array($_tmp = $this->_tpl_vars['listpages'][$this->_sections['changes']['index']]['creator']) ? $this->_run_mod_handler('userlink', true, $_tmp) : smarty_modifier_userlink($_tmp);
            ?>
</td>
<?php 
        }
        ?>

<?php 
        if ($this->_tpl_vars['wiki_list_user'] == 'y') {
            ?>
	<td class="<?php 
            echo smarty_function_cycle(array('advance' => false), $this);
            ?>
"><?php 
            echo is_array($_tmp = $this->_tpl_vars['listpages'][$this->_sections['changes']['index']]['user']) ? $this->_run_mod_handler('userlink', true, $_tmp) : smarty_modifier_userlink($_tmp);
            ?>
</td>
<?php 
        }
        if ($this->_tpl_vars['wiki_list_lastver'] == 'y') {
            ?>
	<td style="text-align:right;" class="<?php 
            echo smarty_function_cycle(array('advance' => false), $this);
            ?>
"><?php 
            echo $this->_tpl_vars['listpages'][$this->_sections['changes']['index']]['version'];
            ?>
</td>
<?php 
        }
    $smarty->assign('prev_page', 1);
}
$smarty->assign('first_page', 1);
$smarty->assign('last_page', $pages);
$smarty->assign('pagenum', $_REQUEST['pagenum']);
$smarty->assign_by_ref('lastVersion', $info["version"]);
$smarty->assign_by_ref('lastModif', $info["lastModif"]);
if (empty($info['user'])) {
    $info['user'] = tra('Anonymous');
}
$smarty->assign_by_ref('lastUser', $info['user']);
$smarty->assign_by_ref('description', $info['description']);
if (isset($_REQUEST['saved_msg']) && $info['user'] == $user) {
    // Generate the 'Page has been saved...' message
    require_once 'lib/smarty_tiki/modifier.userlink.php';
    $smarty->assign('saved_msg', sprintf(tra('%s - Version %d of this page has been saved by %s.'), TikiLib::date_format($prefs['long_date_format'] . ' ' . $prefs['long_time_format'], $info['lastModif']), $info['version'], smarty_modifier_userlink($info['user'])));
}
// Comments engine!
if ($prefs['feature_wiki_comments'] == 'y' and $tiki_p_wiki_view_comments == 'y') {
    $comments_per_page = $prefs['wiki_comments_per_page'];
    $thread_sort_mode = $prefs['wiki_comments_default_ordering'];
    $comments_vars = array('page');
    $comments_prefix_var = 'wiki page:';
    $comments_object_var = 'page';
    include_once 'comments.php';
}
if ($prefs['feature_wiki_attachments'] == 'y') {
    if (isset($_REQUEST['removeattach'])) {
        check_ticket('index');
        $owner = $wikilib->get_attachment_owner($_REQUEST['removeattach']);
        if ($user && $owner == $user || $tiki_p_wiki_admin_attachments == 'y') {
            if ($tikilib->semaphore_is_set($page, $prefs['warn_on_edit_time'] * 60) && $tikilib->get_semaphore_user($page) != $u) {
                $editpageconflict = 'y';
            } elseif ($tiki_p_edit == 'y') {
                $_SESSION["edit_lock_{$page}"] = $tikilib->semaphore_set($page);
            }
            $semUser = $tikilib->get_semaphore_user($page);
            $beingedited = 'y';
        } else {
            if (!empty($_SESSION["edit_lock_{$page}"])) {
                $tikilib->semaphore_unset($page, $_SESSION["edit_lock_{$page}"]);
            }
        }
    }
    if ($editpageconflict == 'y' && !isset($_REQUEST["conflictoverride"])) {
        include_once 'lib/smarty_tiki/modifier.userlink.php';
        $msg = tra("This page is being edited by ") . smarty_modifier_userlink($semUser) . ". " . tra("Please check with the user before editing the page,\n\t\t\totherwise the changes will be stored as two separate versions in the history and\n\t\t\tyou will have to manually merge them later. ");
        $msg .= '<br /><br /><a href="tiki-editpage.php?page=';
        $msg .= urlencode($page);
        $msg .= '&conflictoverride=y">' . tra('Override lock and carry on with edit') . '</a>';
        $smarty->assign('msg', $msg);
        $smarty->assign('errortitle', tra('Page is currently being edited'));
        $smarty->display("error.tpl");
        die;
    }
}
$category_needed = false;
$contribution_needed = false;
if (isset($_REQUEST['lock_it']) && $_REQUEST['lock_it'] == 'on') {
    $lock_it = 'y';
} else {
    $lock_it = 'n';
Beispiel #10
0
 function getTabularSchema()
 {
     $permName = $this->getConfiguration('permName');
     $baseKey = $this->getBaseKey();
     $name = $this->getConfiguration('name');
     $schema = new Tracker\Tabular\Schema($this->getTrackerDefinition());
     $schema->addNew($permName, 'userlink')->setLabel($name)->setPlainReplacement('username')->setRenderTransform(function ($value) {
         $smarty = TikiLib::lib('smarty');
         $smarty->loadPlugin('smarty_modifier_userlink');
         if ($value) {
             return smarty_modifier_userlink($value);
         }
     });
     $schema->addNew($permName, 'realname')->setLabel($name)->setReadOnly(true)->setRenderTransform(function ($value) {
         $smarty = TikiLib::lib('smarty');
         $smarty->loadPlugin('smarty_modifier_username');
         if ($value) {
             return smarty_modifier_username($value, true, false, false);
         }
     });
     $schema->addNew($permName, 'username-itemlink')->setLabel($name)->setPlainReplacement('username')->addQuerySource('itemId', 'object_id')->setRenderTransform(function ($value, $extra) {
         $smarty = TikiLib::lib('smarty');
         $smarty->loadPlugin('smarty_function_object_link');
         if ($value) {
             return smarty_function_object_link(['type' => 'trackeritem', 'id' => $extra['itemId'], 'title' => $value], $smarty);
         }
     });
     $schema->addNew($permName, 'realname-itemlink')->setLabel($name)->setPlainReplacement('realname')->addQuerySource('itemId', 'object_id')->setRenderTransform(function ($value, $extra) {
         $smarty = TikiLib::lib('smarty');
         $smarty->loadPlugin('smarty_function_object_link');
         $smarty->loadPlugin('smarty_modifier_username');
         if ($value) {
             return smarty_function_object_link(['type' => 'trackeritem', 'id' => $extra['itemId'], 'title' => smarty_modifier_username($value, true, false, false)], $smarty);
         }
     });
     $schema->addNew($permName, 'username')->setLabel($name)->setRenderTransform(function ($value) {
         return $value;
     })->setParseIntoTransform(function (&$info, $value) use($permName) {
         $info['fields'][$permName] = $value;
     });
     return $schema;
 }