[ 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/ -> article-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']) == 'article-list.php') exit;
  25  
  26  
  27  echo '<form action="articles.php" method="GET"><p>';
  28  echo '<label for="m" style="display:inline;"><strong>'. __('Month:').' </strong></label>';
  29  echo form::comboBox('m',$arry_months, $px_m);
  30  echo ' <label for="cat_id" style="display:inline;"><strong>'. __('Category:').' </strong></label>';
  31  echo form::comboBox('cat_id',$arry_cat,$cat_id);
  32  echo ' <input type="hidden" name="op" id="op" value="list" /><input class="submit" type="submit" value="'. __('ok').'" />';
  33  echo '</p></form>';
  34  
  35  if ($res->isEmpty()) {
  36      echo '<p>'. __('No article').'</p>'."\n\n";
  37  } else {
  38      echo '<script type="text/javascript">'."\n".
  39          "<!--\n".
  40          "var js_post_ids = new Array('".implode("','",$res->getIDs('resource_id', 'content'))."');\n".
  41          "//-->\n".
  42          "</script>\n";
  43  
  44      echo '<p class="small"><a href="#" onclick="mOpenClose(js_post_ids,1); return false;">'. __('Show all').'</a>'.
  45      ' - <a href="#" onclick="mOpenClose(js_post_ids,-1); return false;">'. __('Hide all').'</a></p>';
  46  
  47  
  48      while (!$res->EOF()) {
  49  
  50          if ($m->asRightToEdit($res)) {
  51              $editlinks = '[<strong><a href="'.$res->f('type_id').'.php?resource_id='.$res->f('resource_id').'">'. __('edit').'</a></strong>]';
  52          } else {
  53              $editlinks = '[<strong><a href="'.$res->f('type_id').'.php?resource_id='.$res->f('resource_id').'">'. __('visualize').'</a></strong>]';
  54          }
  55  
  56          $res_class = '';
  57          $res_img = '';
  58  
  59          if ($res->f('status') == PX_RESOURCE_STATUS_OFFLINE) {
  60              $res_class = 'cancel';
  61              $res_img = '<img src="themes/'.$_px_theme.'/images/check_off.png" alt="'. __('Resource off-line').'" class="status" />';
  62          } elseif ($res->f('status') == PX_RESOURCE_STATUS_VALIDE) {
  63              $res_class = 'published';
  64              $res_img = '<img src="themes/'.$_px_theme.'/images/check_on.png" alt="'. __('Resource on-line').'" class="status" />';
  65          } elseif ($res->f('status') == PX_RESOURCE_STATUS_INEDITION) {
  66              $res_class = 'published';
  67              $res_img = '<img src="themes/'.$_px_theme.'/images/check_edit.png" alt="'. __('Resource in edition').'" class="status" />';
  68          } elseif ($res->f('status') == PX_RESOURCE_STATUS_TOBEVALIDATED) {
  69              $res_class = 'published';
  70              $res_img = '<img src="themes/'.$_px_theme.'/images/check_wait.png" alt="'. __('Resource waiting for validation').'" class="status" />';
  71          }
  72  
  73          echo '<div class="line '.$res_class.'" id="p'.$res->f('resource_id').'">'.
  74              '<p><a href="#" onclick="openClose(\'content'.$res->f('resource_id').'\',0); return false;">'.
  75              '<img src="themes/'.$_px_theme.'/images/plus.png" id="img_content'.$res->f('resource_id').'" '.
  76              'alt="'. __('show/hide').'" /></a> ';
  77  
  78  
  79          echo $res->f('title').' - '. __('by');
  80  
  81              
  82          $temp = '';
  83          while (!$res->extEOF('authors')) {
  84              $temp .= ' <strong>'.$res->extf('authors','user_realname').
  85                  '</strong>';
  86              $res->extMoveNext('authors');
  87          }
  88          echo $temp;
  89          echo ' - '. __('in');
  90  
  91          $temp = '';
  92          while (!$res->extEOF('cats')) {
  93              $temp .= ' <em>'.$res->extf('cats','category_name').'</em>,';
  94              $res->extMoveNext('cats');
  95          }
  96          $temp = substr($temp, 0, -1); 
  97          echo $temp."<br />\n";
  98          echo $res_img.'<strong>'.
  99              date( __('Y/m/d \a\t H:i:s'),date::unix($res->f('modifdate'))).
 100              '</strong> '.$editlinks;
 101              
 102          echo "</p>\n\n";
 103          echo '<div id="content'.$res->f('resource_id').
 104              '" style="display:none;">';
 105          echo $res->cur->getFormattedContent('description')."\n";
 106          echo "\n<p><span class='small'>".__('Id to make a link:').' '.
 107              $res->f('identifier').
 108              "</span></p>\n<hr class='invisible' /></div></div>\n\n";    
 109              
 110  
 111          $res->moveNext();
 112      }
 113  }
 114  
 115  /*=================================================
 116   Form to search in the resources
 117  =================================================*/
 118  echo '<form action="articles.php" method="GET"><p>';
 119  echo '<label for="q" style="display:inline;"><strong>'. __('Search for an article:').' </strong></label>';
 120  echo form::textField('q', 30, 255, $px_q);
 121  echo ' <input class="submit" type="submit" value="'. __('ok').'" /><input type="hidden" name="op" value="list" />';
 122  echo '</p></form>'."\n\n";
 123  
 124  
 125  ?>


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