Annotation of /mambo/trunk/administrator/components/com_modules/admin.modules.html.php
Parent Directory
|
Revision Log
Revision 1 - (view) (download)
| 1 : | root | 1 | <?php |
| 2 : | /** | ||
| 3 : | * @version $Id: admin.modules.html.php,v 1.3 2005/10/21 17:33:55 lang3 Exp $ | ||
| 4 : | * @package Mambo | ||
| 5 : | * @subpackage Modules | ||
| 6 : | * @copyright (C) 2000 - 2005 Miro International Pty Ltd | ||
| 7 : | * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL | ||
| 8 : | * Mambo is Free Software | ||
| 9 : | */ | ||
| 10 : | |||
| 11 : | /** ensure this file is being included by a parent file */ | ||
| 12 : | defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); | ||
| 13 : | |||
| 14 : | /** | ||
| 15 : | * @package Mambo | ||
| 16 : | * @subpackage Modules | ||
| 17 : | */ | ||
| 18 : | class HTML_modules { | ||
| 19 : | |||
| 20 : | /** | ||
| 21 : | * Writes a list of the defined modules | ||
| 22 : | * @param array An array of category objects | ||
| 23 : | */ | ||
| 24 : | function showModules( &$rows, $myid, $client, &$pageNav, $option, &$lists, $search ) { | ||
| 25 : | global $my; | ||
| 26 : | |||
| 27 : | mosCommonHTML::loadOverlib(); | ||
| 28 : | ?> | ||
| 29 : | <form action="index2.php" method="post" name="adminForm"> | ||
| 30 : | |||
| 31 : | <table class="adminheading"> | ||
| 32 : | <tr> | ||
| 33 : | <th class="modules" rowspan="2"> | ||
| 34 : | Module Manager <small><small>[ <?php echo $client == 'admin' ? 'Administrator' : 'Site';?> ]</small></small> | ||
| 35 : | </th> | ||
| 36 : | <td width="right"> | ||
| 37 : | <?php echo $lists['position'];?> | ||
| 38 : | </td> | ||
| 39 : | <td width="right"> | ||
| 40 : | <?php echo $lists['type'];?> | ||
| 41 : | </td> | ||
| 42 : | </tr> | ||
| 43 : | <tr> | ||
| 44 : | <td align="right"> | ||
| 45 : | Filter: | ||
| 46 : | </td> | ||
| 47 : | <td> | ||
| 48 : | <input type="text" name="search" value="<?php echo $search;?>" class="text_area" onChange="document.adminForm.submit();" /> | ||
| 49 : | </td> | ||
| 50 : | </tr> | ||
| 51 : | </table> | ||
| 52 : | |||
| 53 : | <table class="adminlist"> | ||
| 54 : | <tr> | ||
| 55 : | <th width="20px">#</th> | ||
| 56 : | <th width="20px"> | ||
| 57 : | <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $rows );?>);" /> | ||
| 58 : | </th> | ||
| 59 : | <th class="title"> | ||
| 60 : | Module Name | ||
| 61 : | </th> | ||
| 62 : | <th nowrap="nowrap" width="10%"> | ||
| 63 : | Published | ||
| 64 : | </th> | ||
| 65 : | <th colspan="2" align="center" width="5%"> | ||
| 66 : | Reorder | ||
| 67 : | </th> | ||
| 68 : | <th width="2%"> | ||
| 69 : | Order | ||
| 70 : | </th> | ||
| 71 : | <th width="1%"> | ||
| 72 : | <a href="javascript: saveorder( <?php echo count( $rows )-1; ?> )"><img src="images/filesave.png" border="0" width="16" height="16" alt="Save Order" /></a> | ||
| 73 : | </th> | ||
| 74 : | <?php | ||
| 75 : | if ( !$client ) { | ||
| 76 : | ?> | ||
| 77 : | <th nowrap="nowrap" width="7%"> | ||
| 78 : | Access | ||
| 79 : | </th> | ||
| 80 : | <?php | ||
| 81 : | } | ||
| 82 : | ?> | ||
| 83 : | <th nowrap="nowrap" width="7%"> | ||
| 84 : | Position | ||
| 85 : | </th> | ||
| 86 : | <th nowrap="nowrap" width="5%"> | ||
| 87 : | Pages | ||
| 88 : | </th> | ||
| 89 : | <th nowrap="nowrap" width="5%"> | ||
| 90 : | ID | ||
| 91 : | </th> | ||
| 92 : | <th nowrap="nowrap" width="10%" align="left"> | ||
| 93 : | Type | ||
| 94 : | </th> | ||
| 95 : | </tr> | ||
| 96 : | <?php | ||
| 97 : | $k = 0; | ||
| 98 : | for ($i=0, $n=count( $rows ); $i < $n; $i++) { | ||
| 99 : | $row = &$rows[$i]; | ||
| 100 : | |||
| 101 : | $link = 'index2.php?option=com_modules&client='. $client .'&task=editA&hidemainmenu=1&id='. $row->id; | ||
| 102 : | |||
| 103 : | $access = mosCommonHTML::AccessProcessing( $row, $i ); | ||
| 104 : | $checked = mosCommonHTML::CheckedOutProcessing( $row, $i ); | ||
| 105 : | $published = mosCommonHTML::PublishedProcessing( $row, $i ); | ||
| 106 : | ?> | ||
| 107 : | <tr class="<?php echo "row$k"; ?>"> | ||
| 108 : | <td align="right"> | ||
| 109 : | <?php echo $pageNav->rowNumber( $i ); ?> | ||
| 110 : | </td> | ||
| 111 : | <td> | ||
| 112 : | <?php echo $checked; ?> | ||
| 113 : | </td> | ||
| 114 : | <td> | ||
| 115 : | <?php | ||
| 116 : | if ( $row->checked_out && ( $row->checked_out != $my->id ) ) { | ||
| 117 : | echo $row->title; | ||
| 118 : | } else { | ||
| 119 : | ?> | ||
| 120 : | <a href="<?php echo $link; ?>"> | ||
| 121 : | <?php echo $row->title; ?> | ||
| 122 : | </a> | ||
| 123 : | <?php | ||
| 124 : | } | ||
| 125 : | ?> | ||
| 126 : | </td> | ||
| 127 : | <td align="center"> | ||
| 128 : | <?php echo $published;?> | ||
| 129 : | </td> | ||
| 130 : | <td> | ||
| 131 : | <?php echo $pageNav->orderUpIcon( $i, ($row->position == @$rows[$i-1]->position) ); ?> | ||
| 132 : | </td> | ||
| 133 : | <td> | ||
| 134 : | <?php echo $pageNav->orderDownIcon( $i, $n, ($row->position == @$rows[$i+1]->position) ); ?> | ||
| 135 : | </td> | ||
| 136 : | <td align="center" colspan="2"> | ||
| 137 : | <input type="text" name="order[]" size="5" value="<?php echo $row->ordering; ?>" class="text_area" style="text-align: center" /> | ||
| 138 : | </td> | ||
| 139 : | <?php | ||
| 140 : | if ( !$client ) { | ||
| 141 : | ?> | ||
| 142 : | <td align="center"> | ||
| 143 : | <?php echo $access;?> | ||
| 144 : | </td> | ||
| 145 : | <?php | ||
| 146 : | } | ||
| 147 : | ?> | ||
| 148 : | <td align="center"> | ||
| 149 : | <?php echo $row->position; ?> | ||
| 150 : | </td> | ||
| 151 : | <td align="center"> | ||
| 152 : | <?php | ||
| 153 : | if (is_null( $row->pages )) { | ||
| 154 : | echo 'None'; | ||
| 155 : | } else if ($row->pages > 0) { | ||
| 156 : | echo 'Varies'; | ||
| 157 : | } else { | ||
| 158 : | echo 'All'; | ||
| 159 : | } | ||
| 160 : | ?> | ||
| 161 : | </td> | ||
| 162 : | <td align="center"> | ||
| 163 : | <?php echo $row->id;?> | ||
| 164 : | </td> | ||
| 165 : | <td align="left"> | ||
| 166 : | <?php echo $row->module ? $row->module : "User";?> | ||
| 167 : | </td> | ||
| 168 : | </tr> | ||
| 169 : | <?php | ||
| 170 : | $k = 1 - $k; | ||
| 171 : | } | ||
| 172 : | ?> | ||
| 173 : | </table> | ||
| 174 : | |||
| 175 : | <?php echo $pageNav->getListFooter(); ?> | ||
| 176 : | |||
| 177 : | <input type="hidden" name="option" value="<?php echo $option;?>" /> | ||
| 178 : | <input type="hidden" name="task" value="" /> | ||
| 179 : | <input type="hidden" name="client" value="<?php echo $client;?>" /> | ||
| 180 : | <input type="hidden" name="boxchecked" value="0" /> | ||
| 181 : | <input type="hidden" name="hidemainmenu" value="0" /> | ||
| 182 : | </form> | ||
| 183 : | <?php | ||
| 184 : | } | ||
| 185 : | |||
| 186 : | /** | ||
| 187 : | * Writes the edit form for new and existing module | ||
| 188 : | * | ||
| 189 : | * A new record is defined when <var>$row</var> is passed with the <var>id</var> | ||
| 190 : | * property set to 0. | ||
| 191 : | * @param mosCategory The category object | ||
| 192 : | * @param array <p>The modules of the left side. The array elements are in the form | ||
| 193 : | * <var>$leftorder[<i>order</i>] = <i>label</i></var> | ||
| 194 : | * where <i>order</i> is the module order from the db table and <i>label</i> is a | ||
| 195 : | * text label associciated with the order.</p> | ||
| 196 : | * @param array See notes for leftorder | ||
| 197 : | * @param array An array of select lists | ||
| 198 : | * @param object Parameters | ||
| 199 : | */ | ||
| 200 : | function editModule( &$row, &$orders2, &$lists, &$params, $option ) { | ||
| 201 : | global $mosConfig_live_site; | ||
| 202 : | |||
| 203 : | $row->titleA = ''; | ||
| 204 : | if ( $row->id ) { | ||
| 205 : | $row->titleA = '<small><small>[ '. $row->title .' ]</small></small>'; | ||
| 206 : | } | ||
| 207 : | |||
| 208 : | mosCommonHTML::loadOverlib(); | ||
| 209 : | ?> | ||
| 210 : | <script language="javascript" type="text/javascript"> | ||
| 211 : | function submitbutton(pressbutton) { | ||
| 212 : | if ( ( pressbutton == 'save' ) && ( document.adminForm.title.value == "" ) ) { | ||
| 213 : | alert("Module must have a title"); | ||
| 214 : | } else { | ||
| 215 : | <?php if ($row->module == "") { | ||
| 216 : | getEditorContents( 'editor1', 'content' ); | ||
| 217 : | }?> | ||
| 218 : | submitform(pressbutton); | ||
| 219 : | } | ||
| 220 : | submitform(pressbutton); | ||
| 221 : | } | ||
| 222 : | <!-- | ||
| 223 : | var originalOrder = '<?php echo $row->ordering;?>'; | ||
| 224 : | var originalPos = '<?php echo $row->position;?>'; | ||
| 225 : | var orders = new Array(); // array in the format [key,value,text] | ||
| 226 : | <?php $i = 0; | ||
| 227 : | foreach ($orders2 as $k=>$items) { | ||
| 228 : | foreach ($items as $v) { | ||
| 229 : | echo "\n orders[".$i++."] = new Array( \"$k\",\"$v->value\",\"$v->text\" );"; | ||
| 230 : | } | ||
| 231 : | } | ||
| 232 : | ?> | ||
| 233 : | //--> | ||
| 234 : | </script> | ||
| 235 : | <table class="adminheading"> | ||
| 236 : | <tr> | ||
| 237 : | <th class="modules"> | ||
| 238 : | <?php echo $lists['client_id'] ? 'Administrator' : 'Site';?> | ||
| 239 : | Module: | ||
| 240 : | <small> | ||
| 241 : | <?php echo $row->id ? 'Edit' : 'New';?> | ||
| 242 : | </small> | ||
| 243 : | <?php echo $row->titleA; ?> | ||
| 244 : | </th> | ||
| 245 : | </tr> | ||
| 246 : | </table> | ||
| 247 : | |||
| 248 : | <form action="index2.php" method="post" name="adminForm"> | ||
| 249 : | |||
| 250 : | <table cellspacing="0" cellpadding="0" width="100%"> | ||
| 251 : | <tr valign="top"> | ||
| 252 : | <td width="60%"> | ||
| 253 : | <table class="adminform"> | ||
| 254 : | <tr> | ||
| 255 : | <th colspan="2"> | ||
| 256 : | Details | ||
| 257 : | </th> | ||
| 258 : | <tr> | ||
| 259 : | <tr> | ||
| 260 : | <td width="100" align="left"> | ||
| 261 : | Title: | ||
| 262 : | </td> | ||
| 263 : | <td> | ||
| 264 : | <input class="text_area" type="text" name="title" size="35" value="<?php echo $row->title; ?>" /> | ||
| 265 : | </td> | ||
| 266 : | </tr> | ||
| 267 : | <!-- START selectable pages --> | ||
| 268 : | <tr> | ||
| 269 : | <td width="100" align="left"> | ||
| 270 : | Show title: | ||
| 271 : | </td> | ||
| 272 : | <td> | ||
| 273 : | <?php echo $lists['showtitle']; ?> | ||
| 274 : | </td> | ||
| 275 : | </tr> | ||
| 276 : | <tr> | ||
| 277 : | <td valign="top" align="left"> | ||
| 278 : | Position: | ||
| 279 : | </td> | ||
| 280 : | <td> | ||
| 281 : | <?php echo $lists['position']; ?> | ||
| 282 : | </td> | ||
| 283 : | </tr> | ||
| 284 : | <tr> | ||
| 285 : | <td valign="top" align="left"> | ||
| 286 : | Module Order: | ||
| 287 : | </td> | ||
| 288 : | <td> | ||
| 289 : | <script language="javascript" type="text/javascript"> | ||
| 290 : | <!-- | ||
| 291 : | writeDynaList( 'class="inputbox" name="ordering" size="1"', orders, originalPos, originalPos, originalOrder ); | ||
| 292 : | //--> | ||
| 293 : | </script> | ||
| 294 : | </td> | ||
| 295 : | </tr> | ||
| 296 : | <tr> | ||
| 297 : | <td valign="top" align="left"> | ||
| 298 : | Access Level: | ||
| 299 : | </td> | ||
| 300 : | <td> | ||
| 301 : | <?php echo $lists['access']; ?> | ||
| 302 : | </td> | ||
| 303 : | </tr> | ||
| 304 : | <tr> | ||
| 305 : | <td valign="top"> | ||
| 306 : | Published: | ||
| 307 : | </td> | ||
| 308 : | <td> | ||
| 309 : | <?php echo $lists['published']; ?> | ||
| 310 : | </td> | ||
| 311 : | </tr> | ||
| 312 : | <tr> | ||
| 313 : | <td colspan="2"> | ||
| 314 : | </td> | ||
| 315 : | </tr> | ||
| 316 : | <tr> | ||
| 317 : | <td valign="top"> | ||
| 318 : | ID: | ||
| 319 : | </td> | ||
| 320 : | <td> | ||
| 321 : | <?php echo $row->id; ?> | ||
| 322 : | </td> | ||
| 323 : | </tr> | ||
| 324 : | <tr> | ||
| 325 : | <td valign="top"> | ||
| 326 : | Description: | ||
| 327 : | </td> | ||
| 328 : | <td> | ||
| 329 : | <?php echo $row->description; ?> | ||
| 330 : | </td> | ||
| 331 : | </tr> | ||
| 332 : | </table> | ||
| 333 : | |||
| 334 : | <table class="adminform"> | ||
| 335 : | <tr> | ||
| 336 : | <th > | ||
| 337 : | Parameters | ||
| 338 : | </th> | ||
| 339 : | <tr> | ||
| 340 : | <tr> | ||
| 341 : | <td> | ||
| 342 : | <?php echo $params->render();?> | ||
| 343 : | </td> | ||
| 344 : | </tr> | ||
| 345 : | </table> | ||
| 346 : | </td> | ||
| 347 : | <td width="40%" > | ||
| 348 : | <table width="100%" class="adminform"> | ||
| 349 : | <tr> | ||
| 350 : | <th> | ||
| 351 : | Pages / Items | ||
| 352 : | </th> | ||
| 353 : | <tr> | ||
| 354 : | <tr> | ||
| 355 : | <td> | ||
| 356 : | Menu Item Link(s): | ||
| 357 : | <br /> | ||
| 358 : | <?php echo $lists['selections']; ?> | ||
| 359 : | </td> | ||
| 360 : | </tr> | ||
| 361 : | </table> | ||
| 362 : | </td> | ||
| 363 : | </tr> | ||
| 364 : | <?php | ||
| 365 : | if ($row->module == "") { | ||
| 366 : | ?> | ||
| 367 : | <tr> | ||
| 368 : | <td colspan="2"> | ||
| 369 : | <table width="100%" class="adminform"> | ||
| 370 : | <tr> | ||
| 371 : | <th colspan="2"> | ||
| 372 : | Custom Output | ||
| 373 : | </th> | ||
| 374 : | <tr> | ||
| 375 : | <tr> | ||
| 376 : | <td valign="top" align="left"> | ||
| 377 : | Content: | ||
| 378 : | </td> | ||
| 379 : | <td> | ||
| 380 : | <?php | ||
| 381 : | // parameters : areaname, content, hidden field, width, height, rows, cols | ||
| 382 : | editorArea( 'editor1', $row->content , 'content', '700', '350', '95', '30' ) ; ?> | ||
| 383 : | </td> | ||
| 384 : | </tr> | ||
| 385 : | </table> | ||
| 386 : | </td> | ||
| 387 : | </tr> | ||
| 388 : | <?php | ||
| 389 : | } | ||
| 390 : | ?> | ||
| 391 : | </table> | ||
| 392 : | |||
| 393 : | <input type="hidden" name="option" value="<?php echo $option; ?>" /> | ||
| 394 : | <input type="hidden" name="id" value="<?php echo $row->id; ?>" /> | ||
| 395 : | <input type="hidden" name="original" value="<?php echo $row->ordering; ?>" /> | ||
| 396 : | <input type="hidden" name="module" value="<?php echo $row->module; ?>" /> | ||
| 397 : | <input type="hidden" name="task" value="" /> | ||
| 398 : | <input type="hidden" name="client_id" value="<?php echo $lists['client_id']; ?>" /> | ||
| 399 : | <?php | ||
| 400 : | if ( $row->client_id || $lists['client_id'] ) { | ||
| 401 : | echo '<input type="hidden" name="client" value="admin" />'; | ||
| 402 : | } | ||
| 403 : | ?> | ||
| 404 : | </form> | ||
| 405 : | <?php | ||
| 406 : | } | ||
| 407 : | |||
| 408 : | } | ||
| 409 : | ?> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

