Example #1
0
 function __construct($config = array())
 {
     // Include the tables in path
     JTable::addIncludePath(EBLOG_TABLES);
     $doc = JFactory::getDocument();
     $version = str_ireplace('.', '', EasyBlogHelper::getLocalVersion());
     $doc->addStyleSheet(rtrim(JURI::root(), '/') . '/administrator/components/com_easyblog/assets/css/reset.css');
     $doc->addStyleSheet(rtrim(JURI::root(), '/') . '/components/com_easyblog/assets/css/common.css');
     $doc->addStyleSheet(rtrim(JURI::root(), '/') . '/administrator/components/com_easyblog/assets/css/style.css');
     EasyBlogHelper::loadHeaders();
     parent::__construct();
 }
Example #2
0
    function fetchElement($name, $value, &$node, $control_name)
    {
        require_once JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_easyblog' . DIRECTORY_SEPARATOR . 'constants.php';
        require_once EBLOG_HELPERS . DIRECTORY_SEPARATOR . 'helper.php';
        $mainframe = JFactory::getApplication();
        $doc = JFactory::getDocument();
        EasyBlogHelper::loadHeaders();
        JHTML::_('behavior.modal');
        $id = '';
        if ($value == '0') {
            $value = JText::_('Select an entry');
        } else {
            $blog = EasyBlogHelper::getTable('Blog');
            $blog->load($value);
            $value = $blog->title;
            $id = $blog->id;
        }
        ob_start();
        ?>
<script type="text/javascript">
EasyBlog.ready(function($) {

	window.insertBlog = function(id, name) {
		$( '#item_id' ).val( id );
		$( '#item_value' ).val( name );
		$.Joomla("squeezebox").close();
	};

});
</script>
		<div style="float:left;">
			<input type="text" id="item_value" readonly="readonly" value="<?php 
        echo $value;
        ?>
" disabled="disabled" style="background: #ffffff;width: 200px;" />
		</div>
		<div class="button2-left">
			<div class="blank">
				<a rel="{handler: 'iframe', size: {x: 750, y: 475}}" href="<?php 
        echo JRoute::_('index.php?option=com_easyblog&view=blogs&tmpl=component&browse=1&browsefunction=insertBlog');
        ?>
" title="Select an Article" class="modal"><?php 
        echo JText::_('Select');
        ?>
</a>
			</div>
		</div>
		<input type="hidden" id="item_id" name="<?php 
        echo $control_name;
        ?>
[<?php 
        echo $name;
        ?>
]" value="<?php 
        echo $id;
        ?>
" />
		<?php 
        $html = ob_get_contents();
        ob_end_clean();
        return $html;
    }
Example #3
0
 * 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');
jimport('joomla.filesystem.file');
$path = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_easyblog' . DIRECTORY_SEPARATOR . 'constants.php';
if (!JFile::exists($path)) {
    return;
}
// Include constants
require_once $path;
require_once EBLOG_HELPERS . DIRECTORY_SEPARATOR . 'helper.php';
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'helper.php';
EasyBlogHelper::loadHeaders();
JTable::addIncludePath(EBLOG_TABLES);
$document = JFactory::getDocument();
$document->addStyleSheet(rtrim(JURI::root(), '/') . '/components/com_easyblog/assets/css/module.css');
$config = EasyBlogHelper::getConfig();
$posttype = $params->get('showposttype', 'featured');
$model = EasyBlogHelper::getModel('Blog');
if ($posttype == 'latest') {
    if ($params->get('catid')) {
        $categories = explode(',', $params->get('catid'));
        $entries = $model->getBlogsBy('category', $categories, 'latest', $params->get('count'), EBLOG_FILTER_PUBLISHED, null, true, array(), false, false, false);
    } else {
        $entries = $model->getBlogsBy('', '', 'latest', $params->get('count'), EBLOG_FILTER_PUBLISHED, null, true, array(), false, false, false);
    }
} else {
    $category = explode(',', $params->get('catid'));