[ Index ]
 

Code source de Plume CMS 1.2.2

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/manager/mtemplates/ -> news-list.php (source)

   1  <?php
   2  /* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
   3  /*
   4  # ***** BEGIN LICENSE BLOCK *****
   5  # This file is part of Plume CMS, a website management application.
   6  # Copyright (C) 2001-2005 Loic d'Anterroches and contributors.
   7  #
   8  # Plume CMS is free software; you can redistribute it and/or modify
   9  # it under the terms of the GNU General Public License as published by
  10  # the Free Software Foundation; either version 2 of the License, or
  11  # (at your option) any later version.
  12  #
  13  # Plume CMS is distributed in the hope that it will be useful,
  14  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16  # GNU General Public License for more details.
  17  #
  18  # You should have received a copy of the GNU General Public License
  19  # along with this program; if not, write to the Free Software
  20  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  21  #
  22  # ***** END LICENSE BLOCK ***** */
  23  
  24  if (basename($_SERVER['SCRIPT_NAME']) == 'news-list.php') exit;
  25  
  26  echo '<form action="news.php" method="GET"><p>';
  27  echo '<label for="m" style="display:inline;"><strong>'. __('Month:').' </strong></label>';
  28  echo form::comboBox('m',$arry_months, $px_m);
  29  echo ' <label for="cat_id" style="display:inline;"><strong>'. __('Category:').' </strong></label>';
  30  echo form::comboBox('cat_id',$arry_cat,$cat_id);
  31  echo ' <input type="hidden" name="op" id="op" value="list" /><input class="submit" type="submit" value="'. __('ok').'" />';
  32  echo '</p></form>';
  33      
  34  if ($res->isEmpty()) {
  35      echo '<p>'. __('No news.').'</p>'."\n\n";
  36  } else {
  37      echo '<script type="text/javascript">'."\n<!--\n".
  38          "var js_post_ids = new Array('".implode("','",$res->getIDs('resource_id', 'content'))."');\n".
  39          "//-->\n</script>\n";
  40          
  41      echo '<p class="small"><a href="#" onclick="mOpenClose(js_post_ids,1); return false;">'. __('Show all').'</a>'.
  42          ' - <a href="#" onclick="mOpenClose(js_post_ids,-1); return false;">'. __('Hide all').'</a></p>';
  43          
  44     
  45      while (!$res->EOF()) {
  46          // edition links 
  47          if ($m->user->f('user_id') == $res->f('user_id') || auth::asLevel(PX_AUTH_ADVANCED, $_SESSION['website_id'])) {
  48              $editlinks = '[<strong><a href="'.$res->f('type_id').'.php?resource_id='.$res->f('resource_id').'">'. __('edit').'</a></strong>]';
  49          } else {
  50              $editlinks = '[<strong><a href="'.$res->f('type_id').'.php?resource_id='.$res->f('resource_id').'">'. __('visualize').'</a></strong>]';      
  51          }
  52              
  53          switch ($res->f('status')) {
  54          case PX_RESOURCE_STATUS_OFFLINE:
  55              $res_class = 'cancel';
  56              $res_img = '<img src="themes/'.$_px_theme.'/images/check_off.png" alt="'.__('Resource off-line').'" class="status" />';
  57              break;
  58          case PX_RESOURCE_STATUS_VALIDE:
  59              $res_class = 'published';
  60              $res_img = '<img src="themes/'.$_px_theme.'/images/check_on.png" alt="'.__('Resource on-line').'" class="status" />';
  61              break;
  62          case PX_RESOURCE_STATUS_TOBEVALIDATED:
  63              $res_class = 'published';
  64              $res_img = '<img src="themes/'.$_px_theme.'/images/check_wait.png" alt="'.__('Resource waiting for validation').'" class="status" />';
  65              break;
  66          case PX_RESOURCE_STATUS_INEDITION:
  67          default:
  68              $res_class = 'published';
  69              $res_img = '<img src="themes/'.$_px_theme.'/images/check_edit.png" alt="'.__('Resource in edition').'" class="status" />';
  70              break;
  71          }
  72          echo '<div class="line '.$res_class.'" id="p'.$res->f('resource_id').'">'.
  73              '<p><a href="#" onclick="openClose(\'content'.$res->f('resource_id').'\',0); return false;">'.
  74              '<img src="themes/'.$_px_theme.'/images/plus.png" id="img_content'.$res->f('resource_id').'" '.
  75              'alt="'. __('show/hide').'" /></a> ';
  76              
  77          echo $res->f('title').' - '. __('by');
  78              
  79          $temp = '';
  80          while (!$res->extEOF('authors')) {
  81              $temp .= ' <strong>'.$res->extf('authors','user_realname').
  82                  '</strong>';
  83              $res->extMoveNext('authors');
  84          }
  85          echo $temp;
  86          echo ' - '. __('in');
  87  
  88          $temp = '';
  89          while (!$res->extEOF('cats')) {
  90              $temp .= ' <em>'.$res->extf('cats','category_name').'</em>,';
  91              $res->extMoveNext('cats');
  92          }
  93          $temp = substr($temp, 0, -1); 
  94          echo $temp."<br />\n";
  95          echo $res_img.'<strong>'.
  96              date( __('Y/m/d \a\t H:i:s'),date::unix($res->f('modifdate'))).
  97              '</strong> '.$editlinks;
  98              
  99          echo "</p>\n\n";
 100          echo '<div id="content'.$res->f('resource_id').
 101              '" style="display:none;">';
 102          echo $res->cur->getFormattedContent('description')."\n";
 103          echo "\n<p><span class='small'>".__('Id to make a link:').' '.
 104              $res->f('identifier').
 105              "</span></p>\n<hr class='invisible' /></div></div>\n\n";    
 106              
 107              
 108          $res->moveNext();
 109      }
 110  }
 111      
 112  /* ================================================= *
 113   *            Form to search in the news             *
 114   * ================================================= */
 115  echo '<form action="news.php" method="GET"><p>';
 116  echo '<label for="q" style="display:inline;"><strong>'.
 117  __('Search for a news:').' </strong></label>';
 118  echo form::textField('q', 30, 255, $px_q); 
 119  echo ' <input class="submit" type="submit" value="'.
 120  __('ok').'" /><input type="hidden" name="op" value="list" />';
 121  echo '</p></form>'."\n\n";
 122      
 123  ?>


Généré le : Mon Nov 26 11:57:01 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics