Пример #1
0
Файл: view.php Проект: rair/yacs
 // expired article
 if ((Surfer::is_associate() || $cur_article->is_assigned()) && $item['expiry_date'] > NULL_DATE && $item['expiry_date'] <= $context['now']) {
     $details[] = EXPIRED_FLAG . ' ' . sprintf(i18n::s('Page has expired %s'), Skin::build_date($item['expiry_date']));
 }
 // provide more details to authenticated surfers
 if (Surfer::is_logged()) {
     // page owner
     if (isset($item['owner_id']) && ($owner = Users::get($item['owner_id']))) {
         $details[] = sprintf(i18n::s('%s: %s'), i18n::s('Owner'), Users::get_link($owner['full_name'], $owner['email'], $owner['id']));
     }
     // page editors
     if ($items = Articles::list_editors_by_name($item, 0, 7, 'comma5')) {
         $details[] = sprintf(i18n::s('%s: %s'), Skin::build_link(Users::get_url('article:' . $item['id'], 'select'), i18n::s('Editors')), $items);
     }
     // page watchers
     if ($items = Articles::list_watchers_by_posts($item, 0, 7, 'comma5')) {
         $details[] = sprintf(i18n::s('%s: %s'), Skin::build_link(Users::get_url('article:' . $item['id'], 'watch'), i18n::s('Watchers')), $items);
     }
 }
 // display details, if any
 if (count($details)) {
     $text .= ucfirst(implode(BR . "\n", $details)) . BR . "\n";
 }
 // other details
 $details =& Articles::build_dates($anchor, $item);
 // signal articles to be published
 if ($item['publish_date'] <= NULL_DATE) {
     if ($cur_article->allows('publication')) {
         $label = Skin::build_link(Articles::get_url($item['id'], 'publish'), i18n::s('not published'));
     } else {
         $label = i18n::s('not published');
Пример #2
0
 Skin::define_img('CHECKED_IMG', 'ajax/accept.png', '*');
 $offset = ($zoom_index - 1) * USERS_LIST_SIZE;
 // list editors of this page, and of parent sections
 if ($items = Articles::list_editors_by_name($item, 0, 1000, 'watch')) {
     foreach ($items as $user_id => $user_label) {
         $owner_state = '';
         if ($user_id == $item['owner_id']) {
             $owner_state = CHECKED_IMG;
         }
         $editor_state = CHECKED_IMG;
         $watcher_state = '';
         $rows[$user_id] = array($user_label, $watcher_state, $editor_state, $owner_state);
     }
 }
 // watchers
 if ($items = Articles::list_watchers_by_posts($item, 0, 1000, 'watch')) {
     foreach ($items as $user_id => $user_label) {
         // this is a true participant to the item
         $users_count += 1;
         // add the checkmark to existing row
         if (isset($rows[$user_id])) {
             $rows[$user_id][1] = CHECKED_IMG;
         } else {
             $owner = '';
             if ($user_id == $item['owner_id']) {
                 $owner = CHECKED_IMG;
             }
             $editor = '';
             $watcher = CHECKED_IMG;
             $rows[$user_id] = array($user_label, $watcher, $editor, $owner);
         }