[ Index ]

PHP Cross Reference of Mambo 4.6.5

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

title

Body

[close]

/administrator/components/com_mambots/ -> admin.mambots.html.php (source)

   1  <?php
   2  /**
   3  * @package Mambo
   4  * @subpackage Mambots
   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_modules {
  21  
  22      /**
  23      * Writes a list of the defined modules
  24      * @param array An array of category objects
  25      */
  26  	function showMambots( &$rows, $client, &$pageNav, $option, &$lists, $search ) {
  27          global $my;
  28  
  29          mosCommonHTML::loadOverlib();
  30          ?>
  31          <form action="index2.php" method="post" name="adminForm">
  32  
  33          <table class="adminheading">
  34          <tr>
  35              <th class="modules">
  36              <?php echo T_('Mambot Manager')?> <small><small>[ <?php echo $client == 'admin' ? T_('Administrator') : T_('Site');?> ]</small></small>
  37              </th>
  38              <td>
  39              <?php echo T_('Filter:')?>
  40              </td>
  41              <td>
  42              <input type="text" name="search" value="<?php echo $search;?>" class="text_area" onChange="document.adminForm.submit();" />
  43              </td>
  44              <td width="right">
  45              <?php echo $lists['type'];?>
  46              </td>
  47          </tr>
  48          </table>
  49  
  50          <table class="adminlist">
  51          <tr>
  52              <th width="20">#</th>
  53              <th width="20">
  54              <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $rows );?>);" />
  55              </th>
  56              <th class="title">
  57              <?php echo T_('Mambot Name')?>
  58              </th>
  59              <th nowrap="nowrap" width="10%">
  60                <?php echo T_('Published')?>
  61              </th>
  62              <th colspan="2" nowrap="true" width="5%">
  63              <?php echo T_('Reorder')?>
  64              </th>
  65              <th width="2%">
  66              <?php echo T_('Order')?>
  67              </th>
  68              <th width="1%">
  69              <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>
  70              </th>
  71              <th nowrap="nowrap" width="10%">
  72              <?php echo T_('Access')?>
  73              </th>
  74              <th nowrap="nowrap" align="left" width="10%">
  75              <?php echo T_('Type')?>
  76              </th>
  77              <th nowrap="nowrap" align="left" width="10%">
  78              <?php echo T_('File')?>
  79              </th>
  80          </tr>
  81          <?php
  82          $k = 0;
  83          for ($i=0, $n=count( $rows ); $i < $n; $i++) {
  84              $row     = &$rows[$i];
  85  
  86              $link = 'index2.php?option=com_mambots&client='. $client .'&task=editA&hidemainmenu=1&id='. $row->id;
  87  
  88              $access     = mosCommonHTML::AccessProcessing( $row, $i );
  89              $checked     = mosCommonHTML::CheckedOutProcessing( $row, $i );
  90              $published     = mosCommonHTML::PublishedProcessing( $row, $i );
  91              ?>
  92              <tr class="<?php echo "row$k"; ?>">
  93                  <td align="right"><?php echo $pageNav->rowNumber( $i ); ?></td>
  94                  <td>
  95                  <?php echo $checked; ?>
  96                  </td>
  97                  <td>
  98                  <?php
  99                  if ( $row->checked_out && ( $row->checked_out != $my->id ) ) {
 100                      echo $row->name;
 101                  } else {
 102                      ?>
 103                      <a href="<?php echo $link; ?>">
 104                      <?php echo $row->name; ?>
 105                      </a>
 106                      <?php
 107                  }
 108                  ?>
 109                  </td>
 110                  <td align="center">
 111                  <?php echo $published;?>
 112                  </td>
 113                  <td>
 114                  <?php echo $pageNav->orderUpIcon( $i, ($row->folder == @$rows[$i-1]->folder && $row->ordering > -10000 && $row->ordering < 10000) ); ?>
 115                  </td>
 116                  <td>
 117                  <?php echo $pageNav->orderDownIcon( $i, $n, ($row->folder == @$rows[$i+1]->folder && $row->ordering > -10000 && $row->ordering < 10000) ); ?>
 118                  </td>
 119                  <td align="center" colspan="2">
 120                  <input type="text" name="order[]" size="5" value="<?php echo $row->ordering; ?>" class="text_area" style="text-align: center" />
 121                  </td>
 122                  <td align="center">
 123                  <?php echo $access;?>
 124                  </td>
 125                  <td align="left" nowrap="true">
 126                  <?php echo $row->folder;?>
 127                  </td>
 128                  <td align="left" nowrap="true">
 129                  <?php echo $row->element;?>
 130                  </td>
 131              </tr>
 132              <?php
 133              $k = 1 - $k;
 134          }
 135          ?>
 136          </table>
 137  
 138          <?php echo $pageNav->getListFooter(); ?>
 139  
 140          <input type="hidden" name="option" value="<?php echo $option;?>" />
 141          <input type="hidden" name="task" value="" />
 142          <input type="hidden" name="client" value="<?php echo $client;?>" />
 143          <input type="hidden" name="boxchecked" value="0" />
 144          <input type="hidden" name="hidemainmenu" value="0" />
 145          </form>
 146          <?php
 147      }
 148  
 149      /**
 150      * Writes the edit form for new and existing module
 151      *
 152      * A new record is defined when <var>$row</var> is passed with the <var>id</var>
 153      * property set to 0.
 154      * @param mosCategory The category object
 155      * @param array <p>The modules of the left side.  The array elements are in the form
 156      * <var>$leftorder[<i>order</i>] = <i>label</i></var>
 157      * where <i>order</i> is the module order from the db table and <i>label</i> is a
 158      * text label associciated with the order.</p>
 159      * @param array See notes for leftorder
 160      * @param array An array of select lists
 161      * @param object Parameters
 162      */
 163  	function editMambot( &$row, &$lists, &$params, $option ) {
 164          global $mosConfig_live_site;
 165  
 166          $row->nameA = '';
 167          if ( $row->id ) {
 168              $row->nameA = '<small><small>[ '. $row->name .' ]</small></small>';
 169          }
 170          ?>
 171          <div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
 172          <script type="text/javascript">
 173  		function submitbutton(pressbutton) {
 174              if (pressbutton == "cancel") {
 175                  submitform(pressbutton);
 176                  return;
 177              }
 178              // validation
 179              var form = document.adminForm;
 180              if (form.name.value == "") {
 181                  alert( '<?php echo T_('Mambot must have a name'); ?>' );
 182              } else if (form.element.value == "") {
 183                  alert( '<?php echo T_('Mambot must have a filename'); ?>' );
 184              } else {
 185                  submitform(pressbutton);
 186              }
 187          }
 188          </script>
 189          <table class="adminheading">
 190          <tr>
 191              <th class="mambots">
 192              <?php echo T_('Site Mambot:')?>
 193              <small>
 194              <?php echo $row->id ? T_('Edit') : T_('New');?>
 195              </small>
 196              <?php echo $row->nameA; ?>
 197              </th>
 198          </tr>
 199          </table>
 200  
 201          <form action="index2.php" method="post" name="adminForm">
 202          <table cellspacing="0" cellpadding="0" width="100%">
 203          <tr valign="top">
 204              <td width="60%" valign="top">
 205                  <table class="adminform">
 206                  <tr>
 207                      <th colspan="2">
 208                      <?php echo T_('Mambot Details'); ?>
 209                      </th>
 210                  <tr>
 211                  <tr>
 212                      <td width="100" align="left">
 213                      <?php echo T_('Name:'); ?>
 214                      </td>
 215                      <td>
 216                      <input class="text_area" type="text" name="name" size="35" value="<?php echo $row->name; ?>" />
 217                      </td>
 218                  </tr>
 219                  <tr>
 220                      <td valign="top" align="left">
 221                      <?php echo T_('Folder:'); ?>
 222                      </td>
 223                      <td>
 224                      <?php echo $lists['folder']; ?>
 225                      </td>
 226                  </tr>
 227                  <tr>
 228                      <td valign="top" align="left">
 229                      <?php echo T_('Mambot file:'); ?>
 230                      </td>
 231                      <td>
 232                      <input class="text_area" type="text" name="element" size="35" value="<?php echo $row->element; ?>" />.php
 233                      </td>
 234                  </tr>
 235                  <tr>
 236                      <td valign="top" align="left">
 237                      <?php echo T_('Mambot Order:'); ?>
 238                      </td>
 239                      <td>
 240                      <?php echo $lists['ordering']; ?>
 241                      </td>
 242                  </tr>
 243                  <tr>
 244                      <td valign="top" align="left">
 245                      <?php echo T_('Access Level:'); ?>
 246                      </td>
 247                      <td>
 248                      <?php echo $lists['access']; ?>
 249                      </td>
 250                  </tr>
 251                  <tr>
 252                      <td valign="top">
 253                      <?php echo T_('Published:'); ?>
 254                      </td>
 255                      <td>
 256                      <?php echo $lists['published']; ?>
 257                      </td>
 258                  </tr>
 259                  <tr>
 260                      <td valign="top" colspan="2">&nbsp;
 261  
 262                      </td>
 263                  </tr>
 264                  <tr>
 265                      <td valign="top">
 266                      <?php echo T_('Description:'); ?>
 267                      </td>
 268                      <td>
 269                      <?php echo $row->description; ?>
 270                      </td>
 271                  </tr>
 272                  </table>
 273              </td>
 274              <td width="40%">
 275                  <table class="adminform">
 276                  <tr>
 277                      <th colspan="2">
 278                      <?php echo T_('Parameters'); ?>
 279                      </th>
 280                  <tr>
 281                  <tr>
 282                      <td>
 283                      <?php
 284                      if ( $row->id ) {
 285                          echo $params->render();
 286                      } else {
 287                          echo '<i>'.T_('No Parameters').'</i>';
 288                      }
 289                      ?>
 290                      </td>
 291                  </tr>
 292                  </table>
 293              </td>
 294          </tr>
 295          </table>
 296  
 297          <input type="hidden" name="option" value="<?php echo $option; ?>" />
 298          <input type="hidden" name="id" value="<?php echo $row->id; ?>" />
 299          <input type="hidden" name="client" value="<?php echo $row->client_id; ?>" />
 300          <input type="hidden" name="task" value="" />
 301          </form>
 302          <script src="<?php echo $mosConfig_live_site;?>/includes/js/overlib_mini.js" type="text/javascript"></script>
 303          <?php
 304      }
 305  }
 306  ?>