• Hauptseite
  • Zusätzliche Informationen
  • Namensbereiche
  • Klassen
  • Dateien

components/com_content/content.html.php

gehe zur Dokumentation dieser Datei
00001 <?php
00015 // no direct access
00016 defined( '_VALID_MOS' ) or die( 'Restricted access' );
00017 
00023 class HTML_content {
00028         function showContentList( $title, &$items, &$access, $id=0, $sectionid=NULL, $gid, &$params, &$pageNav, $other_categories, &$lists, $order, $categories_exist ) {
00029                 global $Itemid, $mosConfig_live_site;
00030 
00031                 if ( $sectionid ) {
00032                         $id = $sectionid;
00033                 }
00034 
00035                 if ( strtolower(get_class( $title )) == 'mossection' ) {
00036                         $catid = 0;
00037                 } else {
00038                         $catid = $title->id;
00039                 }
00040 
00041                 if ( $params->get( 'page_title' ) ) {
00042                         ?>
00043                         <div class="componentheading<?php echo $params->get( 'pageclass_sfx' ); ?>">
00044                         <?php echo htmlspecialchars( $title->name, ENT_QUOTES ); ?>
00045                         </div>
00046                         <?php
00047                 }
00048                 ?>
00049                 <table width="100%" cellpadding="0" cellspacing="0" border="0" align="center" class="contentpane<?php echo $params->get( 'pageclass_sfx' ); ?>">
00050                 <?php
00051                 if ( $params->get('description') || $params->get('description_image') ) {
00052                         ?>
00053                         <tr>
00054                                 <td width="60%" valign="top" class="contentdescription<?php echo $params->get( 'pageclass_sfx' ); ?>" colspan="2">
00055                                 <?php
00056                                 if ( $params->get('description_image') && $title->image ) {
00057                                         $link = $mosConfig_live_site .'/images/stories/'. $title->image;
00058                                         ?>
00059                                         <img src="<?php echo $link;?>" align="<?php echo $title->image_position;?>" hspace="6" alt="<?php echo $title->image;?>" />
00060                                         <?php
00061                                 }
00062                                 if ( $params->get('description') ) {
00063                                         echo $title->description;
00064                                 }
00065                                 ?>
00066                                 </td>
00067                         </tr>
00068                         <?php
00069                 }
00070                 ?>
00071                 <tr>
00072                         <td width="100%">
00073                         <?php
00074                         // Displays the Table of Items in Category View
00075                         if ( $items ) {
00076                                 HTML_content::showTable( $params, $items, $gid, $catid, $id, $pageNav, $access, $sectionid, $lists, $order );
00077                         } else if ( $catid ) {
00078                                 ?>
00079                                 <br />
00080                                 <?php echo _EMPTY_CATEGORY; ?>
00081                                 <br /><br />
00082                                 <?php
00083                         }
00084                         // New Content Icon
00085                         if ( ( $access->canEdit || $access->canEditOwn ) && $categories_exist ) {
00086                                 $link = sefRelToAbs( 'index.php?option=com_content&amp;task=new&amp;sectionid='. $id .'&amp;Itemid='. $Itemid );
00087                                 ?>
00088                                 <a href="<?php echo $link; ?>">
00089                                         <img src="<?php echo $mosConfig_live_site;?>/images/M_images/new.png" width="13" height="14" align="middle" border="0" alt="<?php echo _CMN_NEW;?>" />
00090                                                 &nbsp;<?php echo _CMN_NEW;?>...</a>
00091                                 <br /><br />
00092                                 <?php
00093                         }
00094                         ?>
00095                         </td>
00096                 </tr>
00097                 <tr>
00098                         <td colspan="2">
00099                         <?php
00100                         // Displays listing of Categories
00101                         if ( ( ( count( $other_categories ) > 1 ) || ( count( $other_categories ) < 2 && count( $items ) < 1 ) ) ) {
00102                                 if ( ( $params->get( 'type' ) == 'category' ) && $params->get( 'other_cat' ) ) {
00103                                         HTML_content::showCategories( $params, $items, $gid, $other_categories, $catid, $id, $Itemid );
00104                                 }
00105                                 if ( ( $params->get( 'type' ) == 'section' ) && $params->get( 'other_cat_section' ) ) {
00106                                         HTML_content::showCategories( $params, $items, $gid, $other_categories, $catid, $id, $Itemid );
00107                                 }
00108                         }
00109                         ?>
00110                         </td>
00111                 </tr>
00112                 </table>
00113                 <?php
00114                 // displays back button
00115                 mosHTML::BackButton ( $params );
00116         }
00117 
00118 
00122         function showCategories( &$params, &$items, $gid, &$other_categories, $catid, $id, $Itemid ) {
00123                 if(!count($other_categories)) return;
00124                 ?>
00125                 <ul>
00126                 <?php
00127                 foreach ( $other_categories as $row ) {
00128                         $row->name = htmlspecialchars( stripslashes( ampReplace( $row->name ) ), ENT_QUOTES );
00129                         if ( $catid != $row->id ) {
00130                                 ?>
00131                                 <li>
00132                                         <?php
00133                                         if ( $row->access <= $gid ) {
00134                                                 $link = sefRelToAbs( 'index.php?option=com_content&amp;task=category&amp;sectionid='. $id .'&amp;id='. $row->id .'&amp;Itemid='. $Itemid );
00135                                                 ?>
00136                                                 <a href="<?php echo $link; ?>" class="category">
00137                                                         <?php echo $row->name;?></a>
00138                                                 <?php
00139                                                 if ( $params->get( 'cat_items' ) ) {
00140                                                         ?>
00141                                                         &nbsp;<i>( <?php echo $row->numitems; echo _CHECKED_IN_ITEMS;?> )</i>
00142                                                         <?php
00143                                                 }
00144 
00145                                                 // Writes Category Description
00146                                                 if ( $params->get( 'cat_description' ) && $row->description ) {
00147                                                         ?>
00148                                                         <br />
00149                                                         <?php
00150                                                         echo $row->description;
00151                                                 }
00152                                         } else {
00153                                                 echo $row->name;
00154                                                 ?>
00155                                                 <a href="<?php echo sefRelToAbs( 'index.php?option=com_registration&amp;task=register' ); ?>">
00156                                                         ( <?php echo _E_REGISTERED; ?> )</a>
00157                                                 <?php
00158                                         }
00159                                         ?>
00160                                 </li>
00161                                 <?php
00162                         }
00163                 }
00164                 ?>
00165                 </ul>
00166                 <?php
00167         }
00168 
00169 
00173         function showTable( &$params, &$items, &$gid, $catid, $id, &$pageNav, &$access, &$sectionid, &$lists, $order ) {
00174                 global $mosConfig_live_site, $Itemid;
00175                 $link = 'index.php?option=com_content&amp;task=category&amp;sectionid='. $sectionid .'&amp;id='. $catid .'&amp;Itemid='. $Itemid;
00176                 ?>
00177                 <form action="<?php echo sefRelToAbs($link); ?>" method="post" name="adminForm">
00178                 <table width="100%" border="0" cellspacing="0" cellpadding="0">
00179                 <?php
00180                 if ( $params->get( 'filter' ) || $params->get( 'order_select' ) || $params->get( 'display' ) ) {
00181                         ?>
00182                         <tr>
00183                                 <td colspan="4">
00184                                         <table>
00185                                         <tr>
00186                                                 <?php
00187                                                 if ( $params->get( 'filter' ) ) {
00188                                                         ?>
00189                                                         <td align="right" width="100%" nowrap="nowrap">
00190                                                                 <?php
00191                                                                 echo _FILTER .'&nbsp;';
00192                                                                 ?>
00193                                                                 <input type="text" name="filter" value="<?php echo $lists['filter'];?>" class="inputbox" onchange="document.adminForm.submit();" />
00194                                                         </td>
00195                                                         <?php
00196                                                 }
00197 
00198                                                 if ( $params->get( 'order_select' ) ) {
00199                                                         ?>
00200                                                         <td align="right" width="100%" nowrap="nowrap">
00201                                                                 <?php
00202                                                                 echo '&nbsp;&nbsp;&nbsp;'. _ORDER_DROPDOWN .'&nbsp;';
00203                                                                 echo $lists['order'];
00204                                                                 ?>
00205                                                         </td>
00206                                                         <?php
00207                                                 }
00208 
00209                                                 if ( $params->get( 'display' ) ) {
00210                                                         ?>
00211                                                         <td align="right" width="100%" nowrap="nowrap">
00212                                                                 <?php
00213                                                                 $order = '';
00214                                                                 if ( $lists['order_value'] ) {
00215                                                                         $order = '&amp;order='. $lists['order_value'];
00216                                                                 }
00217                                                                 $filter = '';
00218                                                                 if ( $lists['filter'] ) {
00219                                                                         $filter = '&amp;filter='. $lists['filter'];
00220                                                                 }
00221 
00222                                                                 $link = 'index.php?option=com_content&amp;task=category&amp;sectionid='. $sectionid .'&amp;id='. $catid .'&amp;Itemid='. $Itemid . $order . $filter;
00223 
00224                                                                 echo '&nbsp;&nbsp;&nbsp;'. _PN_DISPLAY_NR .'&nbsp;';
00225                                                                 echo $pageNav->getLimitBox( $link );
00226                                                                 ?>
00227                                                         </td>
00228                                                         <?php
00229                                                 }
00230                                                 ?>
00231                                         </tr>
00232                                         </table>
00233                                 </td>
00234                         </tr>
00235                         <?php
00236                 }
00237 
00238                 if ( $params->get( 'headings' ) ) {
00239                         ?>
00240                         <tr>
00241                                 <?php
00242                                 if ( $params->get( 'date' ) ) {
00243                                         ?>
00244                                         <td class="sectiontableheader<?php echo $params->get( 'pageclass_sfx' ); ?>" width="35%">
00245                                                 <?php echo _DATE; ?>
00246                                         </td>
00247                                         <?php
00248                                 }
00249                                 if ( $params->get( 'title' ) ) {
00250                                         ?>
00251                                         <td class="sectiontableheader<?php echo $params->get( 'pageclass_sfx' ); ?>">
00252                                                 <?php echo _HEADER_TITLE; ?>
00253                                         </td>
00254                                         <?php
00255                                 }
00256                                 if ( $params->get( 'author' ) ) {
00257                                         ?>
00258                                         <td class="sectiontableheader<?php echo $params->get( 'pageclass_sfx' ); ?>" align="left" width="25%">
00259                                                 <?php echo _HEADER_AUTHOR; ?>
00260                                         </td>
00261                                         <?php
00262                                 }
00263                                 if ( $params->get( 'hits' ) ) {
00264                                         ?>
00265                                         <td align="center" class="sectiontableheader<?php echo $params->get( 'pageclass_sfx' ); ?>" width="5%">
00266                                                 <?php echo _HEADER_HITS; ?>
00267                                         </td>
00268                                         <?php
00269                                 }
00270                                 ?>
00271                         </tr>
00272                         <?php
00273                 }
00274 
00275                 $k = 0;
00276                 foreach ( $items as $row ) {
00277                         $row->created = mosFormatDate ($row->created, $params->get( 'date_format' ));
00278 
00279                         // calculate Itemid
00280                         HTML_content::_Itemid( $row );
00281                         ?>
00282                         <tr class="sectiontableentry<?php echo ($k+1) . $params->get( 'pageclass_sfx' ); ?>" >
00283                                 <?php
00284                                 if ( $params->get( 'date' ) ) {
00285                                         ?>
00286                                         <td>
00287                                         <?php echo $row->created; ?>
00288                                         </td>
00289                                         <?php
00290                                 }
00291                                 if ( $params->get( 'title' ) ) {
00292                                         if( $row->access <= $gid ){
00293                                                 $link = sefRelToAbs( 'index.php?option=com_content&amp;task=view&amp;id='. $row->id .'&amp;Itemid='. $Itemid );
00294                                                 ?>
00295                                                 <td>
00296                                                 <a href="<?php echo $link; ?>">
00297                                                 <?php echo $row->title; ?>
00298                                                 </a>
00299                                                 <?php
00300                                                 HTML_content::EditIcon( $row, $params, $access );
00301                                                 ?>
00302                                                 </td>
00303                                                 <?php
00304                                         } else {
00305                                                 ?>
00306                                                 <td>
00307                                                 <?php
00308                                                 echo $row->title .' : ';
00309                                                 $link = sefRelToAbs( 'index.php?option=com_registration&amp;task=register' );
00310                                                 ?>
00311                                                 <a href="<?php echo $link; ?>">
00312                                                 <?php echo _READ_MORE_REGISTER; ?>
00313                                                 </a>
00314                                                 </td>
00315                                                 <?php
00316                                         }
00317                                 }
00318                                 if ( $params->get( 'author' ) ) {
00319                                         ?>
00320                                         <td align="left">
00321                                         <?php echo $row->created_by_alias ? $row->created_by_alias : $row->author; ?>
00322                                         </td>
00323                                         <?php
00324                                 }
00325                                 if ( $params->get( 'hits' ) ) {
00326                                 ?>
00327                                         <td align="center">
00328                                         <?php echo $row->hits ? $row->hits : '-'; ?>
00329                                         </td>
00330                                 <?php
00331                         } ?>
00332                 </tr>
00333                 <?php
00334                         $k = 1 - $k;
00335                 }
00336                 if ( $params->get( 'navigation' ) ) {
00337                         ?>
00338                         <tr>
00339                                 <td colspan="4">&nbsp;</td>
00340                         </tr>
00341                         <tr>
00342                                 <td align="center" colspan="4" class="sectiontablefooter<?php echo $params->get( 'pageclass_sfx' ); ?>">
00343                                 <?php
00344                                 $order = '';
00345                                 if ( $lists['order_value'] ) {
00346                                         $order = '&amp;order='. $lists['order_value'];
00347                                 }
00348                                 $filter = '';
00349                                 if ( $lists['filter'] ) {
00350                                         $filter = '&amp;filter='. $lists['filter'];
00351                                 }
00352 
00353                                 $link = 'index.php?option=com_content&amp;task=category&amp;sectionid='. $sectionid .'&amp;id='. $catid .'&amp;Itemid='. $Itemid . $order . $filter;
00354                                 echo $pageNav->writePagesLinks( $link );
00355                                 ?>
00356                                 </td>
00357                         </tr>
00358                         <tr>
00359                                 <td colspan="4" align="right">
00360                                 <?php echo $pageNav->writePagesCounter(); ?>
00361                                 </td>
00362                         </tr>
00363                         <?php
00364                 }
00365                 ?>
00366                 </table>
00367                 <input type="hidden" name="id" value="<?php echo $catid; ?>" />
00368                 <input type="hidden" name="sectionid" value="<?php echo $sectionid; ?>" />
00369                 <input type="hidden" name="task" value="<?php echo $lists['task']; ?>" />
00370                 <input type="hidden" name="option" value="com_content" />
00371                 </form>
00372                 <?php
00373         }
00374 
00375 
00379         function showLinks( &$rows, $links, $total, $i=0, $show=1, $ItemidCount=NULL ) {
00380                 global $mainframe, $Itemid;
00381 
00382                 // getItemid compatibility mode, holds maintenance version number
00383                 $compat = (int) $mainframe->getCfg('itemid_compat');
00384 
00385                 if ( $show ) {
00386                         ?>
00387                         <div>
00388                                 <strong>
00389                                 <?php echo _MORE; ?>
00390                                 </strong>
00391                         </div>
00392                         <?php
00393                 }
00394                 ?>
00395                 <ul>
00396                 <?php
00397                 for ( $z = 0; $z < $links; $z++ ) {
00398                         if (!isset( $rows[$i] )) {
00399                                 // stops loop if total number of items is less than the number set to display as intro + leading
00400                                 break;
00401                         }
00402 
00403                         if ($compat > 0 && $compat <= 11) {
00404                                 $_Itemid = $mainframe->getItemid( $rows[$i]->id, 0, 0  );
00405                         } else {
00406                                 $_Itemid = $Itemid;
00407                         }
00408 
00409                         if ( $_Itemid && $_Itemid != 99999999 ) {
00410                         // where Itemid value is returned, do not add Itemid to url
00411                                 $Itemid_link = '&amp;Itemid='. $_Itemid;
00412                         } else {
00413                         // where Itemid value is NOT returned, do not add Itemid to url
00414                                 $Itemid_link = '';
00415                         }
00416 
00417                         $link = sefRelToAbs( 'index.php?option=com_content&amp;task=view&amp;id='. $rows[$i]->id . $Itemid_link )
00418                         ?>
00419                         <li>
00420                                 <a class="blogsection" href="<?php echo $link; ?>">
00421                                         <?php echo $rows[$i]->title; ?></a>
00422                         </li>
00423                         <?php
00424                         $i++;
00425                 }
00426                 ?>
00427                 </ul>
00428                 <?php
00429         }
00430 
00431 
00437         function show( &$row, &$params, &$access, $page=0 ) {
00438                 global $mainframe, $hide_js;
00439                 global $mosConfig_live_site;
00440                 global $_MAMBOTS;
00441 
00442                 $mainframe->appendMetaTag( 'description',       $row->metadesc );
00443                 $mainframe->appendMetaTag( 'keywords',          $row->metakey );
00444 
00445                 // adds mospagebreak heading or title to <site> Title
00446                 if ( isset($row->page_title) && $row->page_title ) {
00447                         $mainframe->setPageTitle( $row->title .' '. $row->page_title );
00448                 }
00449 
00450                 // calculate Itemid
00451                 HTML_content::_Itemid( $row );
00452 
00453                 // determines the link and `link text` of the readmore button & linked title
00454                 HTML_content::_linkInfo( $row, $params );
00455 
00456                 // link used by print button
00457                 $print_link = $mosConfig_live_site. '/index2.php?option=com_content&amp;task=view&amp;id=' . $row->id .'&amp;pop=1&amp;page='. $page . $row->Itemid_link;
00458 
00459                 // process the new bots
00460                 $_MAMBOTS->loadBotGroup( 'content' );
00461                 $results = $_MAMBOTS->trigger( 'onPrepareContent', array( &$row, &$params, $page ), true );
00462 
00463                 if ( $params->get( 'item_title' ) || $params->get( 'pdf' )  || $params->get( 'print' ) || $params->get( 'email' ) ) {
00464                         ?>
00465                         <table class="contentpaneopen<?php echo $params->get( 'pageclass_sfx' ); ?>">
00466                         <tr>
00467                                 <?php
00468                                 // displays Item Title
00469                                 HTML_content::Title( $row, $params, $access );
00470 
00471                                 // displays PDF Icon
00472                                 HTML_content::PdfIcon( $row, $params, $hide_js );
00473 
00474                                 // displays Print Icon
00475                                 mosHTML::PrintIcon( $row, $params, $hide_js, $print_link );
00476 
00477                                 // displays Email Icon
00478                                 HTML_content::EmailIcon( $row, $params, $hide_js );
00479                                 ?>
00480                         </tr>
00481                         </table>
00482                         <?php
00483                 } else if ( $access->canEdit ) {
00484                         // edit icon when item title set to hide
00485                         ?>
00486                         <table class="contentpaneopen<?php echo $params->get( 'pageclass_sfx' ); ?>">
00487                         <tr>
00488                                 <td>
00489                                         <?php
00490                                         HTML_content::EditIcon( $row, $params, $access );
00491                                         ?>
00492                                 </td>
00493                         </tr>
00494                         </table>
00495                         <?php
00496                 }
00497 
00498                 if ( !$params->get( 'intro_only' ) ) {
00499                         $results = $_MAMBOTS->trigger( 'onAfterDisplayTitle', array( &$row, &$params, $page ) );
00500                         echo trim( implode( "\n", $results ) );
00501                 }
00502 
00503                 $results = $_MAMBOTS->trigger( 'onBeforeDisplayContent', array( &$row, &$params, $page ) );
00504                 echo trim( implode( "\n", $results ) );
00505                 ?>
00506 
00507                 <table class="contentpaneopen<?php echo $params->get( 'pageclass_sfx' ); ?>">
00508                 <?php
00509                 // displays Section & Category
00510                 HTML_content::Section_Category( $row, $params );
00511 
00512                 // displays Author Name
00513                 HTML_content::Author( $row, $params );
00514 
00515                 // displays Created Date
00516                 HTML_content::CreateDate( $row, $params );
00517 
00518                 // displays Urls
00519                 HTML_content::URL( $row, $params );
00520                 ?>
00521                 <tr>
00522                         <td valign="top" colspan="2">
00523                                 <?php
00524                                 // displays Table of Contents
00525                                 HTML_content::TOC( $row );
00526 
00527                                 // displays Item Text
00528                                 echo ampReplace( $row->text );
00529                                 ?>
00530                         </td>
00531                 </tr>
00532                 <?php
00533 
00534                 // displays Modified Date
00535                 HTML_content::ModifiedDate( $row, $params );
00536 
00537                 // displays Readmore button
00538                 HTML_content::ReadMore( $row, $params );
00539                 ?>
00540                 </table>
00541 
00542                 <span class="article_seperator">&nbsp;</span>
00543 
00544                 <?php
00545                 $results = $_MAMBOTS->trigger( 'onAfterDisplayContent', array( &$row, &$params, $page ) );
00546                 echo trim( implode( "\n", $results ) );
00547 
00548                 // displays the next & previous buttons
00549                 HTML_content::Navigation ( $row, $params );
00550 
00551                 // displays close button in pop-up window
00552                 mosHTML::CloseButton ( $params, $hide_js );
00553 
00554                 // displays back button in pop-up window
00555                 mosHTML::BackButton ( $params, $hide_js );
00556         }
00557 
00561         function _Itemid( &$row ) {
00562                 global $task, $Itemid, $mainframe;
00563 
00564                 // getItemid compatibility mode, holds maintenance version number
00565                 $compat = (int) $mainframe->getCfg('itemid_compat');
00566 
00567                 if ( ($compat > 0 && $compat <= 11) && $task != 'view' && $task != 'category' ) {
00568                         $row->_Itemid = $mainframe->getItemid( $row->id, 0, 0 );
00569                 } else {
00570                         // when viewing a content item, it is not necessary to calculate the Itemid
00571                         $row->_Itemid = $Itemid;
00572                 }
00573 
00574                 if ( $row->_Itemid && $row->_Itemid != 99999999 ) {
00575                         // where Itemid value is returned, do not add Itemid to url
00576                         $row->Itemid_link = '&amp;Itemid='. $row->_Itemid;
00577                 } else {
00578                         // where Itemid value is NOT returned, do not add Itemid to url
00579                         $row->Itemid_link = '';
00580                 }
00581         }
00582 
00586         function _linkInfo( &$row, &$params ) {
00587                 global $my;
00588 
00589                 $row->link_on   = '';
00590                 $row->link_text = '';
00591 
00592                 if ($params->get( 'readmore' ) || $params->get( 'link_titles' )) {
00593                         if ( $params->get( 'intro_only' ) ) {
00594                                 // checks if the item is a public or registered/special item
00595                                 if ( $row->access <= $my->gid ) {
00596                                         $row->link_on = sefRelToAbs( 'index.php?option=com_content&amp;task=view&amp;id=' . $row->id . $row->Itemid_link );
00597 
00598                                         if ( isset($row->readmore) && @$row->readmore) {
00599                                                 // text for the readmore link
00600                                                 $row->link_text = _READ_MORE;
00601                                         }
00602                                 } else {
00603                                         $row->link_on = sefRelToAbs( 'index.php?option=com_registration&amp;task=register' );
00604 
00605                                         if ( isset($row->readmore) && @$row->readmore ) {
00606                                                 // text for the readmore link if accessible only if registered
00607                                                 $row->link_text = _READ_MORE_REGISTER;
00608                                         }
00609                                 }
00610                         }
00611                 }
00612         }
00613 
00617         function Title( &$row, &$params, &$access ) {
00618                 if ( $params->get( 'item_title' ) ) {
00619                         if ( $params->get( 'link_titles' ) && $row->link_on != '' ) {
00620                                 ?>
00621                                 <td class="contentheading<?php echo $params->get( 'pageclass_sfx' ); ?>" width="100%">
00622                                         <a href="<?php echo $row->link_on;?>" class="contentpagetitle<?php echo $params->get( 'pageclass_sfx' ); ?>">
00623                                                 <?php echo $row->title;?></a>
00624                                         <?php HTML_content::EditIcon( $row, $params, $access ); ?>
00625                                 </td>
00626                                 <?php
00627                         } else {
00628                                 ?>
00629                                 <td class="contentheading<?php echo $params->get( 'pageclass_sfx' ); ?>" width="100%">
00630                                         <?php echo $row->title;?>
00631                                         <?php HTML_content::EditIcon( $row, $params, $access ); ?>
00632                                 </td>
00633                                 <?php
00634                         }
00635                 } else {
00636                         ?>
00637                         <td class="contentheading<?php echo $params->get( 'pageclass_sfx' ); ?>" width="100%">
00638                                 <?php HTML_content::EditIcon( $row, $params, $access ); ?>
00639                         </td>
00640                         <?php
00641                 }
00642         }
00643 
00647         function EditIcon( &$row, &$params, &$access ) {
00648                 global $my;
00649 
00650                 if ( $params->get( 'popup' ) ) {
00651                         return;
00652                 }
00653                 if ( $row->state < 0 ) {
00654                         return;
00655                 }
00656                 if ( !$access->canEdit && !( $access->canEditOwn && $row->created_by == $my->id ) ) {
00657                         return;
00658                 }
00659 
00660                 mosCommonHTML::loadOverlib();
00661 
00662                 $link   = 'index.php?option=com_content&amp;task=edit&amp;id='. $row->id . $row->Itemid_link .'&amp;Returnid='. $row->_Itemid;
00663                 $image  = mosAdminMenus::ImageCheck( 'edit.png', '/images/M_images/', NULL, NULL, _E_EDIT, _E_EDIT );
00664 
00665                 if ( $row->state == 0 ) {
00666                         $overlib = _CMN_UNPUBLISHED;
00667                 } else {
00668                         $overlib = _CMN_PUBLISHED;
00669                 }
00670                 $date           = mosFormatDate( $row->created );
00671                 $author         = $row->created_by_alias ? $row->created_by_alias : $row->author;
00672 
00673                 $overlib        .= '<br />';
00674                 $overlib        .= $row->groups;
00675                 $overlib        .= '<br />';
00676                 $overlib        .= $date;
00677                 $overlib        .= '<br />';
00678                 $overlib        .= $author;
00679                 ?>
00680                 <a href="<?php echo sefRelToAbs( $link ); ?>" onmouseover="return overlib('<?php echo $overlib; ?>', CAPTION, '<?php echo _E_EDIT; ?>', BELOW, RIGHT);" onmouseout="return nd();">
00681                         <?php echo $image; ?></a>
00682                 <?php
00683         }
00684 
00685 
00689         function PdfIcon( &$row, &$params, $hide_js ) {
00690                 global $mosConfig_live_site;
00691 
00692                 if ( $params->get( 'pdf' ) && !$params->get( 'popup' ) && !$hide_js ) {
00693                         $status = 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no';
00694                         $link   = $mosConfig_live_site. '/index2.php?option=com_content&amp;do_pdf=1&amp;id='. $row->id;
00695 
00696                         if ( $params->get( 'icons' ) ) {
00697                                 $image = mosAdminMenus::ImageCheck( 'pdf_button.png', '/images/M_images/', NULL, NULL, _CMN_PDF, _CMN_PDF );
00698                         } else {
00699                                 $image = _CMN_PDF .'&nbsp;';
00700                         }
00701                         ?>
00702                         <td align="right" width="100%" class="buttonheading">
00703                                 <a href="<?php echo $link; ?>" target="_blank" onclick="window.open('<?php echo $link; ?>','win2','<?php echo $status; ?>'); return false;" title="<?php echo _CMN_PDF;?>">
00704                                         <?php echo $image; ?></a>
00705                         </td>
00706                         <?php
00707                 }
00708         }
00709 
00710 
00714         function EmailIcon( &$row, &$params, $hide_js ) {
00715                 global $mosConfig_live_site, $Itemid, $task;
00716 
00717                 if ( $params->get( 'email' ) && !$params->get( 'popup' ) && !$hide_js ) {
00718                         $status = 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=400,height=250,directories=no,location=no';
00719 
00720                         if ($task == 'view') {
00721                                 $_Itemid = '&amp;itemid='. $Itemid;
00722                         } else {
00723                                 $_Itemid = '';
00724                         }
00725 
00726                         $link   = $mosConfig_live_site .'/index2.php?option=com_content&amp;task=emailform&amp;id='. $row->id . $_Itemid;
00727 
00728                         if ( $params->get( 'icons' ) ) {
00729                                 $image = mosAdminMenus::ImageCheck( 'emailButton.png', '/images/M_images/', NULL, NULL, _CMN_EMAIL, _CMN_EMAIL );
00730                         } else {
00731                                 $image = '&nbsp;'. _CMN_EMAIL;
00732                         }
00733                         ?>
00734                         <td align="right" width="100%" class="buttonheading">
00735                                 <a href="<?php echo $link; ?>" target="_blank" onclick="window.open('<?php echo $link; ?>','win2','<?php echo $status; ?>'); return false;" title="<?php echo _CMN_EMAIL;?>">
00736                                         <?php echo $image; ?></a>
00737                         </td>
00738                         <?php
00739                 }
00740         }
00741 
00745         function Section_Category( &$row, &$params ) {
00746                 if ( $params->get( 'section' ) || $params->get( 'category' ) ) {
00747                         ?>
00748                         <tr>
00749                                 <td>
00750                         <?php
00751                 }
00752 
00753                 // displays Section Name
00754                 HTML_content::Section( $row, $params );
00755 
00756                 // displays Section Name
00757                 HTML_content::Category( $row, $params );
00758 
00759                 if ( $params->get( 'section' ) || $params->get( 'category' ) ) {
00760                         ?>
00761                                 </td>
00762                         </tr>
00763                 <?php
00764                 }
00765         }
00766 
00770         function Section( &$row, &$params ) {
00771                 if ( $params->get( 'section' ) ) {
00772                                 ?>
00773                                 <span>
00774                                         <?php
00775                                         echo $row->section;
00776                                         // writes dash between section & Category Name when both are active
00777                                         if ( $params->get( 'category' ) ) {
00778                                                 echo ' - ';
00779                                         }
00780                                         ?>
00781                                 </span>
00782                         <?php
00783                 }
00784         }
00785 
00789         function Category( &$row, &$params ) {
00790                 if ( $params->get( 'category' ) ) {
00791                         ?>
00792                         <span>
00793                                 <?php
00794                                 echo $row->category;
00795                                 ?>
00796                         </span>
00797                         <?php
00798                 }
00799         }
00800 
00804         function Author( &$row, &$params ) {
00805                 if ( ( $params->get( 'author' ) ) && ( $row->author != '' ) ) {
00806                         ?>
00807                         <tr>
00808                                 <td width="70%" align="left" valign="top" colspan="2">
00809                                         <span class="small">
00810                                                 <?php echo _WRITTEN_BY . ' '.( $row->created_by_alias ? $row->created_by_alias : $row->author ); ?>
00811                                         </span>
00812                                         &nbsp;&nbsp;
00813                                 </td>
00814                         </tr>
00815                         <?php
00816                 }
00817         }
00818 
00819 
00823         function CreateDate( &$row, &$params ) {
00824                 $create_date = null;
00825 
00826                 if ( intval( $row->created ) != 0 ) {
00827                         $create_date = mosFormatDate( $row->created );
00828                 }
00829 
00830                 if ( $params->get( 'createdate' ) ) {
00831                         ?>
00832                         <tr>
00833                                 <td valign="top" colspan="2" class="createdate">
00834                                         <?php echo $create_date; ?>
00835                                 </td>
00836                         </tr>
00837                         <?php
00838                 }
00839         }
00840 
00844         function URL( &$row, &$params ) {
00845                 if ( $params->get( 'url' ) && $row->urls ) {
00846                         ?>
00847                         <tr>
00848                                 <td valign="top" colspan="2">
00849                                         <a href="http://<?php echo $row->urls ; ?>" target="_blank">
00850                                                 <?php echo $row->urls; ?></a>
00851                                 </td>
00852                         </tr>
00853                         <?php
00854                 }
00855         }
00856 
00860         function TOC( &$row ) {
00861                 if ( isset($row->toc) ) {
00862                         echo $row->toc;
00863                 }
00864         }
00865 
00869         function ModifiedDate( &$row, &$params ) {
00870                 $mod_date = null;
00871 
00872                 if ( intval( $row->modified ) != 0) {
00873                         $mod_date = mosFormatDate( $row->modified );
00874                 }
00875 
00876                 if ( ( $mod_date != '' ) && $params->get( 'modifydate' ) ) {
00877                         ?>
00878                         <tr>
00879                                 <td colspan="2" align="left" class="modifydate">
00880                                         <?php echo _LAST_UPDATED; ?> ( <?php echo $mod_date; ?> )
00881                                 </td>
00882                         </tr>
00883                         <?php
00884                 }
00885         }
00886 
00890         function ReadMore ( &$row, &$params ) {
00891                 if ( $params->get( 'readmore' ) ) {
00892                         if ( $params->get( 'intro_only' ) && $row->link_text ) {
00893                                 ?>
00894                                 <tr>
00895                                         <td align="left" colspan="2">
00896                                                 <a href="<?php echo $row->link_on;?>" class="readon<?php echo $params->get( 'pageclass_sfx' ); ?>">
00897                                                         <?php echo $row->link_text;?></a>
00898                                         </td>
00899                                 </tr>
00900                                 <?php
00901                         }
00902                 }
00903         }
00904 
00908         function Navigation( &$row, &$params ) {
00909                 global $task;
00910 
00911                 $link_part      = 'index.php?option=com_content&amp;task=view&amp;id=';
00912 
00913                 // determines links to next and prev content items within category
00914                 if ( $params->get( 'item_navigation' ) ) {
00915                         if ( $row->prev ) {
00916                                 $row->prev = sefRelToAbs( $link_part . $row->prev . $row->Itemid_link );
00917                         } else {
00918                                 $row->prev = 0;
00919                         }
00920 
00921                         if ( $row->next ) {
00922                                 $row->next = sefRelToAbs( $link_part . $row->next . $row->Itemid_link );
00923                         } else {
00924                                 $row->next = 0;
00925                         }
00926                 }
00927 
00928                 if ( $params->get( 'item_navigation' ) && ( $task == 'view' ) && !$params->get( 'popup' ) && ( $row->prev || $row->next ) ) {
00929                         ?>
00930                         <table align="center" style="margin-top: 25px;">
00931                         <tr>
00932                                 <?php
00933                                 if ( $row->prev ) {
00934                                         ?>
00935                                         <th class="pagenav_prev">
00936                                                 <a href="<?php echo $row->prev; ?>">
00937                                                         <?php echo _ITEM_PREVIOUS; ?></a>
00938                                         </th>
00939                                         <?php
00940                                 }
00941 
00942                                 if ( $row->prev && $row->next ) {
00943                                         ?>
00944                                         <td width="50">&nbsp;
00945 
00946                                         </td>
00947                                         <?php
00948                                 }
00949 
00950                                 if ( $row->next ) {
00951                                         ?>
00952                                         <th class="pagenav_next">
00953                                                 <a href="<?php echo $row->next; ?>">
00954                                                         <?php echo _ITEM_NEXT; ?></a>
00955                                         </th>
00956                                         <?php
00957                                 }
00958                                 ?>
00959                         </tr>
00960                         </table>
00961                         <?php
00962                 }
00963         }
00964 
00973         function editContent( &$row, $section, &$lists, &$images, &$access, $myid, $sectionid, $task, $Itemid ) {
00974                 global $mosConfig_live_site, $mainframe;
00975 
00976                 mosMakeHtmlSafe( $row );
00977 
00978                 require_once( $GLOBALS['mosConfig_absolute_path'] . '/includes/HTML_toolbar.php' );
00979 
00980                 // used for spoof hardening
00981                 $validate = josSpoofValue();
00982 
00983                 $Returnid       = intval( mosGetParam( $_REQUEST, 'Returnid', $Itemid ) );
00984                 $tabs           = new mosTabs(0, 1);
00985 
00986                 $mainframe->addCustomHeadTag( '<link rel="stylesheet" type="text/css" media="all" href="includes/js/calendar/calendar-mos.css" title="green" />' );
00987                 ?>
00988                 <div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
00989                 <!-- import the calendar script -->
00990                 <script language="javascript" type="text/javascript" src="<?php echo $mosConfig_live_site;?>/includes/js/calendar/calendar_mini.js"></script>
00991                 <!-- import the language module -->
00992                 <script language="javascript" type="text/javascript" src="<?php echo $mosConfig_live_site;?>/includes/js/calendar/lang/calendar-en.js"></script>
00993                 <script language="javascript" type="text/javascript" src="<?php echo $mosConfig_live_site;?>/includes/js/overlib_mini.js"></script>
00994                 <script language="javascript" type="text/javascript">
00995                 onunload = WarnUser;
00996                 var folderimages = new Array;
00997                 <?php
00998                 $i = 0;
00999                 foreach ($images as $k=>$items) {
01000                         foreach ($items as $v) {
01001                                 echo "\n        folderimages[".$i++."] = new Array( '$k','".addslashes( $v->value )."','".addslashes( $v->text )."' );";
01002                         }
01003                 }
01004                 ?>
01005                 function submitbutton(pressbutton) {
01006                         var form = document.adminForm;
01007                         if (pressbutton == 'cancel') {
01008                                 submitform( pressbutton );
01009                                 return;
01010                         }
01011 
01012                         // var goodexit=false;
01013                         // assemble the images back into one field
01014                         form.goodexit.value=1;
01015                         var temp = new Array;
01016                         for (var i=0, n=form.imagelist.options.length; i < n; i++) {
01017                                 temp[i] = form.imagelist.options[i].value;
01018                         }
01019                         form.images.value = temp.join( '\n' );
01020                         try {
01021                                 form.onsubmit();
01022                         }
01023                         catch(e){}
01024                         // do field validation
01025                         if (form.title.value == "") {
01026                                 alert (