Esempio n. 1
0
    /**
     * Show a content item
     * @param object An object with the record data
     * @param boolean If <code>false</code>, the print button links to a popup window.  If <code>true</code> then the print button invokes the browser print method.
     */
    function show($row, $params, $access, $page = 0, $option, $ItemidCount = NULL)
    {
        global $mainframe, $my, $hide_js, $database, $acl;
        global $mosConfig_absolute_path, $mosConfig_sitename, $Itemid, $mosConfig_live_site, $task;
        global $_MAMBOTS;
        //print_r( $params );
        $mainframe->appendMetaTag('description', $row->metadesc);
        $mainframe->appendMetaTag('keywords', $row->metakey);
        $gid = $my->gid;
        $template = $mainframe->getTemplate();
        $_Itemid = $Itemid;
        $link_on = '';
        $link_text = '';
        // process the new bots
        $_MAMBOTS->loadBotGroup('content');
        $results = $_MAMBOTS->trigger('onPrepareContent', array(&$row, &$params, $page), true);
        // determines the link and link text of the readmore button
        if ($params->get('intro_only')) {
            // checks if the item is a public or registered/special item
            if ($row->access <= $gid) {
                if ($task != "view") {
                    $_Itemid = $mainframe->getItemid($row->id, 0, 0, $ItemidCount['bs'], $ItemidCount['bc'], $ItemidCount['gbs']);
                }
                $link_on = sefRelToAbs("index.php?option=com_content&amp;task=view&amp;id=" . $row->id . "&amp;Itemid=" . $_Itemid);
                if (strlen(trim($row->fulltext))) {
                    $link_text = _READ_MORE;
                }
            } else {
                $link_on = sefRelToAbs("index.php?option=com_registration&amp;task=register");
                if (strlen(trim($row->fulltext))) {
                    $link_text = _READ_MORE_REGISTER;
                }
            }
        }
        $no_html = mosGetParam($_REQUEST, 'no_html', null);
        if ($params->get('popup') && $no_html == 0) {
            ?>
			<title><?php 
            echo $mosConfig_sitename . ' :: ' . $row->title;
            ?>
</title>
			<?php 
        }
        if ($params->get('item_navigation')) {
            if ($row->prev) {
                $row->prev = sefRelToAbs('index.php?option=com_content&amp;task=view&amp;id=' . $row->prev . '&amp;Itemid=' . $_Itemid);
            } else {
                $row->prev = 0;
            }
            if ($row->next) {
                $row->next = sefRelToAbs('index.php?option=com_content&amp;task=view&amp;id=' . $row->next . '&amp;Itemid=' . $_Itemid);
            } else {
                $row->next = 0;
            }
        }
        if ($params->get('item_title') || $params->get('pdf') || $params->get('print') || $params->get('email')) {
            $print_link = $mosConfig_live_site . '/index2.php?option=com_content&amp;task=view&amp;id=' . $row->id . '&amp;Itemid=' . $Itemid . '&amp;pop=1&amp;page=' . @$page;
            ?>
			<table class="contentpaneopen<?php 
            echo $params->get('pageclass_sfx');
            ?>
">
			<tr>
				<?php 
            // displays Item Title
            HTML_content::Title($row, $params, $link_on, $access);
            // displays PDF Icon
            HTML_content::PdfIcon($row, $params, $link_on, $hide_js);
            // displays Print Icon
            mosHTML::PrintIcon($row, $params, $hide_js, $print_link);
            // displays Email Icon
            HTML_content::EmailIcon($row, $params, $hide_js);
            ?>
			</tr>
			</table>
			<?php 
        }
        if (!$params->get('intro_only')) {
            $results = $_MAMBOTS->trigger('onAfterDisplayTitle', array(&$row, &$params, $page));
            echo trim(implode("\n", $results));
        }
        $results = $_MAMBOTS->trigger('onBeforeDisplayContent', array(&$row, &$params, $page));
        echo trim(implode("\n", $results));
        ?>

		<table class="contentpaneopen<?php 
        echo $params->get('pageclass_sfx');
        ?>
">
		<?php 
        // displays Section & Category
        HTML_content::Section_Category($row, $params);
        // displays Author Name
        HTML_content::Author($row, $params);
        // displays Created Date
        HTML_content::CreateDate($row, $params);
        // displays Urls
        HTML_content::URL($row, $params);
        ?>
		<tr>
			<td valign="top" colspan="2">
			<?php 
        // displays Table of Contents
        HTML_content::TOC($row, $params);
        // displays Item Text
        echo $row->text;
        ?>
			</td>
		</tr>
		<?php 
        // displays Modified Date
        HTML_content::ModifiedDate($row, $params);
        // displays Readmore button
        HTML_content::ReadMore($params, $link_on, $link_text);
        ?>
		</table>
		<?php 
        $results = $_MAMBOTS->trigger('onAfterDisplayContent', array(&$row, &$params, $page));
        echo trim(implode("\n", $results));
        // displays the next & previous buttons
        HTML_content::Navigation($row, $params);
        // displays close button in pop-up window
        mosHTML::CloseButton($params, $hide_js);
        // displays back button in pop-up window
        mosHTML::BackButton($params, $hide_js);
    }
Esempio n. 2
0
    /**
     * Show a content item
     * @param object An object with the record data
     * @param boolean If <code>false</code>, the print button links to a popup window.  If <code>true</code> then the print button invokes the browser print method.
     */
    function show(&$row, &$params, &$access, $page = 0)
    {
        global $mainframe, $hide_js;
        global $mosConfig_live_site;
        global $_MAMBOTS;
        $mainframe->appendMetaTag('description', $row->metadesc);
        $mainframe->appendMetaTag('keywords', $row->metakey);
        // adds mospagebreak heading or title to <site> Title
        if (isset($row->page_title) && $row->page_title) {
            $mainframe->setPageTitle($row->title . ' ' . $row->page_title);
        }
        // calculate Itemid
        HTML_content::_Itemid($row);
        // determines the link and `link text` of the readmore button & linked title
        HTML_content::_linkInfo($row, $params);
        // link used by print button
        $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;
        // process the new bots
        $_MAMBOTS->loadBotGroup('content');
        $results = $_MAMBOTS->trigger('onPrepareContent', array(&$row, &$params, $page), true);
        if ($params->get('item_title') || $params->get('pdf') || $params->get('print') || $params->get('email')) {
            ?>
			<table class="contentpaneopen<?php 
            echo $params->get('pageclass_sfx');
            ?>
">
			<tr>
				<?php 
            // displays Item Title
            HTML_content::Title($row, $params, $access);
            // displays PDF Icon
            HTML_content::PdfIcon($row, $params, $hide_js);
            // displays Print Icon
            mosHTML::PrintIcon($row, $params, $hide_js, $print_link);
            // displays Email Icon
            HTML_content::EmailIcon($row, $params, $hide_js);
            ?>
			</tr>
			</table>
			<?php 
        } else {
            if ($access->canEdit) {
                // edit icon when item title set to hide
                ?>
			<table class="contentpaneopen<?php 
                echo $params->get('pageclass_sfx');
                ?>
">
 			<tr>
 				<td>
	 				<?php 
                HTML_content::EditIcon($row, $params, $access);
                ?>
 				</td>
 			</tr>
 			</table>
 			<?php 
            }
        }
        if (!$params->get('intro_only')) {
            $results = $_MAMBOTS->trigger('onAfterDisplayTitle', array(&$row, &$params, $page));
            echo trim(implode("\n", $results));
        }
        $results = $_MAMBOTS->trigger('onBeforeDisplayContent', array(&$row, &$params, $page));
        echo trim(implode("\n", $results));
        ?>

		<table class="contentpaneopen<?php 
        echo $params->get('pageclass_sfx');
        ?>
">
		<?php 
        // displays Section & Category
        HTML_content::Section_Category($row, $params);
        // displays Author Name
        HTML_content::Author($row, $params);
        // displays Created Date
        HTML_content::CreateDate($row, $params);
        // displays Urls
        HTML_content::URL($row, $params);
        ?>
		<tr>
			<td valign="top" colspan="2">
				<?php 
        // displays Table of Contents
        HTML_content::TOC($row);
        // displays Item Text
        echo ampReplace($row->text);
        ?>
			</td>
		</tr>
		<?php 
        // displays Modified Date
        HTML_content::ModifiedDate($row, $params);
        // displays Readmore button
        HTML_content::ReadMore($row, $params);
        ?>
		</table>

		<span class="article_seperator">&nbsp;</span>

		<?php 
        $results = $_MAMBOTS->trigger('onAfterDisplayContent', array(&$row, &$params, $page));
        echo trim(implode("\n", $results));
        // displays the next & previous buttons
        HTML_content::Navigation($row, $params);
        // displays close button in pop-up window
        mosHTML::CloseButton($params, $hide_js);
        // displays back button in pop-up window
        mosHTML::BackButton($params, $hide_js);
    }
Esempio n. 3
0
 /**
  * Method to replace HTML content
  *
  * @param int   $id
  * @param int   $tpl
  *
  * @return string
  */
 public function replaceContentHtml($id, $tpl)
 {
     $content = '';
     if ($id != 0) {
         // Editor user type check
         $access = new stdClass();
         $access->canEdit = $access->canEditOwn = $access->canPublish = 0;
         $row = $this->retrieveContent($id);
         if ($row) {
             $params = $row->params;
             $model = new BwPostmanModelNewsletter();
             $lang = $model->getArticleLanguage($row->id);
             $_Itemid = ContentHelperRoute::getArticleRoute($row->id, 0, $lang);
             $link = JRoute::_(JURI::base());
             if ($_Itemid) {
                 $link .= $_Itemid;
             }
             //				$app->triggerEvent('onPrepareContent', array(&$row, &$params, 0), true);
             $intro_text = $row->text;
             $html_content = new HTML_content();
             ob_start();
             // Displays Item Title
             $html_content->Title($row, $params, $access);
             $content .= ob_get_contents();
             ob_end_clean();
             // Displays Category
             ob_start();
             // Displays Created Date
             if ($tpl->article['show_createdate'] != 0) {
                 $html_content->CreateDate($row, $params);
             }
             // Displays Author Name
             if ($tpl->article['show_author'] != 0) {
                 $html_content->Author($row, $params);
             }
             // Displays Urls
             $content .= ob_get_contents();
             ob_end_clean();
             $content .= '<div class="intro_text">' . $intro_text . '</div>';
             if ($tpl->article['show_readon'] != 0) {
                 $content .= '<div class="read_on">' . '		<p>' . '		<a href="' . str_replace('administrator/', '', $link) . '" class="readon">' . JText::_('READ_MORE') . '		</a><br/><br/>' . '		</p>' . '	</div>';
             }
             return stripslashes($content);
         }
     }
     return JText::sprintf('COM_BWPOSTMAN_NL_ERROR_RETRIEVING_CONTENT', $id);
 }