[ Index ]

PHP Cross Reference of Mambo 4.6.5

[ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/administrator/components/com_content/ -> admin.content.html.php (source)

   1  <?php
   2  /**
   3  * @package Mambo
   4  * @subpackage Content
   5  * @author Mambo Foundation Inc see README.php
   6  * @copyright (C) 2000 - 2009 Mambo Foundation Inc.
   7  * See COPYRIGHT.php for copyright notices and details.
   8  * @license GNU/GPL Version 2, see LICENSE.php
   9  *
  10  * Redistributions of files must retain the above copyright notice.
  11  *
  12  * Mambo is free software; you can redistribute it and/or
  13  * modify it under the terms of the GNU General Public License
  14  * as published by the Free Software Foundation; version 2 of the License.
  15  */
  16  
  17  /** ensure this file is being included by a parent file */
  18  defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
  19  
  20  class HTML_content {
  21  
  22      /**
  23      * Writes a list of the content items
  24      * @param array An array of content objects
  25      */
  26  	function showContent( &$rows, $section, &$lists, $search, $pageNav, $all=NULL, $redirect ) {
  27          global $my, $acl;
  28  
  29          mosCommonHTML::loadOverlib();
  30          ?>
  31          <form action="index2.php" method="post" name="adminForm">
  32  
  33          <table class="adminheading">
  34          <tr>
  35              <th class="edit" rowspan="2" nowrap>
  36              <?php
  37              if ( $all ) {
  38                  ?>
  39                  <?php echo T_('Content Items Manager'); ?> <small><small>[ <?php echo T_('Section: All'); ?> ]</small></small>
  40                  <?php
  41              } else {
  42                  ?>
  43                  <?php echo T_('Content Items Manager'); ?> <small><small>[ <?php echo T_('Section:'); ?> <?php echo $section->title; ?> ]</small></small>
  44                  <?php
  45              }
  46              ?>
  47              </th>
  48              <?php
  49              if ( $all ) {
  50                  ?>
  51                  <td width="right" rowspan="2" valign="top">
  52                  <?php echo $lists['sectionid'];?>
  53                  </td>
  54                  <?php
  55              }
  56              ?>
  57              <td width="right" valign="top">
  58              <?php echo $lists['catid'];?>
  59              </td>
  60              <td width="right" valign="top">
  61              <?php echo $lists['authorid'];?>
  62              </td>
  63          </tr>
  64          <tr>
  65              <td align="right">
  66              <?php echo T_('Filter:'); ?>
  67              </td>
  68              <td>
  69              <input type="text" name="search" value="<?php echo $search;?>" class="text_area" onChange="document.adminForm.submit();" />
  70              </td>
  71          </tr>
  72          </table>
  73  
  74          <table class="adminlist">
  75          <tr>
  76              <th width="5">
  77              #
  78              </th>
  79              <th width="5">
  80              <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo count( $rows ); ?>);" />
  81              </th>
  82              <th class="title">
  83              <?php echo T_('Title'); ?>
  84              </th>
  85              <th width="5%">
  86              <?php echo T_('Published'); ?>
  87              </th>
  88              <th nowrap="nowrap" width="5%">
  89              <?php echo T_('Front Page'); ?>
  90              </th>
  91              <th colspan="2" align="center" width="5%">
  92              <?php echo T_('Reorder'); ?>
  93              </th>
  94              <th width="2%">
  95              <?php echo T_('Order'); ?>
  96              </th>
  97              <th width="1%">
  98              <a href="javascript: saveorder( <?php echo count( $rows )-1; ?> )"><img src="images/filesave.png" border="0" width="16" height="16" alt="<?php echo T_('Save Order'); ?>" /></a>
  99              </th>
 100              <th >
 101              <?php echo T_('Access'); ?>
 102              </th>
 103              <th width="2%">
 104              <?php echo T_('ID'); ?>
 105              </th>
 106              <?php
 107              if ( $all ) {
 108                  ?>
 109                  <th align="left">
 110                  <?php echo T_('Section'); ?>
 111                  </th>
 112                  <?php
 113              }
 114              ?>
 115              <th align="left">
 116              <?php echo T_('Category'); ?>
 117              </th>
 118              <th align="left">
 119              <?php echo T_('Author'); ?>
 120              </th>
 121              <th align="center" width="10">
 122              <?php echo T_('Date'); ?>
 123              </th>
 124            </tr>
 125          <?php
 126          $k = 0;
 127          for ($i=0, $n=count( $rows ); $i < $n; $i++) {
 128              $row = &$rows[$i];
 129  
 130              $link     = 'index2.php?option=com_content&sectionid='. $redirect .'&task=edit&hidemainmenu=1&id='. $row->id;
 131  
 132              $row->sect_link = 'index2.php?option=com_sections&task=editA&hidemainmenu=1&id='. $row->sectionid;
 133              $row->cat_link     = 'index2.php?option=com_categories&task=editA&hidemainmenu=1&id='. $row->catid;
 134  
 135              $now = date( "Y-m-d H:i:s" );
 136              if ( $now <= $row->publish_up && $row->state == "1" ) {
 137                  $img = 'publish_y.png';
 138                  $alt = T_('Published');
 139              } else if ( ( $now <= $row->publish_down || $row->publish_down == "0000-00-00 00:00:00" ) && $row->state == "1" ) {
 140                  $img = 'publish_g.png';
 141                  $alt = T_('Published');
 142              } else if ( $now > $row->publish_down && $row->state == "1" ) {
 143                  $img = 'publish_r.png';
 144                  $alt = T_('Expired');
 145              } elseif ( $row->state == "0" ) {
 146                  $img = "publish_x.png";
 147                  $alt = T_('Unpublished');
 148              }
 149              $times = '';
 150              if (isset($row->publish_up)) {
 151                  if ($row->publish_up == '0000-00-00 00:00:00') {
 152                      $times .= "<tr><td>".T_('Start:')." ".T_('Always')."</td></tr>";
 153                  } else {
 154                      $times .= "<tr><td>".T_('Start:')." $row->publish_up</td></tr>";
 155                  }
 156              }
 157              if (isset($row->publish_down)) {
 158                  if ($row->publish_down == '0000-00-00 00:00:00') {
 159                      $times .= "<tr><td>".T_('Finish:')." ".T_('No Expiry')."</td></tr>";
 160                  } else {
 161                      $times .= "<tr><td>".T_('Finish:')." $row->publish_down</td></tr>";
 162                  }
 163              }
 164  
 165              if ( $acl->acl_check( 'administration', 'manage', 'users', $my->usertype, 'components', 'com_users' ) ) {
 166                  if ( $row->created_by_alias ) {
 167                      $author = $row->created_by_alias;
 168                  } else {
 169                      $linkA     = 'index2.php?option=com_users&task=editA&hidemainmenu=1&id='. $row->created_by;
 170                      $author = '<a href="'. $linkA .'" title="'.T_('Edit User').'">'. $row->author .'</a>';
 171                  }
 172              } else {
 173                  if ( $row->created_by_alias ) {
 174                      $author = $row->created_by_alias;
 175                  } else {
 176                      $author = $row->author;
 177                  }
 178              }
 179  
 180              $date = mosFormatDate( $row->created, '%x' );
 181  
 182              $access     = mosCommonHTML::AccessProcessing( $row, $i );
 183              $checked     = mosCommonHTML::CheckedOutProcessing( $row, $i );
 184              ?>
 185              <tr class="<?php echo "row$k"; ?>">
 186                  <td>
 187                  <?php echo $pageNav->rowNumber( $i ); ?>
 188                  </td>
 189                  <td align="center">
 190                  <?php echo $checked; ?>
 191                  </td>
 192                  <td>
 193                  <?php
 194                  if ( $row->checked_out && ( $row->checked_out != $my->id ) ) {
 195                      echo $row->title;
 196                  } else {
 197                      ?>
 198                      <a href="<?php echo $link; ?>" title="<?php echo T_('Edit Content'); ?>">
 199                      <?php echo htmlspecialchars($row->title, ENT_QUOTES); ?>
 200                      </a>
 201                      <?php
 202                  }
 203                  ?>
 204                  </td>
 205                  <?php
 206                  if ( $times ) {
 207                      ?>
 208                      <td align="center">
 209                      <a href="javascript: void(0);" onMouseOver="return overlib('<table><?php echo $times; ?></table>', CAPTION, '<?php echo T_('Publish Information'); ?>', BELOW, RIGHT);" onMouseOut="return nd();" onClick="return listItemTask('cb<?php echo $i;?>','<?php echo $row->state ? "unpublish" : "publish";?>')">
 210                      <img src="images/<?php echo $img;?>" width="12" height="12" border="0" alt="<?php echo $alt; ?>" />
 211                      </a>
 212                      </td>
 213                      <?php
 214                  }
 215                  ?>
 216                  <td align="center">
 217                  <a href="javascript: void(0);" onClick="return listItemTask('cb<?php echo $i;?>','toggle_frontpage')">
 218                  <img src="images/<?php echo ( $row->frontpage ) ? 'tick.png' : 'publish_x.png';?>" width="12" height="12" border="0" alt="<?php echo ( $row->frontpage ) ? T_('Yes') : T_('No');?>" />
 219                  </a>
 220                  </td>
 221                  <td align="right">
 222                  <?php echo $pageNav->orderUpIcon( $i, ($row->catid == @$rows[$i-1]->catid) ); ?>
 223                  </td>
 224                  <td align="left">
 225                  <?php echo $pageNav->orderDownIcon( $i, $n, ($row->catid == @$rows[$i+1]->catid) ); ?>
 226                  </td>
 227                  <td align="center" colspan="2">
 228                  <input type="text" name="order[]" size="5" value="<?php echo $row->ordering; ?>" class="text_area" style="text-align: center" />
 229                  </td>
 230                  <td align="center">
 231                  <?php echo $access;?>
 232                  </td>
 233                  <td align="left">
 234                  <?php echo $row->id; ?>
 235                  </td>
 236                  <?php
 237                  if ( $all ) {
 238                      ?>
 239                      <td align="left">
 240                      <a href="<?php echo $row->sect_link; ?>" title="<?php echo T_('Edit Section'); ?>">
 241                      <?php echo $row->section_name; ?>
 242                      </a>
 243                      </td>
 244                      <?php
 245                  }
 246                  ?>
 247                  <td align="left">
 248                  <a href="<?php echo $row->cat_link; ?>" title="<?php echo T_('Edit Category'); ?>">
 249                  <?php echo $row->name; ?>
 250                  </a>
 251                  </td>
 252                  <td align="left">
 253                  <?php echo $author; ?>
 254                  </td>
 255                  <td align="left">
 256                  <?php echo $date; ?>
 257                  </td>
 258              </tr>
 259              <?php
 260              $k = 1 - $k;
 261          }
 262          ?>
 263          </table>
 264  
 265          <?php echo $pageNav->getListFooter(); ?>
 266          <?php mosCommonHTML::ContentLegend(); ?>
 267  
 268          <input type="hidden" name="option" value="com_content" />
 269          <input type="hidden" name="sectionid" value="<?php echo $section->id;?>" />
 270          <input type="hidden" name="task" value="" />
 271          <input type="hidden" name="boxchecked" value="0" />
 272          <input type="hidden" name="hidemainmenu" value="0" />
 273          <input type="hidden" name="redirect" value="<?php echo $redirect;?>" />
 274          </form>
 275          <?php
 276      }
 277  
 278  
 279      /**
 280      * Writes a list of the content items
 281      * @param array An array of content objects
 282      */
 283  	function showArchive( &$rows, $section, &$lists, $search, $pageNav, $option, $all=NULL, $redirect ) {
 284          global $my, $acl;
 285  
 286          ?>
 287          <script type="text/javascript">
 288  		function submitbutton(pressbutton) {
 289              if (pressbutton == 'remove') {
 290                  if (document.adminForm.boxchecked.value == 0) {
 291                      alert('<?php echo T_('Please make a selection from the list to send to Trash'); ?>');
 292                  } else if ( confirm('<?php echo T_('Are you sure you want to Trash the selected items? \nThis will not permanently delete the items.'); ?>')) {
 293                      submitform('remove');
 294                  }
 295              } else {
 296                  submitform(pressbutton);
 297              }
 298          }
 299          </script>
 300          <form action="index2.php" method="post" name="adminForm">
 301  
 302          <table class="adminheading">
 303          <tr>
 304              <th class="edit" rowspan="2">
 305              <?php
 306              if ( $all ) {
 307                  ?>
 308                  <?php echo T_('Archive Manager'); ?> <small><small>[ <?php echo T_('Section:'); ?> <?php echo T_('All'); ?> ]</small></small>
 309                  <?php
 310              } else {
 311                  ?>
 312                  <?php echo T_('Archive Manager'); ?> <small><small>[ <?php echo T_('Section:'); ?> <?php echo $section->title; ?> ]</small></small>
 313                  <?php
 314              }
 315              ?>
 316              </th>
 317              <?php
 318              if ( $all ) {
 319                  ?>
 320                  <td width="right" rowspan="2" valign="top">
 321                  <?php echo $lists['sectionid'];?>
 322                  </td>
 323                  <?php
 324              }
 325              ?>
 326              <td width="right">
 327              <?php echo $lists['catid'];?>
 328              </td>
 329              <td width="right">
 330              <?php echo $lists['authorid'];?>
 331              </td>
 332          </tr>
 333          <tr>
 334              <td align="right">
 335              <?php echo T_('Filter:'); ?>
 336              </td>
 337              <td>
 338              <input type="text" name="search" value="<?php echo $search;?>" class="text_area" onChange="document.adminForm.submit();" />
 339              </td>
 340          </tr>
 341          </table>
 342  
 343          <table class="adminlist">
 344          <tr>
 345              <th width="5">
 346              #
 347              </th>
 348              <th width="20">
 349              <input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo count( $rows ); ?>);" />
 350              </th>
 351              <th class="title">
 352              <?php echo T_('Title'); ?>
 353              </th>
 354              <th width="2%">
 355              <?php echo T_('Order'); ?>
 356              </th>
 357              <th width="1%">
 358              <a href="javascript: saveorder( <?php echo count( $rows )-1; ?> )"><img src="images/filesave.png" border="0" width="16" height="16" alt="<?php echo T_('Save Order'); ?>" /></a>
 359              </th>
 360              <th width="15%" align="left">
 361              <?php echo T_('Category'); ?>
 362              </th>
 363              <th width="15%" align="left">
 364              <?php echo T_('Author'); ?>
 365              </th>
 366              <th align="center" width="10">
 367              <?php echo T_('Date'); ?>
 368              </th>
 369          </tr>
 370          <?php
 371          $k = 0;
 372          for ($i=0, $n=count( $rows ); $i < $n; $i++) {
 373              $row = &$rows[$i];
 374  
 375              $row->cat_link     = 'index2.php?option=com_categories&task=editA&hidemainmenu=1&id='. $row->catid;
 376  
 377              if ( $acl->acl_check( 'administration', 'manage', 'users', $my->usertype, 'components', 'com_users' ) ) {
 378                  if ( $row->created_by_alias ) {
 379                      $author = $row->created_by_alias;
 380                  } else {
 381                      $linkA     = 'index2.php?option=com_users&task=editA&hidemainmenu=1&id='. $row->created_by;
 382                      $author = '<a href="'. $linkA .'" title="'.T_('Edit User').'">'. $row->author .'</a>';
 383                  }
 384              } else {
 385                  if ( $row->created_by_alias ) {
 386                      $author = $row->created_by_alias;
 387                  } else {
 388                      $author = $row->author;
 389                  }
 390              }
 391  
 392              $date = mosFormatDate( $row->created, '%x' );
 393              ?>
 394              <tr class="<?php echo "row$k"; ?>">
 395                  <td>
 396                  <?php echo $pageNav->rowNumber( $i ); ?>
 397                  </td>
 398                  <td width="20">
 399                  <?php echo mosHTML::idBox( $i, $row->id ); ?>
 400                  </td>
 401                  <td>
 402                  <?php echo $row->title; ?>
 403                  </td>
 404                  <td align="center" colspan="2">
 405                  <input type="text" name="order[]" size="5" value="<?php echo $row->ordering; ?>" class="text_area" style="text-align: center" />
 406                  </td>
 407                  <td>
 408                  <a href="<?php echo $row->cat_link; ?>" title="<?php echo T_('Edit Category'); ?>">
 409                  <?php echo $row->name; ?>
 410                  </a>
 411                  </td>
 412                  <td>
 413                  <?php echo $author; ?>
 414                  </td>
 415                  <td>
 416                  <?php echo $date; ?>
 417                  </td>
 418              </tr>
 419              <?php
 420              $k = 1 - $k;
 421          }
 422          ?>
 423          </table>
 424  
 425          <?php echo $pageNav->getListFooter(); ?>
 426  
 427          <input type="hidden" name="option" value="<?php echo $option;?>" />
 428          <input type="hidden" name="sectionid" value="<?php echo $section->id;?>" />
 429          <input type="hidden" name="task" value="showarchive" />
 430          <input type="hidden" name="returntask" value="showarchive" />
 431          <input type="hidden" name="boxchecked" value="0" />
 432          <input type="hidden" name="hidemainmenu" value="0" />
 433          <input type="hidden" name="redirect" value="<?php echo $redirect;?>" />
 434          </form>
 435          <?php
 436      }
 437  
 438  
 439      /**
 440      * Writes the edit form for new and existing content item
 441      *
 442      * A new record is defined when <var>$row</var> is passed with the <var>id</var>
 443      * property set to 0.
 444      * @param mosContent The category object
 445      * @param string The html for the groups select list
 446      */
 447  	function editContent( &$row, $section, &$lists, &$sectioncategories, &$images, &$params, $option, $redirect, &$menus ) {
 448          global $mosConfig_live_site;
 449  
 450          mosMakeHtmlSafe( $row );
 451  
 452          $create_date = null;
 453          if (intval( $row->created ) <> 0) {
 454              $create_date     = mosFormatDate( $row->created, '%A, %d %B %Y %H:%M', '0' );
 455          }
 456          $mod_date = null;
 457          if (intval( $row->modified ) <> 0) {
 458              $mod_date         = mosFormatDate( $row->modified, '%A, %d %B %Y %H:%M', '0' );
 459          }
 460  
 461          $tabs = new mosTabs(1);
 462  
 463  
 464          // used to hide "Reset Hits" when hits = 0
 465          if ( !$row->hits ) {
 466              $visibility = "style='display: none; visbility: hidden;'";
 467          } else {
 468              $visibility = "";
 469          }
 470  
 471          mosCommonHTML::loadOverlib();
 472          mosCommonHTML::loadCalendar();
 473          ?>
 474          <script type="text/javascript">
 475          <!--
 476          var sectioncategories = new Array;
 477          <?php
 478          $i = 0;
 479          foreach ($sectioncategories as $k=>$items) {
 480              foreach ($items as $v) {
 481                  echo "sectioncategories[".$i++."] = new Array( '$k','".addslashes( $v->value )."','".addslashes( $v->text )."' );\n\t\t";
 482              }
 483          }
 484          ?>
 485  
 486          var folderimages = new Array;
 487          <?php
 488          $i = 0;
 489          foreach ($images as $k=>$items) {
 490              foreach ($items as $v) {
 491                  echo "folderimages[".$i++."] = new Array( '$k','".addslashes( $v->value )."','".addslashes( $v->text )."' );\n\t\t";
 492              }
 493          }
 494          
 495          ?>
 496  
 497  		function submitbutton(pressbutton) {
 498              var form = document.adminForm;
 499  
 500              if ( pressbutton == 'menulink' ) {
 501                  if ( form.menuselect.value == "" ) {
 502                      alert( "<?php echo T_('Please select a Menu'); ?>" );
 503                      return;
 504                  } else if ( form.link_name.value == "" ) {
 505                      alert( "<?php echo T_('Please enter a Name for this menu item'); ?>" );
 506                      return;
 507                  }
 508              }
 509  
 510              if (pressbutton == 'cancel') {
 511                  submitform( pressbutton );
 512                  return;
 513              }
 514              // assemble the images back into one field
 515              var temp = new Array;
 516              for (var i=0, n=form.imagelist.options.length; i < n; i++) {
 517                  temp[i] = form.imagelist.options[i].value;
 518              }
 519              form.images.value = temp.join( '\n' );
 520  
 521              // do field validation
 522              if (form.title.value == ""){
 523                  alert( "<?php echo T_('Content item must have a title'); ?>" );
 524              } else if (form.sectionid.value == "-1"){
 525                  alert( "<?php echo T_('You must select a Section.'); ?>" );
 526              } else if (form.catid.value == "-1"){
 527                  alert( "<?php echo T_('You must select a Category.'); ?>" );
 528               } else if (form.catid.value == ""){
 529                   alert( "<?php echo T_('You must select a Category.'); ?>" );
 530              } else {
 531                  <?php getEditorContents( 'editor1', 'introtext' ) ; ?>
 532                  <?php getEditorContents( 'editor2', 'fulltext' ) ; ?>
 533                  submitform( pressbutton );
 534              }
 535          }
 536          
 537              // show / hide publishing information
 538  			function displayParameterInfo()
 539              {
 540                  
 541                  if(document.getElementById('simpleediting').style.display == 'block')
 542                  {
 543                      document.getElementById('simpleediting').style.display = 'none';    
 544                      document.getElementById('show').style.display = 'block';    
 545                      document.getElementById('hide').style.display = 'none';
 546                      document.adminForm.simple_editing.value ='on';
 547                  }
 548                  else
 549                  {
 550                      document.getElementById('simpleediting').style.display = 'block';
 551                      document.getElementById('show').style.display = 'none';    
 552                      document.getElementById('hide').style.display = 'block';
 553                      document.adminForm.simple_editing.value ='off';
 554                  }
 555                  
 556              }
 557          //-->
 558          </script>
 559          
 560          <?php
 561          if($_SESSION['simple_editing'] == 'on')
 562          {
 563              $simpleediting ='none';
 564              $simple = 'block';
 565              $advanced = 'none';
 566          }
 567          else
 568          {
 569              
 570              $advanced = 'block';
 571              $simple = 'none';
 572              $simpleediting ='block';
 573          }
 574          
 575          ?>
 576          <form action="index2.php" method="post" name="adminForm">
 577          <input type ="hidden" name="simple_editing" value='' />
 578          <table class="adminheading" border="1">
 579          <tr>
 580              <th class="edit">
 581              <?php echo T_('Content Item:'); ?>
 582              <small>
 583              <?php echo $row->id ? T_('Edit') : T_('New');?>
 584              </small>
 585              <?php
 586              if ( $row->id ) {
 587                  ?>
 588                  <small><small>
 589                  [ <?php echo T_('Section:'); ?> <?php echo $section?> ]
 590                  </small></small>
 591                  <?php
 592              }
 593              ?>
 594              
 595              </th>
 596          </tr>
 597          </table>
 598          <table width="100%">
 599              <tr>
 600                  <td valign="top" align="right">
 601                  <div id = "show" style="display:<?php echo $simple;?>">
 602                  <a href="javascript:displayParameterInfo();"><?php echo T_('Show Advanced Details'); ?></a>
 603                  </div>
 604                  <div id = "hide" style="display:<?php echo $advanced;?>">
 605                  <a href="javascript:displayParameterInfo();"><?php echo T_('Hide Advanced Details'); ?></a>
 606                  </div>
 607                  </td>
 608              </tr>
 609          </table>
 610          <table cellspacing="0" cellpadding="0" width="100%" >
 611          <tr>
 612              <td valign="top">
 613              
 614                  <table width="100%" class="adminform">
 615                  <tr>
 616                      <td width="500">
 617                          <table cellspacing="0" cellpadding="0" border="0" width="100%">
 618                          <tr >
 619                              <th colspan="4">
 620                              <?php echo T_('Item Details'); ?>
 621                              </th>
 622                          </tr>
 623                          <tr>
 624                              <td>
 625                              <?php echo T_('Title:'); ?>
 626                              </td>
 627                              <td>
 628                              <input class="text_area" type="text" name="title" size="30" maxlength="100" value="<?php echo $row->title; ?>" />
 629                              </td>
 630                              <td>
 631                              <?php echo T_('Section:'); ?>
 632                              </td>
 633                              <td>
 634                              <?php echo $lists['sectionid']; ?>
 635                              </td>
 636                          </tr>
 637                          <tr>
 638                              <td>
 639                              <?php echo T_('Title Alias:'); ?>
 640                              </td>
 641                              <td>
 642                              <input name="title_alias" type="text" class="text_area" id="title_alias" value="<?php echo $row->title_alias; ?>" size="30" maxlength="100" />
 643                              </td>
 644                              <td>
 645                              <?php echo T_('Category:'); ?>
 646                              </td>
 647                              <td>
 648                              <?php echo $lists['catid']; ?>
 649                              </td>
 650                          </tr>
 651                          </table>
 652                      </td>
 653                  </tr>
 654              
 655                  <tr>
 656                      <td width="100%">
 657                      <?php echo T_('Intro Text:'); ?> (<?php echo T_('required'); ?>)
 658                      <br /><?php
 659                      // parameters : areaname, content, hidden field, width, height, rows, cols
 660                      editorArea( 'editor1',  $row->introtext , 'introtext', '100%;', '200', '75', '20' ) ; ?>
 661                      </td>
 662                  </tr>
 663                  <tr>
 664                      <td width="100%">
 665                      <?php echo T_('Main Text:'); ?> (<?php echo T_('optional'); ?>)
 666                      <br /><?php
 667                      // parameters : areaname, content, hidden field, width, height, rows, cols
 668                      editorArea( 'editor2',  $row->fulltext , 'fulltext', '100%;', '350', '75', '30' ) ; ?>
 669                      </td>
 670                  </tr>
 671                  </table>
 672              </td>
 673              <td valign="top" align="right">
 674              <div id="simpleediting" style="display:<?php echo $simpleediting;?>">
 675              <table width="100%" >
 676                  <tr>
 677                      <td width="200">
 678              
 679                          <table width="400">
 680                          <tr>
 681                              <td >
 682                              <?php
 683                              $tabs->startPane("content-pane");
 684                              $tabs->startTab(T_("Publishing"),"publish-page");
 685                              ?>
 686                              <table class="adminform">
 687                              <tr>
 688                                  <th colspan="2">
 689                                  <?php echo T_('Publishing Info'); ?>
 690                                  </th>
 691                              </tr>
 692                              <tr>
 693                                  <td valign="top" align="right">
 694                                  <?php echo T_('Show on Frontpage:'); ?>
 695                                  </td>
 696                                  <td>
 697                                  <input type="checkbox" name="frontpage" value="1" <?php echo $row->frontpage ? 'checked="checked"' : ''; ?> />
 698                                  </td>
 699                              </tr>
 700                              <tr>
 701                                  <td valign="top" align="right">
 702                                  <?php echo T_('Published:'); ?>
 703                                  </td>
 704                                  <td>
 705                                  <input type="checkbox" name="published" value="1" <?php echo $row->state ? 'checked="checked"' : ''; ?> />
 706                                  </td>
 707                              </tr>
 708                              <tr>
 709                                  <td valign="top" align="right">
 710                                  <?php echo T_('Access Level:'); ?>
 711                                  </td>
 712                                  <td>
 713                                  <?php echo $lists['access']; ?> </td>
 714                                  </tr>
 715                              <tr>
 716                                  <td valign="top" align="right">
 717                                  <?php echo T_('Author Alias:'); ?>
 718                                  </td>
 719                                  <td>
 720                                  <input type="text" name="created_by_alias" size="30" maxlength="100" value="<?php echo $row->created_by_alias; ?>" class="text_area" />
 721                                  </td>
 722                              </tr>
 723                              <tr>
 724                                  <td valign="top" align="right">
 725                                  <?php // cause Mambo to be extremely slow w/ huge user table, comment out for now echo T_('Change Creator:'); ?>
 726                                  </td>
 727                                  <td>
 728                                  <?php // cause Mambo to be extremely slow w/ huge user table, comment out for now echo $lists['created_by']; ?> </td>
 729                              </tr>
 730                              <tr>
 731                                  <td valign="top" align="right"><?php echo T_('Ordering:'); ?></td>
 732                                  <td>
 733                                  <?php echo $lists['ordering']; ?> </td>
 734                              </tr>
 735                              <tr>
 736                                  <td valign="top" align="right">
 737                                  <?php echo T_('Override Created Date'); ?>
 738                                  </td>
 739                                  <td>
 740                                  <input class="text_area" type="text" name="created" id="created" size="25" maxlength="19" value="<?php echo $row->created; ?>" />
 741                                  <input name="reset" type="reset" class="button" onClick="return showCalendar('created', 'y-mm-dd');" value="..." />
 742                                  </td>
 743                              </tr>
 744                              <tr>
 745                                  <td valign="top" align="right">
 746                                  <?php echo T_('Start Publishing:'); ?>
 747                                  </td>
 748                                  <td>
 749                                  <input class="text_area" type="text" name="publish_up" id="publish_up" size="25" maxlength="19" value="<?php echo $row->publish_up; ?>" />
 750                                  <input type="reset" class="button" value="..." onClick="return showCalendar('publish_up', 'y-mm-dd');" />
 751                                  </td>
 752                              </tr>
 753                              <tr>
 754                                  <td valign="top" align="right">
 755                                  <?php echo T_('Finish Publishing:'); ?>
 756                                  </td>
 757                                  <td>
 758                                  <input class="text_area" type="text" name="publish_down" id="publish_down" size="25" maxlength="19" value="<?php echo $row->publish_down; ?>" />
 759                                  <input type="reset" class="button" value="..." onClick="return showCalendar('publish_down', 'y-mm-dd');" />
 760                                  </td>
 761                              </tr>
 762                              </table>
 763                              <br />
 764                              <table class="adminform">
 765                              <?php
 766                              if ( $row->id ) {
 767                                  ?>
 768                                  <tr>
 769                                      <td>
 770                                      <strong><?php echo T_('Content ID:'); ?></strong>
 771                                      </td>
 772                                      <td>
 773                                      <?php echo $row->id; ?>
 774                                      </td>
 775                                  </tr>
 776                                  <?php
 777                              }
 778                              ?>
 779                              <tr>
 780                                  <td width="90px" valign="top" align="right">
 781                                  <strong><?php echo T_('State:'); ?></strong>
 782                                  </td>
 783                                  <td>
 784                                  <?php echo $row->state > 0 ? T_('Published') : ($row->state < 0 ? T_('Archived') : T_('Draft Unpublished'));?>
 785                                  </td>
 786                              </tr>
 787                              <tr >
 788                                  <td valign="top" align="right">
 789                                  <strong>
 790                                  <?php echo T_('Hits'); ?>
 791                                  </strong>:
 792                                  </td>
 793                                  <td>
 794                                  <?php echo $row->hits;?>
 795                                  <div <?php echo $visibility; ?>>
 796                                  <input name="reset_hits" type="button" class="button" value="<?php echo T_('Reset Hit Count'); ?>" onClick="submitbutton('resethits');" />
 797                                  </div>
 798                                  </td>
 799                              </tr>
 800                              <tr>
 801                                  <td valign="top" align="right">
 802                                  <strong>
 803                                  <?php echo T_('Revised'); ?>
 804                                  </strong>:
 805                                  </td>
 806                                  <td>
 807                                  <?php echo $row->version;?> <?php echo T_('times'); ?>
 808                                  </td>
 809                              </tr>
 810                              <tr>
 811                                  <td valign="top" align="right">
 812                                  <strong>
 813                                  <?php echo T_('Created'); ?>
 814                                  </strong>
 815                                  </td>
 816                                  <td>
 817                                  <?php echo $row->created ? "$create_date</td></tr><tr><td valign='top' align='right'><strong>".T_('By')."</strong></td><td>$row->creator" : "New document"; ?>
 818                                  </td>
 819                              </tr>
 820                              <tr>
 821                                  <td valign="top" align="right">
 822                                  <strong>
 823                                  <?php echo T_('Last Modified'); ?>
 824                                  </strong>
 825                                  </td>
 826                                  <td>
 827                                  <?php echo $row->modified ? "$mod_date</td></tr><tr><td valign='top' align='right'><strong>".T_('By')."</strong></td><td>$row->modifier" : "Not modified";?>
 828                                  </td>
 829                              </tr>
 830                              </table>
 831                              <?php
 832                              $tabs->endTab();
 833                              $tabs->startTab(T_("Images"),"images-page");
 834                              ?>
 835                              <table class="adminform" width="100%">
 836                              <tr>
 837                                  <th colspan="2">
 838                                  <?php echo T_('MOSImage Control'); ?>
 839                                  </th>
 840                              </tr>
 841                              <tr>
 842                                  <td colspan="6"><?php echo T_('Sub-folder:'); ?> <?php echo $lists['folders'];?></td>
 843                              </tr>
 844                              <tr>
 845                                  <td>
 846                                  <?php echo T_('Gallery Images:'); ?>
 847                                  <br />
 848                                  <?php echo $lists['imagefiles'];?>
 849                                  </td>
 850                                  <td valign="top">
 851                                  <img name="view_imagefiles" src="../images/M_images/blank.png" width="100" />
 852                                  </td>
 853                              </tr>
 854                              <tr>
 855                                  <td>
 856                                  <input class="button" type="button" value="<?php echo T_('Add'); ?>" onClick="addSelectedToList('adminForm','imagefiles','imagelist')" />
 857                                  </td>
 858                              </tr>
 859                              <tr>
 860                                  <td>
 861                                  <?php echo T_('Content Images:'); ?>
 862                                  <br />
 863                                  <?php echo $lists['imagelist'];?>
 864                                  </td>
 865                                  <td valign="top">
 866                                  <img name="view_imagelist" src="../images/M_images/blank.png" width="100" />
 867                                  </td>
 868                              </tr>
 869                              <tr>
 870                                  <td>
 871                                  <input class="button" type="button" value="<?php echo T_('up'); ?>" onClick="moveInList('adminForm','imagelist',adminForm.imagelist.selectedIndex,-1)" />
 872                                  <input class="button" type="button" value="<?php echo T_('down'); ?>" onClick="moveInList('adminForm','imagelist',adminForm.imagelist.selectedIndex,+1)" />
 873                                  <input class="button" type="button" value="<?php echo T_('remove'); ?>" onClick="delSelectedFromList('adminForm','imagelist')" />
 874                                  </td>
 875                              </tr>
 876                              <tr>
 877                                  <td colspan="2">
 878                                      <?php echo T_('Edit the image selected:'); ?>
 879                                      <table>
 880                                      <tr>
 881                                          <td align="right">
 882                                          <?php echo T_('Source:'); ?>
 883                                          </td>
 884                                          <td>
 885                                          <input class="text_area" type="text" name= "_source" value="" />
 886                                          </td>
 887                                      </tr>
 888                                      <tr>
 889                                          <td align="right">
 890                                          <?php echo T_('Image Align:'); ?>
 891                                          </td>
 892                                          <td>
 893                                          <?php echo $lists['_align']; ?>
 894                                          </td>
 895                                      </tr>
 896                                      <tr>
 897                                          <td align="right">
 898                                          <?php echo T_('Alt Text:'); ?>
 899                                          </td>
 900                                          <td>
 901                                          <input class="text_area" type="text" name="_alt" value="" />
 902                                          </td>
 903                                      </tr>
 904                                      <tr>
 905                                          <td align="right">
 906                                          <?php echo T_('Border:'); ?>
 907                                          </td>
 908                                          <td>
 909                                          <input class="text_area" type="text" name="_border" value="" size="3" maxlength="1" />
 910                                          </td>
 911                                      </tr>
 912                                      <tr>
 913                                          <td align="right">
 914                                          <?php echo T_('Caption:'); ?>
 915                                          </td>
 916                                          <td>
 917                                          <input class="text_area" type="text" name="_caption" value="" size="30" />
 918                                          </td>
 919                                      </tr>
 920                                      <tr>
 921                                          <td align="right">
 922                                          <?php echo T_('Caption Position:'); ?>
 923                                          </td>
 924                                          <td>
 925                                          <?php echo $lists['_caption_position']; ?>
 926                                          </td>
 927                                      </tr>
 928                                      <tr>
 929                                          <td align="right">
 930                                          <?php echo T_('Caption Align:'); ?>
 931                                          </td>
 932                                          <td>
 933                                          <?php echo $lists['_caption_align']; ?>
 934                                          </td>
 935                                      </tr>
 936                                      <tr>
 937                                          <td align="right">
 938                                          <?php echo T_('Width:'); ?>
 939                                          </td>
 940                                          <td>
 941                                          <input class="text_area" type="text" name="_width" value="" size="5" maxlength="5" />
 942                                          </td>
 943                                      </tr>
 944                                      <tr>
 945                                          <td colspan="2">
 946                                          <input class="button" type="button" value="<?php echo T_('Apply'); ?>" onClick="applyImageProps()" />
 947                                          </td>
 948                                      </tr>
 949                                      </table>
 950                                  </td>
 951                              </tr>
 952                              </table>
 953                              <?php
 954                              $tabs->endTab();
 955                              $tabs->startTab(T_("Parameters"),"params-page");
 956                              ?>
 957                              <table class="adminform">
 958                              <tr>
 959                                  <th colspan="2">
 960                                  <?php echo T_('Parameter Control'); ?>
 961                                  </th>
 962                              </tr>
 963                              <tr>
 964                                  <td>
 965                                  * <?php echo T_('These Parameters only control what you see when you click to view an item fully'); ?> *
 966                                  <br /><br />
 967                                  </td>
 968                              </tr>
 969                              <tr>
 970                                  <td>
 971                                  <?php echo $params->render();?>
 972                                  </td>
 973                              </tr>
 974                              </table>
 975                              <?php
 976                              $tabs->endTab();
 977                              $tabs->startTab(T_("Meta Info"),"metadata-page");
 978                              ?>
 979                              <table class="adminform">
 980                              <tr>
 981                                  <th colspan="2">
 982                                  <?php echo T_('Meta Data'); ?>
 983                                  </th>
 984                              </tr>
 985                              <tr>
 986                                  <td>
 987                                  <?php echo T_('Description:'); ?>
 988                                  <br />
 989                                  <textarea class="text_area" cols="30" rows="3" style="width:300px; height:50px" name="metadesc" width="500"><?php echo str_replace('&','&amp;',$row->metadesc); ?></textarea>
 990                                  </td>
 991                              </tr>
 992                                  <tr>
 993                                  <td>
 994                                  <?php echo T_('Keywords:'); ?>
 995                                  <br />
 996                                  <textarea class="text_area" cols="30" rows="3" style="width:300px; height:50px" name="metakey" width="500"><?php echo str_replace('&','&amp;',$row->metakey); ?></textarea>
 997                                  </td>
 998                              </tr>
 999                              <tr>
1000                                  <td>
1001                                  <input type="button" class="button" value="<?php echo T_('Add Sect/Cat/Title'); ?>" onClick="f=document.adminForm;f.metakey.value=document.adminForm.sectionid.options[document.adminForm.sectionid.selectedIndex].text+', '+getSelectedText('adminForm','catid')+', '+f.title.value+f.metakey.value;" />
1002                                  </td>
1003                              </tr>
1004                              </table>
1005                              <?php
1006                              $tabs->endTab();
1007                              $tabs->startTab(T_("Link to Menu"),"link-page");
1008                              ?>
1009                              <table class="adminform">
1010                              <tr>
1011                                  <th colspan="2">
1012                                  <?php echo T_('Link to Menu'); ?>
1013                                  </th>
1014                              </tr>
1015                              <tr>
1016                                  <td colspan="2">
1017                                  <?php echo T_("This will create a 'Link - Content Item' in the menu you select") ?>
1018                                  <br /><br />
1019                                  </td>
1020                              </tr>
1021                              <tr>
1022                                  <td valign="top" width="90px">
1023                                  <?php echo T_('Select a Menu'); ?>
1024                                  </td>
1025                                  <td>
1026                                  <?php echo $lists['menuselect']; ?>
1027                                  </td>
1028                              </tr>
1029                              <tr>
1030                                  <td valign="top" width="90px">
1031                                  <?php echo T_('Menu Item Name'); ?>
1032                                  </td>
1033                                  <td>
1034                                  <input type="text" name="link_name" class="inputbox" value="" size="30" />
1035                                  </td>
1036                              </tr>
1037                              <tr>
1038                                  <td>
1039                                  </td>
1040                                  <td>
1041                                  <input name="menu_link" type="button" class="button" value="<?php echo T_('Link to Menu'); ?>" onClick="submitbutton('menulink');" />
1042                                  </td>
1043                              </tr>
1044                              <tr>
1045                                  <th colspan="2">
1046                                  <?php echo T_('Existing Menu Links'); ?>
1047                                  </th>
1048                              </tr>
1049                              <?php
1050                              if ( $menus == NULL ) {
1051                                  ?>
1052                                  <tr>
1053                                      <td colspan="2">
1054                                      <?php echo T_('None'); ?>
1055                                      </td>
1056                                  </tr>
1057                                  <?php
1058                              } else {
1059                                  mosCommonHTML::menuLinksContent( $menus );
1060                              }
1061                              ?>
1062                              <tr>
1063                                  <td colspan="2">
1064                                  </td>
1065                              </tr>
1066                              </table>
1067                              <?php
1068                              $tabs->endTab();
1069                              $tabs->endPane();
1070                              ?>
1071                              </td>
1072                          </tr>        
1073                          </table>
1074                      </td>
1075                      </tr>
1076                      </table>
1077                      </div>
1078                      </td>    
1079                  </tr>
1080              </table>
1081              <input type="hidden" name="id" value="<?php echo $row->id; ?>" />
1082              <input type="hidden" name="version" value="<?php echo $row->version; ?>" />
1083              <input type="hidden" name="mask" value="0" />
1084              <input type="hidden" name="option" value="<?php echo $option;?>" />
1085              <input type="hidden" name="redirect" value="<?php echo $redirect;?>" />
1086              <input type="hidden" name="task" value="" />
1087              <input type="hidden" name="images" value="" />
1088              <input type="hidden" name="hidemainmenu" value="0" />
1089              </form>
1090          </td>
1091      </tr>
1092  </table>
1093          <?php
1094  
1095      }
1096  
1097  
1098      /**
1099      * Form to select Section/Category to move item(s) to
1100      * @param array An array of selected objects
1101      * @param int The current section we are looking at
1102      * @param array The list of sections and categories to move to
1103      */
1104  	function moveSection( $cid, $sectCatList, $option, $sectionid, $items ) {
1105          ?>
1106          <script type="text/javascript">
1107  		function submitbutton(pressbutton) {
1108              var form = document.adminForm;
1109              if (pressbutton == 'cancel') {
1110                  submitform( pressbutton );
1111                  return;
1112              }
1113  
1114              // do field validation
1115              if (!getSelectedValue( 'adminForm', 'sectcat' )) {
1116                  alert( "<?php echo T_('Please select something'); ?>" );
1117              } else {
1118                  submitform( pressbutton );
1119              }
1120          }
1121          </script>
1122  
1123          <form action="index2.php" method="post" name="adminForm">
1124          <br />
1125          <table class="adminheading">
1126          <tr>
1127              <th class="edit">
1128              <?php echo T_('Move Items'); ?>
1129              </th>
1130          </tr>
1131          </table>
1132  
1133          <br />
1134          <table class="adminform">
1135          <tr>
1136              <td align="left" valign="top" width="40%">
1137              <strong><?php echo T_('Move to Section/Category:'); ?></strong>
1138              <br />
1139              <?php echo $sectCatList; ?>
1140              <br /><br />
1141              </td>
1142              <td align="left" valign="top">
1143              <strong><?php echo T_('Items being Moved:'); ?></strong>
1144              <br />
1145              <?php
1146              echo "<ol>";
1147              foreach ( $items as $item ) {
1148                  echo "<li>". $item->title ."</li>";
1149              }
1150              echo "</ol>";
1151              ?>
1152              </td>
1153          </tr>
1154          </table>
1155          <br /><br />
1156  
1157          <input type="hidden" name="option" value="<?php echo $option;?>" />
1158          <input type="hidden" name="sectionid" value="<?php echo $sectionid; ?>" />
1159          <input type="hidden" name="task" value="" />
1160          <?php
1161          foreach ($cid as $id) {
1162              echo "\n<input type=\"hidden\" name=\"cid[]\" value=\"$id\" />";
1163          }
1164          ?>
1165          </form>
1166          <?php
1167      }
1168  
1169  
1170  
1171      /**
1172      * Form to select Section/Category to copys item(s) to
1173      */
1174  	function copySection( $option, $cid, $sectCatList, $sectionid, $items  ) {
1175          ?>
1176          <script type="text/javascript">
1177  		function submitbutton(pressbutton) {
1178              var form = document.adminForm;
1179              if (pressbutton == 'cancel') {
1180                  submitform( pressbutton );
1181                  return;
1182              }
1183  
1184              // do field validation
1185              if (!getSelectedValue( 'adminForm', 'sectcat' )) {
1186                  alert( "<?php echo T_('Please select a Section/Category to copy the items to'); ?>" );
1187              } else {
1188                  submitform( pressbutton );
1189              }
1190          }
1191          </script>
1192          <form action="index2.php" method="post" name="adminForm">
1193          <br />
1194          <table class="adminheading">
1195          <tr>
1196              <th class="edit">
1197              <?php echo T_('Copy Content Items'); ?>
1198              </th>
1199          </tr>
1200          </table>
1201  
1202          <br />
1203          <table class="adminform">
1204          <tr>
1205              <td align="left" valign="top" width="40%">
1206              <strong><?php echo T_('Copy to Section/Category:'); ?></strong>
1207              <br />
1208              <?php echo $sectCatList; ?>
1209              <br /><br />
1210              </td>
1211              <td align="left" valign="top">
1212              <strong><?php echo T_('Items being copied:'); ?></strong>
1213              <br />
1214              <?php
1215              echo "<ol>";
1216              foreach ( $items as $item ) {
1217                  echo "<li>". $item->title ."</li>";
1218              }
1219              echo "</ol>";
1220              ?>
1221              </td>
1222          </tr>
1223          </table>
1224          <br /><br />
1225  
1226          <input type="hidden" name="option" value="<?php echo $option;?>" />
1227          <input type="hidden" name="sectionid" value="<?php echo $sectionid; ?>" />
1228          <input type="hidden" name="task" value="" />
1229          <?php
1230          foreach ($cid as $id) {
1231              echo "\n<input type=\"hidden\" name=\"cid[]\" value=\"$id\" />";
1232          }
1233          ?>
1234          </form>
1235          <?php
1236      }
1237  
1238  
1239  }
1240  ?>