} $id = strip_tags($id); // get the item from the database $item = Articles::get($id); // get the related anchor, if any $anchor = NULL; if (isset($item['anchor'])) { $anchor = Anchors::get($item['anchor']); } // get the related overlay, if any $overlay = NULL; if (isset($item['overlay'])) { $overlay = Overlay::load($item, 'article:' . $item['id']); } // owners can proceed if (Articles::allow_message($item, $anchor)) { $permitted = TRUE; } else { $permitted = FALSE; } // load the skin, maybe with a variant load_skin('articles', $anchor, isset($item['options']) ? $item['options'] : ''); // clear the tab we are in, if any if (is_object($anchor)) { $context['current_focus'] = $anchor->get_focus(); } // path to this page $context['path_bar'] = Surfer::get_path_bar($anchor); if (isset($item['id']) && $item['title']) { $context['path_bar'] = array_merge($context['path_bar'], array(Articles::get_permalink($item) => $item['title'])); }
// count if ($users_count) { $box['bar'] += array('_count' => sprintf(i18n::ns('%d participant', '%d participants', $users_count), $users_count)); } // add to the watch list -- $in_watch_list is set in sections/view.php if (Surfer::get_id() && !$in_watch_list) { Skin::define_img('TOOLS_WATCH_IMG', 'tools/watch.gif'); $box['bar'] += array(Users::get_url('article:' . $item['id'], 'track') => TOOLS_WATCH_IMG . i18n::s('Watch this page')); } // invite participants, for owners if (Articles::is_owned($item, $anchor) && isset($context['with_email']) && $context['with_email'] == 'Y') { Skin::define_img('ARTICLES_INVITE_IMG', 'articles/invite.gif'); $box['bar'] += array(Articles::get_url($item['id'], 'invite') => ARTICLES_INVITE_IMG . i18n::s('Invite participants')); } // notify participants if ($count > 1 && Articles::allow_message($item, $anchor) && isset($context['with_email']) && $context['with_email'] == 'Y') { Skin::define_img('ARTICLES_EMAIL_IMG', 'articles/email.gif'); $box['bar'] += array(Articles::get_url($item['id'], 'mail') => ARTICLES_EMAIL_IMG . i18n::s('Notify participants')); } // manage editors, for owners if (Articles::is_owned($item, $anchor, TRUE) || Surfer::is_associate()) { Skin::define_img('ARTICLES_ASSIGN_IMG', 'articles/assign.gif'); $box['bar'] += array(Users::get_url('article:' . $item['id'], 'select') => ARTICLES_ASSIGN_IMG . i18n::s('Manage participants')); // leave this page, for editors } elseif (Articles::is_assigned($item['id'])) { Skin::define_img('ARTICLES_ASSIGN_IMG', 'sections/assign.gif'); $box['bar'] += array(Users::get_url('article:' . $item['id'], 'leave') => ARTICLES_ASSIGN_IMG . i18n::s('Leave this page')); } // headers $headers = array(i18n::s('Person'), i18n::s('Watcher'), i18n::s('Editor'), i18n::s('Owner')); // layout columns