[ Index ]

PHP Cross Reference of Joomla 1.5.26 DE

title

Body

[close]

/administrator/components/com_sections/ -> admin.sections.html.php (source)

   1  <?php
   2  /**
   3  * @version        $Id: admin.sections.html.php 18162 2010-07-16 07:00:47Z ian $
   4  * @package        Joomla
   5  * @subpackage    Sections
   6  * @copyright    Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
   7  * @license        GNU/GPL, see LICENSE.php
   8  * Joomla! is free software. This version may have been modified pursuant
   9  * to the GNU General Public License, and as distributed it includes or
  10  * is derivative of works licensed under the GNU General Public License or
  11  * other free or open source software licenses.
  12  * See COPYRIGHT.php for copyright notices and details.
  13  */
  14  
  15  // no direct access
  16  defined( '_JEXEC' ) or die( 'Restricted access' );
  17  
  18  /**
  19  * @package        Joomla
  20  * @subpackage    Sections
  21  */
  22  class sections_html
  23  {
  24      /**
  25      * Writes a list of the categories for a section
  26      * @param array An array of category objects
  27      * @param string The name of the category section
  28      */
  29  	function show( &$rows, $scope, $myid, &$page, $option, &$lists )
  30      {
  31          $limitstart = JRequest::getVar('limitstart', '0', '', 'int');
  32  
  33          $user =& JFactory::getUser();
  34  
  35          //Ordering allowed ?
  36          $ordering = ($lists['order'] == 's.ordering');
  37  
  38          JHTML::_('behavior.tooltip');
  39          ?>
  40          <form action="index.php?option=com_sections&amp;scope=<?php echo $scope; ?>" method="post" name="adminForm">
  41  
  42          <table>
  43          <tr>
  44              <td align="left" width="100%">
  45                  <?php echo JText::_( 'Filter' ); ?>:
  46                  <input type="text" name="search" id="search" value="<?php echo htmlspecialchars($lists['search']);?>" class="text_area" onchange="document.adminForm.submit();" />
  47                  <button onclick="this.form.submit();"><?php echo JText::_( 'Go' ); ?></button>
  48                  <button onclick="document.getElementById('search').value='';this.form.submit();"><?php echo JText::_( 'Reset' ); ?></button>
  49              </td>
  50              <td nowrap="nowrap">
  51                  <?php
  52                  echo $lists['state'];
  53                  ?>
  54              </td>
  55          </tr>
  56          </table>
  57  
  58          <table class="adminlist">
  59          <thead>
  60              <tr>
  61                  <th width="10">
  62                      <?php echo JText::_( 'NUM' ); ?>
  63                  </th>
  64                  <th width="10">
  65                      <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $rows );?>);" />
  66                  </th>
  67                  <th class="title">
  68                      <?php echo JHTML::_('grid.sort',   'Title', 's.title', @$lists['order_Dir'], @$lists['order'] ); ?>
  69                  </th>
  70                  <th width="5%">
  71                      <?php echo JHTML::_('grid.sort',   'Published', 's.published', @$lists['order_Dir'], @$lists['order'] ); ?>
  72                  </th>
  73                  <th width="8%" nowrap="nowrap">
  74                      <?php echo JHTML::_('grid.sort',   'Order', 's.ordering', @$lists['order_Dir'], @$lists['order'] ); ?>
  75                      <?php if ($ordering) echo JHTML::_('grid.order',  $rows ); ?>
  76                  </th>
  77                  <th width="10%">
  78                      <?php echo JHTML::_('grid.sort',   'Access', 'groupname', @$lists['order_Dir'], @$lists['order'] ); ?>
  79                  </th>
  80                  <th width="5%" nowrap="nowrap">
  81                      <?php echo JText::_( 'Num Categories' ); ?>
  82                  </th>
  83                  <th width="5%" nowrap="nowrap">
  84                      <?php echo JText::_( 'Num Active' ); ?>
  85                  </th>
  86                  <th width="5%" nowrap="nowrap">
  87                      <?php echo JText::_( 'Num Trash' ); ?>
  88                  </th>
  89                  <th width="1%" nowrap="nowrap">
  90                      <?php echo JHTML::_('grid.sort',   'ID', 's.id', @$lists['order_Dir'], @$lists['order'] ); ?>
  91                  </th>
  92              </tr>
  93          </thead>
  94          <tfoot>
  95              <tr>
  96                  <td colspan="13">
  97                      <?php echo $page->getListFooter(); ?>
  98                  </td>
  99              </tr>
 100          </tfoot>
 101          <tbody>
 102          <?php
 103          $k = 0;
 104          for ( $i=0, $n=count( $rows ); $i < $n; $i++ ) {
 105              $row = &$rows[$i];
 106  
 107              $link         = 'index.php?option=com_sections&scope=content&task=edit&cid[]='. $row->id;
 108  
 109              $access     = JHTML::_('grid.access',   $row, $i );
 110              $checked     = JHTML::_('grid.checkedout',   $row, $i );
 111              $published     = JHTML::_('grid.published', $row, $i );
 112              ?>
 113              <tr class="<?php echo "row$k"; ?>">
 114                  <td align="center">
 115                      <?php echo $page->getRowOffset( $i ); ?>
 116                  </td>
 117                  <td>
 118                      <?php echo $checked; ?>
 119                  </td>
 120                  <td>
 121                      <span class="editlinktip hasTip" title="<?php echo JText::_( 'Title' );?>::<?php echo htmlspecialchars($row->title); ?>">
 122                      <?php
 123                      if (  JTable::isCheckedOut($user->get ('id'), $row->checked_out ) ) {
 124                          echo htmlspecialchars($row->title);
 125                      } else {
 126                          ?>
 127                          <a href="<?php echo JRoute::_( $link ); ?>">
 128                              <?php echo htmlspecialchars($row->title); ?></a>
 129                          <?php
 130                      }
 131                      ?></span>
 132                  </td>
 133                  <td align="center">
 134                      <?php echo $published;?>
 135                  </td>
 136                  <td class="order">
 137                      <span><?php echo $page->orderUpIcon( $i, true, 'orderup', 'Move Up', $ordering ); ?></span>
 138                      <span><?php echo $page->orderDownIcon( $i, $n, true, 'orderdown', 'Move Down', $ordering ); ?></span>
 139                      <?php $disabled = $ordering ?  '' : 'disabled="disabled"'; ?>
 140                      <input type="text" name="order[]" size="5" value="<?php echo $row->ordering; ?>" <?php echo $disabled ?> class="text_area" style="text-align: center" />
 141                  </td>
 142                  <td align="center">
 143                      <?php echo $access;?>
 144                  </td>
 145                  <td align="center">
 146                      <?php echo $row->categories; ?>
 147                  </td>
 148                  <td align="center">
 149                      <?php echo $row->active; ?>
 150                  </td>
 151                  <td align="center">
 152                      <?php echo $row->trash; ?>
 153                  </td>
 154                  <td align="center">
 155                      <?php echo $row->id; ?>
 156                  </td>
 157                  <?php
 158                  $k = 1 - $k;
 159                  ?>
 160              </tr>
 161              <?php
 162          }
 163          ?>
 164          </tbody>
 165          </table>
 166  
 167          <input type="hidden" name="option" value="<?php echo $option;?>" />
 168          <input type="hidden" name="scope" value="<?php echo $scope;?>" />
 169          <input type="hidden" name="task" value="" />
 170          <input type="hidden" name="chosen" value="" />
 171          <input type="hidden" name="act" value="" />
 172          <input type="hidden" name="boxchecked" value="0" />
 173          <input type="hidden" name="filter_order" value="<?php echo $lists['order']; ?>" />
 174          <input type="hidden" name="filter_order_Dir" value="<?php echo $lists['order_Dir']; ?>" />
 175          <?php echo JHTML::_( 'form.token' ); ?>
 176          </form>
 177          <?php
 178      }
 179  
 180      /**
 181      * Writes the edit form for new and existing categories
 182      *
 183      * A new record is defined when <var>$row</var> is passed with the <var>id</var>
 184      * property set to 0.  Note that the <var>section</var> property <b>must</b> be defined
 185      * even for a new record.
 186      * @param JTableCategory The category object
 187      * @param string The html for the image list select list
 188      * @param string The html for the image position select list
 189      * @param string The html for the ordering list
 190      * @param string The html for the groups select list
 191      */
 192  	function edit( &$row, $option, &$lists )
 193      {
 194          JRequest::setVar( 'hidemainmenu', 1 );
 195  
 196          global $mainframe;
 197  
 198          $editor =& JFactory::getEditor();
 199  
 200          if ( $row->name != '' ) {
 201              $name = $row->name;
 202          } else {
 203              $name = JText::_( 'New Section' );
 204          }
 205          if ($row->image == '') {
 206              $row->image = 'blank.png';
 207          }
 208  
 209          JFilterOutput::objectHTMLSafe( $row, ENT_QUOTES, 'description' );
 210          ?>
 211          <script language="javascript" type="text/javascript">
 212  		function submitbutton(pressbutton) {
 213              var form = document.adminForm;
 214              if (pressbutton == 'cancel') {
 215                  submitform( pressbutton );
 216                  return;
 217              }
 218  
 219              if ( form.title.value == '' ){
 220                  alert("<?php echo JText::_( 'Section must have a title', true ); ?>");
 221              } else {
 222                  <?php
 223                  echo $editor->save( 'description' ) ; ?>
 224                  submitform(pressbutton);
 225              }
 226          }
 227          </script>
 228  
 229          <form action="index.php" method="post" name="adminForm">
 230  
 231          <div class="col width-60">
 232              <fieldset class="adminform">
 233                  <legend><?php echo JText::_( 'Details' ); ?></legend>
 234  
 235                  <table class="admintable">
 236                  <tr>
 237                      <td width="100" class="key">
 238                          <?php echo JText::_( 'Scope' ); ?>:
 239                      </td>
 240                      <td colspan="2">
 241                          <strong>
 242                          <?php echo $row->scope; ?>
 243                          </strong>
 244                      </td>
 245                  </tr>
 246                  <tr>
 247                      <td class="key">
 248                          <label for="title">
 249                              <?php echo JText::_( 'Title' ); ?>:
 250                          </label>
 251                      </td>
 252                      <td colspan="2">
 253                          <input class="text_area" type="text" name="title" id="title" value="<?php echo htmlspecialchars($row->title); ?>" size="50" maxlength="50" title="<?php echo JText::_( 'TIPTITLEFIELD' ); ?>" />
 254                      </td>
 255                  </tr>
 256                  <tr>
 257                      <td nowrap="nowrap" class="key">
 258                          <label for="alias">
 259                              <?php echo JText::_( 'Alias' ); ?>:
 260                          </label>
 261                      </td>
 262                      <td colspan="2">
 263                          <input class="text_area" type="text" name="alias" id="alias" value="<?php echo $row->alias; ?>" size="50" maxlength="255" title="<?php echo JText::_( 'ALIASTIP' ); ?>" />
 264                      </td>
 265                  </tr>
 266                  <tr>
 267                      <td class="key">
 268                          <?php echo JText::_( 'Published' ); ?>:
 269                      </td>
 270                      <td colspan="2">
 271                          <?php echo $lists['published']; ?>
 272                      </td>
 273                  </tr>
 274                  <tr>
 275                      <td class="key">
 276                          <label for="ordering">
 277                              <?php echo JText::_( 'Ordering' ); ?>:
 278                          </label>
 279                      </td>
 280                      <td colspan="2">
 281                          <?php echo $lists['ordering']; ?>
 282                      </td>
 283                  </tr>
 284                  <tr>
 285                      <td nowrap="nowrap" valign="top" class="key">
 286                          <label for="access">
 287                              <?php echo JText::_( 'Access Level' ); ?>:
 288                          </label>
 289                      </td>
 290                      <td>
 291                          <?php echo $lists['access']; ?>
 292                      </td>
 293                      <td rowspan="4" width="50%">
 294                          <?php
 295                              $path = JURI::root() . 'images/';
 296                              if ($row->image != 'blank.png') {
 297                                  $path.= 'stories/';
 298                              }
 299                          ?>
 300                          <img src="<?php echo $path;?><?php echo $row->image;?>" name="imagelib" width="80" height="80" border="2" alt="<?php echo JText::_( 'Preview' ); ?>" />
 301                      </td>
 302                  </tr>
 303                  <tr>
 304                      <td class="key">
 305                          <label for="image">
 306                              <?php echo JText::_( 'Image' ); ?>:
 307                          </label>
 308                      </td>
 309                      <td>
 310                          <?php echo $lists['image']; ?>
 311                      </td>
 312                  </tr>
 313                  <tr>
 314                      <td nowrap="nowrap" class="key">
 315                          <label for="image_position">
 316                              <?php echo JText::_( 'Image Position' ); ?>:
 317                          </label>
 318                      </td>
 319                      <td>
 320                          <?php echo $lists['image_position']; ?>
 321                      </td>
 322                  </tr>
 323                  </table>
 324              </fieldset>
 325  
 326              <fieldset class="adminform">
 327                  <legend><?php echo JText::_( 'Description' ); ?></legend>
 328  
 329                  <table class="admintable">
 330                  <tr>
 331                      <td valign="top" colspan="3">
 332                          <?php
 333                          // parameters : areaname, content, width, height, cols, rows
 334                          echo $editor->display( 'description',  $row->description, '550', '300', '60', '20', array('pagebreak', 'readmore') ) ;
 335                          ?>
 336                      </td>
 337                  </tr>
 338                  </table>
 339              </fieldset>
 340          </div>
 341          <div class="clr"></div>
 342  
 343          <input type="hidden" name="option" value="<?php echo $option;?>" />
 344          <input type="hidden" name="scope" value="<?php echo $row->scope; ?>" />
 345          <input type="hidden" name="id" value="<?php echo $row->id; ?>" />
 346          <input type="hidden" name="task" value="" />
 347          <input type="hidden" name="oldtitle" value="<?php echo $row->title ; ?>" />
 348          <?php echo JHTML::_( 'form.token' ); ?>
 349          </form>
 350          <?php
 351      }
 352  
 353  
 354      /**
 355      * Form to select Section to copy Category to
 356      */
 357  	function copySectionSelect( $option, $cid, $categories, $contents, $section )
 358      {
 359          ?>
 360          <script language="javascript" type="text/javascript">
 361  		function submitbutton(pressbutton) {
 362              var form = document.adminForm;
 363              if (pressbutton == 'cancel') {
 364                  submitform( pressbutton );
 365                  return;
 366              }
 367  
 368              if ( form.title.value == '' ){
 369                  alert("<?php echo JText::_( 'Section must have a title', true ); ?>");
 370              } else {
 371                  submitform(pressbutton);
 372              }
 373          }
 374          </script>
 375          <form action="index.php" method="post" name="adminForm">
 376  
 377          <table class="adminform">
 378          <tr>
 379              <td width="3%"></td>
 380              <td  valign="top" width="30%">
 381              <strong><?php echo JText::_( 'Copy to Section' ); ?>:</strong>
 382              <br />
 383              <input class="text_area" type="text" name="title" value="" size="35" maxlength="50" title="<?php echo JText::_( 'The new Section Title' ); ?>" />
 384              <br /><br />
 385              </td>
 386              <td  valign="top" width="20%">
 387              <strong><?php echo JText::_( 'Categories being copied' ); ?>:</strong>
 388              <br />
 389              <?php
 390              echo "<ol>";
 391              foreach ( $categories as $category ) {
 392                  echo "<li>". $category->title ."</li>";
 393                  echo "\n <input type=\"hidden\" name=\"category[]\" value=\"$category->id\" />";
 394              }
 395              echo "</ol>";
 396              ?>
 397              </td>
 398              <td valign="top" width="20%">
 399              <strong><?php echo JText::_( 'Articles being copied' ); ?>:</strong>
 400              <br />
 401              <?php
 402              echo "<ol>";
 403              foreach ( $contents as $content ) {
 404                  echo "<li>". $content->title ."</li>";
 405                  echo "\n <input type=\"hidden\" name=\"content[]\" value=\"$content->id\" />";
 406              }
 407              echo "</ol>";
 408              ?>
 409              </td>
 410              <td valign="top">
 411              <?php echo JText::_( 'This will copy the Categories listed' ); ?>
 412              <br />
 413              <?php echo JText::_( 'DESCALLITEMSWITHINCAT' ); ?>
 414              <br />
 415              <?php echo JText::_( 'to the new Section created.' ); ?>
 416              </td>.
 417          </tr>
 418          </table>
 419          <br /><br />
 420  
 421          <input type="hidden" name="option" value="<?php echo $option;?>" />
 422          <input type="hidden" name="section" value="<?php echo $section;?>" />
 423          <input type="hidden" name="boxchecked" value="1" />
 424          <input type="hidden" name="task" value="" />
 425          <input type="hidden" name="scope" value="content" />
 426          <?php
 427          foreach ( $cid as $id ) {
 428              echo "\n <input type=\"hidden\" name=\"cid[]\" value=\"$id\" />";
 429          }
 430          ?>
 431          <?php echo JHTML::_( 'form.token' ); ?>
 432          </form>
 433          <?php
 434      }
 435  }


Generated: Wed Mar 28 15:54:07 2012 Cross-referenced by PHPXref 0.7.1