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