| [ Index ] |
PHP Cross Reference of Joomla 1.5.26 DE |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * @version $Id: admin.content.html.php 17299 2010-05-27 16:06:54Z ian $ 4 * @package Joomla 5 * @subpackage Content 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 * HTML View class for the Content component 20 * 21 * @static 22 * @package Joomla 23 * @subpackage Content 24 * @since 1.0 25 */ 26 class ContentView 27 { 28 /** 29 * Writes a list of the articles 30 * @param array An array of article objects 31 */ 32 function showContent( &$rows, &$lists, $page, $redirect ) 33 { 34 35 global $mainframe; 36 37 // Initialize variables 38 $db =& JFactory::getDBO(); 39 $user =& JFactory::getUser(); 40 $config =& JFactory::getConfig(); 41 $now =& JFactory::getDate(); 42 43 //Ordering allowed ? 44 $ordering = ($lists['order'] == 'section_name' || $lists['order'] == 'cc.title' || $lists['order'] == 'c.ordering'); 45 JHTML::_('behavior.tooltip'); 46 ?> 47 <form action="index.php?option=com_content" method="post" name="adminForm"> 48 49 <table> 50 <tr> 51 <td width="100%"> 52 <?php echo JText::_( 'Filter' ); ?>: 53 <input type="text" name="search" id="search" value="<?php echo htmlspecialchars($lists['search']);?>" class="text_area" onchange="document.adminForm.submit();" title="<?php echo JText::_( 'Filter by title or enter article ID' );?>"/> 54 <button onclick="this.form.submit();"><?php echo JText::_( 'Go' ); ?></button> 55 <button onclick="document.getElementById('search').value='';this.form.getElementById('filter_sectionid').value='-1';this.form.getElementById('catid').value='0';this.form.getElementById('filter_authorid').value='0';this.form.getElementById('filter_state').value='';this.form.submit();"><?php echo JText::_( 'Reset' ); ?></button> 56 </td> 57 <td nowrap="nowrap"> 58 <?php 59 echo $lists['sectionid']; 60 echo $lists['catid']; 61 echo $lists['authorid']; 62 echo $lists['state']; 63 ?> 64 </td> 65 </tr> 66 </table> 67 68 <table class="adminlist" cellspacing="1"> 69 <thead> 70 <tr> 71 <th width="5"> 72 <?php echo JText::_( 'Num' ); ?> 73 </th> 74 <th width="5"> 75 <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $rows ); ?>);" /> 76 </th> 77 <th class="title"> 78 <?php echo JHTML::_('grid.sort', 'Title', 'c.title', @$lists['order_Dir'], @$lists['order'] ); ?> 79 </th> 80 <th width="1%" nowrap="nowrap"> 81 <?php echo JHTML::_('grid.sort', 'Published', 'c.state', @$lists['order_Dir'], @$lists['order'] ); ?> 82 </th> 83 <th nowrap="nowrap" width="1%"> 84 <?php echo JHTML::_('grid.sort', 'Front Page', 'frontpage', @$lists['order_Dir'], @$lists['order'] ); ?> 85 </th> 86 <th width="8%"> 87 <?php echo JHTML::_('grid.sort', 'Order', 'c.ordering', @$lists['order_Dir'], @$lists['order'] ); ?> 88 <?php if ($ordering) echo JHTML::_('grid.order', $rows ); ?> 89 </th> 90 <th width="7%"> 91 <?php echo JHTML::_('grid.sort', 'Access', 'groupname', @$lists['order_Dir'], @$lists['order'] ); ?> 92 </th> 93 <th class="title" width="8%" nowrap="nowrap"> 94 <?php echo JHTML::_('grid.sort', 'Section', 'section_name', @$lists['order_Dir'], @$lists['order'] ); ?> 95 </th> 96 <th class="title" width="8%" nowrap="nowrap"> 97 <?php echo JHTML::_('grid.sort', 'Category', 'cc.title', @$lists['order_Dir'], @$lists['order'] ); ?> 98 </th> 99 <th class="title" width="8%" nowrap="nowrap"> 100 <?php echo JHTML::_('grid.sort', 'Author', 'author', @$lists['order_Dir'], @$lists['order'] ); ?> 101 </th> 102 <th align="center" width="10"> 103 <?php echo JHTML::_('grid.sort', 'Date', 'c.created', @$lists['order_Dir'], @$lists['order'] ); ?> 104 </th> 105 <th align="center" width="10"> 106 <?php echo JHTML::_('grid.sort', 'Hits', 'c.hits', @$lists['order_Dir'], @$lists['order'] ); ?> 107 </th> 108 <th width="1%" class="title"> 109 <?php echo JHTML::_('grid.sort', 'ID', 'c.id', @$lists['order_Dir'], @$lists['order'] ); ?> 110 </th> 111 </tr> 112 </thead> 113 <tfoot> 114 <tr> 115 <td colspan="15"> 116 <?php echo $page->getListFooter(); ?> 117 </td> 118 </tr> 119 </tfoot> 120 <tbody> 121 <?php 122 $k = 0; 123 $nullDate = $db->getNullDate(); 124 for ($i=0, $n=count( $rows ); $i < $n; $i++) 125 { 126 $row = &$rows[$i]; 127 128 $link = 'index.php?option=com_content§ionid='. $redirect .'&task=edit&cid[]='. $row->id; 129 130 $row->sect_link = JRoute::_( 'index.php?option=com_sections&task=edit&cid[]='. $row->sectionid ); 131 $row->cat_link = JRoute::_( 'index.php?option=com_categories&task=edit&cid[]='. $row->catid ); 132 133 $publish_up =& JFactory::getDate($row->publish_up); 134 $publish_down =& JFactory::getDate($row->publish_down); 135 $publish_up->setOffset($config->getValue('config.offset')); 136 $publish_down->setOffset($config->getValue('config.offset')); 137 if ( $now->toUnix() <= $publish_up->toUnix() && $row->state == 1 ) { 138 $img = 'publish_y.png'; 139 $alt = JText::_( 'Published' ); 140 } else if ( ( $now->toUnix() <= $publish_down->toUnix() || $row->publish_down == $nullDate ) && $row->state == 1 ) { 141 $img = 'publish_g.png'; 142 $alt = JText::_( 'Published' ); 143 } else if ( $now->toUnix() > $publish_down->toUnix() && $row->state == 1 ) { 144 $img = 'publish_r.png'; 145 $alt = JText::_( 'Expired' ); 146 } else if ( $row->state == 0 ) { 147 $img = 'publish_x.png'; 148 $alt = JText::_( 'Unpublished' ); 149 } else if ( $row->state == -1 ) { 150 $img = 'disabled.png'; 151 $alt = JText::_( 'Archived' ); 152 } 153 $times = ''; 154 if (isset($row->publish_up)) { 155 if ($row->publish_up == $nullDate) { 156 $times .= JText::_( 'Start: Always' ); 157 } else { 158 $times .= JText::_( 'Start' ) .": ". $publish_up->toFormat(); 159 } 160 } 161 if (isset($row->publish_down)) { 162 if ($row->publish_down == $nullDate) { 163 $times .= "<br />". JText::_( 'Finish: No Expiry' ); 164 } else { 165 $times .= "<br />". JText::_( 'Finish' ) .": ". $publish_down->toFormat(); 166 } 167 } 168 169 if ( $user->authorize( 'com_users', 'manage' ) ) { 170 if ( $row->created_by_alias ) { 171 $author = $row->created_by_alias; 172 } else { 173 $linkA = 'index.php?option=com_users&task=edit&cid[]='. $row->created_by; 174 $author = '<a href="'. JRoute::_( $linkA ) .'" title="'. JText::_( 'Edit User' ) .'">'. $row->author .'</a>'; 175 } 176 } else { 177 if ( $row->created_by_alias ) { 178 $author = $row->created_by_alias; 179 } else { 180 $author = $row->author; 181 } 182 } 183 184 $access = JHTML::_('grid.access', $row, $i, $row->state ); 185 $checked = JHTML::_('grid.checkedout', $row, $i ); 186 ?> 187 <tr class="<?php echo "row$k"; ?>"> 188 <td> 189 <?php echo $page->getRowOffset( $i ); ?> 190 </td> 191 <td align="center"> 192 <?php echo $checked; ?> 193 </td> 194 <td> 195 <?php 196 if ( JTable::isCheckedOut($user->get ('id'), $row->checked_out ) ) { 197 echo $row->title; 198 } else if ($row->state == -1) { 199 echo htmlspecialchars($row->title, ENT_QUOTES, 'UTF-8'); 200 echo ' [ '. JText::_( 'Archived' ) .' ]'; 201 } else { 202 ?> 203 <a href="<?php echo JRoute::_( $link ); ?>"> 204 <?php echo htmlspecialchars($row->title, ENT_QUOTES); ?></a> 205 <?php 206 } 207 ?> 208 </td> 209 <?php 210 if ( $times ) { 211 ?> 212 <td align="center"> 213 <span class="editlinktip hasTip" title="<?php echo JText::_( 'Publish Information' );?>::<?php echo $times; ?>"><a href="javascript:void(0);" onclick="return listItemTask('cb<?php echo $i;?>','<?php echo $row->state ? 'unpublish' : 'publish' ?>')"> 214 <img src="images/<?php echo $img;?>" width="16" height="16" border="0" alt="<?php echo $alt; ?>" /></a></span> 215 </td> 216 <?php 217 } 218 ?> 219 <td align="center"> 220 <a href="javascript:void(0);" onclick="return listItemTask('cb<?php echo $i;?>','toggle_frontpage')" title="<?php echo ( $row->frontpage ) ? JText::_( 'Yes' ) : JText::_( 'No' );?>"> 221 <img src="images/<?php echo ( $row->frontpage ) ? 'tick.png' : ( $row->state != -1 ? 'publish_x.png' : 'disabled.png' );?>" width="16" height="16" border="0" alt="<?php echo ( $row->frontpage ) ? JText::_( 'Yes' ) : JText::_( 'No' );?>" /></a> 222 </td> 223 <td class="order"> 224 <span><?php echo $page->orderUpIcon( $i, ($row->catid == @$rows[$i-1]->catid), 'orderup', 'Move Up', $ordering); ?></span> 225 <span><?php echo $page->orderDownIcon( $i, $n, ($row->catid == @$rows[$i+1]->catid), 'orderdown', 'Move Down', $ordering ); ?></span> 226 <?php $disabled = $ordering ? '' : 'disabled="disabled"'; ?> 227 <input type="text" name="order[]" size="5" value="<?php echo $row->ordering; ?>" <?php echo $disabled; ?> class="text_area" style="text-align: center" /> 228 </td> 229 <td align="center"> 230 <?php echo $access;?> 231 </td> 232 <td> 233 <a href="<?php echo $row->sect_link; ?>" title="<?php echo JText::_( 'Edit Section' ); ?>"> 234 <?php echo $row->section_name; ?></a> 235 </td> 236 <td> 237 <a href="<?php echo $row->cat_link; ?>" title="<?php echo JText::_( 'Edit Category' ); ?>"> 238 <?php echo $row->name; ?></a> 239 </td> 240 <td> 241 <?php echo $author; ?> 242 </td> 243 <td nowrap="nowrap"> 244 <?php echo JHTML::_('date', $row->created, JText::_('DATE_FORMAT_LC4') ); ?> 245 </td> 246 <td nowrap="nowrap" align="center"> 247 <?php echo $row->hits ?> 248 </td> 249 <td> 250 <?php echo $row->id; ?> 251 </td> 252 </tr> 253 <?php 254 $k = 1 - $k; 255 } 256 ?> 257 </tbody> 258 </table> 259 <?php JHTML::_('content.legend'); ?> 260 261 <input type="hidden" name="option" value="com_content" /> 262 <input type="hidden" name="task" value="" /> 263 <input type="hidden" name="boxchecked" value="0" /> 264 <input type="hidden" name="redirect" value="<?php echo $redirect;?>" /> 265 <input type="hidden" name="filter_order" value="<?php echo $lists['order']; ?>" /> 266 <input type="hidden" name="filter_order_Dir" value="<?php echo $lists['order_Dir']; ?>" /> 267 <?php echo JHTML::_( 'form.token' ); ?> 268 </form> 269 <?php 270 } 271 272 /** 273 * Writes a list of the articles 274 * @param array An array of article objects 275 */ 276 function showArchive( &$rows, $section, &$lists, $pageNav, $option, $all=NULL, $redirect ) 277 { 278 // Initialize variables 279 $user = &JFactory::getUser(); 280 ?> 281 <script language="javascript" type="text/javascript"> 282 function submitbutton(pressbutton) { 283 if (pressbutton == 'remove') { 284 if (document.adminForm.boxchecked.value == 0) { 285 alert("<?php echo JText::_( 'VALIDSELECTIONLISTSENDTRASH', true ); ?>"); 286 } else if ( confirm("<?php echo JText::_( 'VALIDTRASHSELECTEDITEMS', true ); ?>")) { 287 submitform('remove'); 288 } 289 } else { 290 submitform(pressbutton); 291 } 292 } 293 </script> 294 <form action="index.php?option=com_content&task=showarchive&sectionid=0" method="post" name="adminForm"> 295 296 <table> 297 <tr> 298 <td align="left" width="100%"> 299 <?php echo JText::_( 'Filter' ); ?>: 300 <input type="text" name="search" id="search" value="<?php echo htmlspecialchars($lists['search']);?>" class="text_area" onchange="document.adminForm.submit();" /> 301 <input type="button" value="<?php echo JText::_( 'Go' ); ?>" class="button" onclick="this.form.submit();" /> 302 <input type="button" value="<?php echo JText::_( 'Reset' ); ?>" class="button" onclick="getElementById('search').value='';this.form.submit();" /> 303 </td> 304 <td nowrap="nowrap"> 305 <?php 306 if ( $all ) { 307 echo $lists['sectionid']; 308 } 309 echo $lists['catid']; 310 echo $lists['authorid']; 311 ?> 312 </td> 313 </tr> 314 </table> 315 316 <div id="tablecell"> 317 <table class="adminlist"> 318 <thead> 319 <tr> 320 <th width="5"> 321 <?php echo JText::_( 'Num' ); ?> 322 </th> 323 <th width="20"> 324 <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $rows ); ?>);" /> 325 </th> 326 <th class="title"> 327 <?php echo JHTML::_('grid.sort', 'Title', 'c.title', @$lists['order_Dir'], @$lists['order'] ); ?> 328 </th> 329 <th width="3%" class="title"> 330 <?php echo JHTML::_('grid.sort', 'ID', 'c.id', @$lists['order_Dir'], @$lists['order'] ); ?> 331 </th> 332 <th width="15%" class="title"> 333 <?php echo JHTML::_('grid.sort', 'Section', 'sectname', @$lists['order_Dir'], @$lists['order'] ); ?> 334 </th> 335 <th width="15%" class="title"> 336 <?php echo JHTML::_('grid.sort', 'Category', 'cc.name', @$lists['order_Dir'], @$lists['order'] ); ?> 337 </th> 338 <th width="15%" class="title"> 339 <?php echo JHTML::_('grid.sort', 'Author', 'author', @$lists['order_Dir'], @$lists['order'] ); ?> 340 </th> 341 <th align="center" width="10"> 342 <?php echo JHTML::_('grid.sort', 'Date', 'c.created', @$lists['order_Dir'], @$lists['order'] ); ?> 343 </th> 344 </tr> 345 </thead> 346 <tfoot> 347 <tr> 348 <td colspan="8"> 349 <?php echo $pageNav->getListFooter(); ?> 350 </td> 351 </tr> 352 </tfoot> 353 <tbody> 354 <?php 355 $k = 0; 356 for ($i=0, $n=count( $rows ); $i < $n; $i++) { 357 $row = &$rows[$i]; 358 359 $row->cat_link = JRoute::_( 'index.php?option=com_categories&task=edit&cid[]='. $row->catid ); 360 $row->sec_link = JRoute::_( 'index.php?option=com_sections&task=edit&cid[]='. $row->sectionid ); 361 362 if ( $user->authorize( 'com_users', 'manage' ) ) { 363 if ( $row->created_by_alias ) { 364 $author = $row->created_by_alias; 365 } else { 366 $linkA = JRoute::_( 'index.php?option=com_users&task=edit&cid[]='. $row->created_by ); 367 $author = '<a href="'. $linkA .'" title="'. JText::_( 'Edit User' ) .'">'. $row->author .'</a>'; 368 } 369 } else { 370 if ( $row->created_by_alias ) { 371 $author = $row->created_by_alias; 372 } else { 373 $author = $row->author; 374 } 375 } 376 377 ?> 378 <tr class="<?php echo "row$k"; ?>"> 379 <td> 380 <?php echo $pageNav->getRowOffset( $i ); ?> 381 </td> 382 <td width="20"> 383 <?php echo JHTML::_('grid.id', $i, $row->id ); ?> 384 </td> 385 <td> 386 <?php echo $row->title; ?> 387 </td> 388 <td> 389 <?php echo $row->id; ?> 390 </td> 391 <td> 392 <a href="<?php echo $row->sec_link; ?>" title="<?php echo JText::_( 'Edit Section' ); ?>"> 393 <?php echo $row->sectname; ?></a> 394 </td> 395 <td> 396 <a href="<?php echo $row->cat_link; ?>" title="<?php echo JText::_( 'Edit Category' ); ?>"> 397 <?php echo $row->name; ?></a> 398 </td> 399 <td> 400 <?php echo $author; ?> 401 </td> 402 <td nowrap="nowrap"> 403 <?php echo JHTML::_('date', $row->created, JText::_( 'DATE_FORMAT_LC4' ) ); ?> 404 </td> 405 </tr> 406 <?php 407 $k = 1 - $k; 408 } 409 ?> 410 </tbody> 411 </table> 412 </div> 413 414 <input type="hidden" name="option" value="<?php echo $option;?>" /> 415 <input type="hidden" name="sectionid" value="<?php echo $section->id;?>" /> 416 <input type="hidden" name="task" value="showarchive" /> 417 <input type="hidden" name="returntask" value="showarchive" /> 418 <input type="hidden" name="boxchecked" value="0" /> 419 <input type="hidden" name="redirect" value="<?php echo $redirect;?>" /> 420 <input type="hidden" name="filter_order" value="<?php echo $lists['order']; ?>" /> 421 <input type="hidden" name="filter_order_Dir" value="" /> 422 <?php echo JHTML::_( 'form.token' ); ?> 423 </form> 424 <?php 425 } 426 427 /** 428 * Writes the edit form for new and existing article 429 * 430 * A new record is defined when <var>$row</var> is passed with the <var>id</var> 431 * property set to 0. 432 * @param JTableContent The category object 433 * @param string The html for the groups select list 434 */ 435 function editContent( &$row, $section, &$lists, &$sectioncategories, $option, &$form ) 436 { 437 JRequest::setVar( 'hidemainmenu', 1 ); 438 439 jimport('joomla.html.pane'); 440 JFilterOutput::objectHTMLSafe( $row ); 441 442 $db = &JFactory::getDBO(); 443 $editor = &JFactory::getEditor(); 444 // TODO: allowAllClose should default true in J!1.6, so remove the array when it does. 445 $pane = &JPane::getInstance('sliders', array('allowAllClose' => true)); 446 447 JHTML::_('behavior.tooltip'); 448 ?> 449 <script language="javascript" type="text/javascript"> 450 <!-- 451 var sectioncategories = new Array; 452 <?php 453 $i = 0; 454 foreach ($sectioncategories as $k=>$items) { 455 foreach ($items as $v) { 456 echo "sectioncategories[".$i++."] = new Array( '$k','".addslashes( $v->id )."','".addslashes( $v->title )."' );\n\t\t"; 457 } 458 } 459 ?> 460 461 function submitbutton(pressbutton) 462 { 463 var form = document.adminForm; 464 465 if ( pressbutton == 'menulink' ) { 466 if ( form.menuselect.value == "" ) { 467 alert( "<?php echo JText::_( 'Please select a Menu', true ); ?>" ); 468 return; 469 } else if ( form.link_name.value == "" ) { 470 alert( "<?php echo JText::_( 'Please enter a Name for this menu item', true ); ?>" ); 471 return; 472 } 473 } 474 475 if (pressbutton == 'cancel') { 476 submitform( pressbutton ); 477 return; 478 } 479 480 // do field validation 481 var text = <?php echo $editor->getContent( 'text' ); ?> 482 if (form.title.value == ""){ 483 alert( "<?php echo JText::_( 'Article must have a title', true ); ?>" ); 484 } else if (form.sectionid.value == "-1"){ 485 alert( "<?php echo JText::_( 'You must select a Section', true ); ?>" ); 486 } else if (form.catid.value == "-1"){ 487 alert( "<?php echo JText::_( 'You must select a Category', true ); ?>" ); 488 } else if (form.catid.value == ""){ 489 alert( "<?php echo JText::_( 'You must select a Category', true ); ?>" ); 490 } else if (text == ""){ 491 alert( "<?php echo JText::_( 'Article must have some text', true ); ?>" ); 492 } else { 493 <?php 494 echo $editor->save( 'text' ); 495 ?> 496 submitform( pressbutton ); 497 } 498 } 499 //--> 500 </script> 501 502 <form action="index.php" method="post" name="adminForm"> 503 504 <table cellspacing="0" cellpadding="0" border="0" width="100%"> 505 <tr> 506 <td valign="top"> 507 <?php ContentView::_displayArticleDetails( $row, $lists ); ?> 508 <table class="adminform"> 509 <tr> 510 <td> 511 <?php 512 // parameters : areaname, content, width, height, cols, rows 513 echo $editor->display( 'text', $row->text , '100%', '550', '75', '20' ) ; 514 ?> 515 </td> 516 </tr> 517 </table> 518 </td> 519 <td valign="top" width="320" style="padding: 7px 0 0 5px"> 520 <?php 521 ContentView::_displayArticleStats($row, $lists); 522 523 $title = JText::_( 'Parameters - Article' ); 524 echo $pane->startPane("content-pane"); 525 echo $pane->startPanel( $title, "detail-page" ); 526 echo $form->render('details'); 527 528 $title = JText::_( 'Parameters - Advanced' ); 529 echo $pane->endPanel(); 530 echo $pane->startPanel( $title, "params-page" ); 531 echo $form->render('params', 'advanced'); 532 533 $title = JText::_( 'Metadata Information' ); 534 echo $pane->endPanel(); 535 echo $pane->startPanel( $title, "metadata-page" ); 536 echo $form->render('meta', 'metadata'); 537 538 echo $pane->endPanel(); 539 echo $pane->endPane(); 540 ?> 541 </td> 542 </tr> 543 </table> 544 545 <input type="hidden" name="id" value="<?php echo $row->id; ?>" /> 546 <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" /> 547 <input type="hidden" name="version" value="<?php echo $row->version; ?>" /> 548 <input type="hidden" name="mask" value="0" /> 549 <input type="hidden" name="option" value="<?php echo $option;?>" /> 550 <input type="hidden" name="task" value="" /> 551 <?php echo JHTML::_( 'form.token' ); ?> 552 </form> 553 <?php 554 echo JHTML::_('behavior.keepalive'); 555 } 556 557 558 /** 559 * Form to select Section/Category to move item(s) to 560 * @param array An array of selected objects 561 * @param int The current section we are looking at 562 * @param array The list of sections and categories to move to 563 */ 564 function moveSection( $cid, $sectCatList, $option, $sectionid, $items ) 565 { 566 ?> 567 <script language="javascript" type="text/javascript"> 568 function submitbutton(pressbutton) { 569 var form = document.adminForm; 570 if (pressbutton == 'cancel') { 571 submitform( pressbutton ); 572 return; 573 } 574 575 // do field validation 576 if (!getSelectedValue( 'adminForm', 'sectcat' )) { 577 alert( "<?php echo JText::_( 'Please select something', true ); ?>" ); 578 } else { 579 submitform( pressbutton ); 580 } 581 } 582 </script> 583 584 <form action="index.php" method="post" name="adminForm"> 585 586 <table class="adminform"> 587 <tr> 588 <td valign="top" width="40%"> 589 <strong><?php echo JText::_( 'Move to Section/Category' ); ?>:</strong> 590 <br /> 591 <?php echo $sectCatList; ?> 592 <br /><br /> 593 </td> 594 <td valign="top"> 595 <strong><?php echo JText::_( 'Articles being Moved' ); ?>:</strong> 596 <br /> 597 <?php 598 echo "<ol>"; 599 foreach ( $items as $item ) { 600 echo "<li>". $item->title ."</li>"; 601 } 602 echo "</ol>"; 603 ?> 604 </td> 605 </tr> 606 </table> 607 <br /><br /> 608 609 <input type="hidden" name="option" value="<?php echo $option;?>" /> 610 <input type="hidden" name="sectionid" value="<?php echo $sectionid; ?>" /> 611 <input type="hidden" name="task" value="" /> 612 <?php 613 foreach ($cid as $id) { 614 echo "\n<input type=\"hidden\" name=\"cid[]\" value=\"$id\" />"; 615 } 616 ?> 617 <?php echo JHTML::_( 'form.token' ); ?> 618 </form> 619 <?php 620 } 621 622 /** 623 * Form to select Section/Category to copys item(s) to 624 */ 625 function copySection( $option, $cid, $sectCatList, $sectionid, $items ) 626 { 627 ?> 628 <script language="javascript" type="text/javascript"> 629 function submitbutton(pressbutton) { 630 var form = document.adminForm; 631 if (pressbutton == 'cancel') { 632 submitform( pressbutton ); 633 return; 634 } 635 636 // do field validation 637 if (!getSelectedValue( 'adminForm', 'sectcat' )) { 638 alert( "<?php echo JText::_( 'VALIDSELECTSECTCATCOPYITEMS', true ); ?>" ); 639 } else { 640 submitform( pressbutton ); 641 } 642 } 643 </script> 644 <form action="index.php" method="post" name="adminForm"> 645 646 <table class="adminform"> 647 <tr> 648 <td valign="top" width="40%"> 649 <strong><?php echo JText::_( 'Copy to Section/Category' ); ?>:</strong> 650 <br /> 651 <?php echo $sectCatList; ?> 652 <br /><br /> 653 </td> 654 <td valign="top"> 655 <strong><?php echo JText::_( 'Articles being copied' ); ?>:</strong> 656 <br /> 657 <?php 658 echo "<ol>"; 659 foreach ( $items as $item ) { 660 echo "<li>". $item->title ."</li>"; 661 } 662 echo "</ol>"; 663 ?> 664 </td> 665 </tr> 666 </table> 667 <br /><br /> 668 669 <input type="hidden" name="option" value="<?php echo $option;?>" /> 670 <input type="hidden" name="sectionid" value="<?php echo $sectionid; ?>" /> 671 <input type="hidden" name="task" value="" /> 672 <?php 673 foreach ($cid as $id) { 674 echo "\n<input type=\"hidden\" name=\"cid[]\" value=\"$id\" />"; 675 } 676 ?> 677 <?php echo JHTML::_( 'form.token' ); ?> 678 </form> 679 <?php 680 } 681 682 function previewContent() 683 { 684 global $mainframe; 685 686 $editor =& JFactory::getEditor(); 687 688 $document =& JFactory::getDocument(); 689 $document->setLink(JURI::root()); 690 691 JHTML::_('behavior.caption'); 692 693 ?> 694 <script> 695 var form = window.top.document.adminForm 696 var title = form.title.value; 697 698 var alltext = window.top.<?php echo $editor->getContent('text') ?>; 699 alltext = alltext.replace(/<hr\s+id=(\"|')system-readmore(\"|')\s*\/*>/i, ''); 700 701 </script> 702 703 <table align="center" width="90%" cellspacing="2" cellpadding="2" border="0"> 704 <tr> 705 <td class="contentheading" colspan="2"><script>document.write(title);</script></td> 706 </tr> 707 <tr> 708 <script>document.write("<td valign=\"top\" height=\"90%\" colspan=\"2\">" + alltext + "</td>");</script> 709 </tr> 710 </table> 711 <?php 712 } 713 714 /** 715 * Renders pagebreak options 716 * 717 */ 718 function insertPagebreak() 719 { 720 $eName = JRequest::getVar('e_name'); 721 $eName = preg_replace( '#[^A-Z0-9\-\_\[\]]#i', '', $eName ); 722 ?> 723 <script type="text/javascript"> 724 function insertPagebreak() 725 { 726 // Get the pagebreak title 727 var title = document.getElementById("title").value; 728 if (title != '') { 729 title = "title=\""+title+"\" "; 730 } 731 732 // Get the pagebreak toc alias -- not inserting for now 733 // don't know which attribute to use... 734 var alt = document.getElementById("alt").value; 735 if (alt != '') { 736 alt = "alt=\""+alt+"\" "; 737 } 738 739 var tag = "<hr class=\"system-pagebreak\" "+title+" "+alt+"/>"; 740 741 window.parent.jInsertEditorText(tag, '<?php echo $eName; ?>'); 742 window.parent.document.getElementById('sbox-window').close(); 743 return false; 744 } 745 </script> 746 747 <form> 748 <table width="100%" align="center"> 749 <tr width="40%"> 750 <td class="key" align="right"> 751 <label for="title"> 752 <?php echo JText::_( 'PGB PAGE TITLE' ); ?> 753 </label> 754 </td> 755 <td> 756 <input type="text" id="title" name="title" /> 757 </td> 758 </tr> 759 <tr width="60%"> 760 <td class="key" align="right"> 761 <label for="alias"> 762 <?php echo JText::_( 'PGB TOC ALIAS PROMPT' ); ?> 763 </label> 764 </td> 765 <td> 766 <input type="text" id="alt" name="alt" /> 767 </td> 768 </tr> 769 </table> 770 </form> 771 <button onclick="insertPagebreak();"><?php echo JText::_( 'PGB INS PAGEBRK' ); ?></button> 772 <?php 773 } 774 775 function _displayArticleDetails(&$row, &$lists ) 776 { 777 ?> 778 <table class="adminform"> 779 <tr> 780 <td> 781 <label for="title"> 782 <?php echo JText::_( 'Title' ); ?> 783 </label> 784 </td> 785 <td> 786 <input class="inputbox" type="text" name="title" id="title" size="40" maxlength="255" value="<?php echo $row->title; ?>" /> 787 </td> 788 <td> 789 <label> 790 <?php echo JText::_( 'Published' ); ?> 791 </label> 792 </td> 793 <td> 794 <?php echo $lists['state']; ?> 795 </td> 796 </tr> 797 <tr> 798 <td> 799 <label for="alias"> 800 <?php echo JText::_( 'Alias' ); ?> 801 </label> 802 </td> 803 <td> 804 <input class="inputbox" type="text" name="alias" id="alias" size="40" maxlength="255" value="<?php echo $row->alias; ?>" title="<?php echo JText::_( 'ALIASTIP' ); ?>" /> 805 </td> 806 <td> 807 <label> 808 <?php echo JText::_( 'Frontpage' ); ?> 809 </label> 810 </td> 811 <td> 812 <?php echo $lists['frontpage']; ?> 813 </td> 814 </tr> 815 <tr> 816 <td> 817 <label for="sectionid"> 818 <?php echo JText::_( 'Section' ); ?> 819 </label> 820 </td> 821 <td> 822 <?php echo $lists['sectionid']; ?> 823 </td> 824 <td> 825 <label for="catid"> 826 <?php echo JText::_( 'Category' ); ?> 827 </label> 828 </td> 829 <td> 830 <?php echo $lists['catid']; ?> 831 </td> 832 </tr> 833 </table> 834 <?php 835 } 836 837 function _displayArticleStats(&$row, &$lists ) 838 { 839 $db =& JFactory::getDBO(); 840 841 $create_date = null; 842 $nullDate = $db->getNullDate(); 843 844 // used to hide "Reset Hits" when hits = 0 845 if ( !$row->hits ) { 846 $visibility = 'style="display: none; visibility: hidden;"'; 847 } else { 848 $visibility = ''; 849 } 850 851 ?> 852 <table width="100%" style="border: 1px dashed silver; padding: 5px; margin-bottom: 10px;"> 853 <?php 854 if ( $row->id ) { 855 ?> 856 <tr> 857 <td> 858 <strong><?php echo JText::_( 'Article ID' ); ?>:</strong> 859 </td> 860 <td> 861 <?php echo $row->id; ?> 862 </td> 863 </tr> 864 <?php 865 } 866 ?> 867 <tr> 868 <td> 869 <strong><?php echo JText::_( 'State' ); ?></strong> 870 </td> 871 <td> 872 <?php echo $row->state > 0 ? JText::_( 'Published' ) : ($row->state < 0 ? JText::_( 'Archived' ) : JText::_( 'Draft Unpublished' ) );?> 873 </td> 874 </tr> 875 <tr> 876 <td> 877 <strong><?php echo JText::_( 'Hits' ); ?></strong> 878 </td> 879 <td> 880 <?php echo $row->hits;?> 881 <span <?php echo $visibility; ?>> 882 <input name="reset_hits" type="button" class="button" value="<?php echo JText::_( 'Reset' ); ?>" onclick="submitbutton('resethits');" /> 883 </span> 884 </td> 885 </tr> 886 <tr> 887 <td> 888 <strong><?php echo JText::_( 'Revised' ); ?></strong> 889 </td> 890 <td> 891 <?php echo $row->version;?> <?php echo JText::_( 'times' ); ?> 892 </td> 893 </tr> 894 <tr> 895 <td> 896 <strong><?php echo JText::_( 'Created' ); ?></strong> 897 </td> 898 <td> 899 <?php 900 if ( $row->created == $nullDate ) { 901 echo JText::_( 'New document' ); 902 } else { 903 echo JHTML::_('date', $row->created, JText::_('DATE_FORMAT_LC2') ); 904 } 905 ?> 906 </td> 907 </tr> 908 <tr> 909 <td> 910 <strong><?php echo JText::_( 'Modified' ); ?></strong> 911 </td> 912 <td> 913 <?php 914 if ( $row->modified == $nullDate ) { 915 echo JText::_( 'Not modified' ); 916 } else { 917 echo JHTML::_('date', $row->modified, JText::_('DATE_FORMAT_LC2')); 918 } 919 ?> 920 </td> 921 </tr> 922 </table> 923 <?php 924 } 925 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Wed Mar 28 15:54:07 2012 | Cross-referenced by PHPXref 0.7.1 |