示例#1
0
 /**
  * Creates a pagination using the passed in values
  *
  * @param array $config Configuration Options 
  * total => list total, limit => list limit, offset => list start offset 
  * 
  * @return string
  */
 public function pagination(array $config)
 {
     $config = new KConfig($config);
     jimport('joomla.html.pagination');
     $pagination = new JPagination($config->total, $config->offset, $config->limit);
     return $pagination->getListFooter();
 }
function DefaultPaginationSearchForm($total, $limitstart, $limit)
{
    jimport('joomla.html.pagination');
    $pageNav = new JPagination($total, $limitstart, $limit);
    ?>
	<div class="jev_pagination">
	<?php 
    echo $pageNav->getListFooter();
    ?>
	</div>
	<?php 
}
function DefaultPaginationForm($total, $limitstart, $limit)
{
    jimport('joomla.html.pagination');
    $pageNav = new JPagination($total, $limitstart, $limit);
    $Itemid = JRequest::getInt("Itemid");
    $task = JRequest::getVar("jevtask");
    $link = JRoute::_("index.php?option=" . JEV_COM_COMPONENT . "&Itemid={$Itemid}&task={$task}");
    ?>
	<div class="jev_pagination">
	<form action="<?php 
    echo $link;
    ?>
" method="post">
	<?php 
    // TODO add in catids so that changing it doesn't look the data
    echo $pageNav->getListFooter();
    ?>
	</form>
	</div>
	<?php 
}
示例#4
0
 public static function display()
 {
     if (JFactory::getApplication()->isSite()) {
         JSession::checkToken('get') or die(JText::_('JINVALID_TOKEN'));
     }
     require_once JPATH_ROOT . '/components/com_content/helpers/route.php';
     $mainframe = JFactory::getApplication();
     JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
     JHtml::_('behavior.tooltip');
     $access = $mainframe->getUserStateFromRequest('com_content.posts.filter.access', 'filter_access', 0, 'int');
     $published = $mainframe->getUserStateFromRequest('com_content.posts.filter.published', 'filter_published', '');
     $category_id = $mainframe->getUserStateFromRequest('com_content.posts.filter.category_id', 'filter_category_id');
     $language = $mainframe->getUserStateFromRequest('com_content.posts.filter.language', 'filter_language', '');
     $search = $mainframe->getUserStateFromRequest('com_content.posts.filter.search', 'filter_search');
     $listOrder = $mainframe->getUserStateFromRequest('com_content.posts.posts.filter_order', 'filter_order', 'a.title', 'cmd');
     $listDirn = $mainframe->getUserStateFromRequest('com_content.posts.posts.filter_order_Dir', 'filter_order_Dir', 'DESC', 'word');
     $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
     $limitstart = $mainframe->getUserStateFromRequest('com_content.posts.limitstart', 'limitstart', 0, 'int');
     $filter_poststatus = $mainframe->getUserStateFromRequest('com_content.posts.filter_poststatus', 'filter_poststatus', 0, 'string');
     $poststatus = array();
     $poststatus[] = JHTML::_('select.option', -1, JText::_('COM_BT_SOCIALCONNECT_ADDING_STATUS'));
     $poststatus[] = JHtml::_('select.option', 'notpost', JText::_('COM_BT_SOCIALCONNECT_NOT_YET'));
     $poststatus[] = JHtml::_('select.option', 'posted', JText::_('COM_BT_SOCIALCONNECT_ADDED'));
     $total = self::getTotal();
     $pageNav = new JPagination($total, $limitstart, $limit);
     $items = self::getItemContent();
     $html = '<div id="admin-loading">' . '	<fieldset class="filter clearfix">' . '	<div class="left">' . '	<label  style="display:inline" for="filter_search">' . JText::_('JSEARCH_FILTER_LABEL') . '</label>' . '	<input type="text" name="filter_search" id="filter_search" value="' . $search . '" size="30" title="' . JText::_('COM_CONTENT_FILTER_SEARCH_DESC') . '" />' . '	<button  class="btn btn-small" type="submit">' . JText::_('JSEARCH_FILTER_SUBMIT') . '</button>' . '	<button  class="btn btn-small" type="button" onclick="document.id(\'filter_search\').value=\'\';this.form.submit();">' . JText::_('JSEARCH_FILTER_CLEAR') . '</button>' . '	</div>' . '	<div class="right">' . '<select name="filter_poststatus" class="inputbox" onchange="this.form.submit()">' . JHtml::_('select.options', $poststatus, 'value', 'text', $filter_poststatus) . '' . '	</select>' . '	<select name="filter_access" class="inputbox" onchange="this.form.submit()">' . '		<option value="">' . JText::_('JOPTION_SELECT_ACCESS') . '</option>' . JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $access) . '' . '	</select>' . '	<select name="filter_published" class="inputbox" onchange="this.form.submit()">' . '		<option value="">' . JText::_('JOPTION_SELECT_PUBLISHED') . '</option>' . JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $published, true) . '' . '	</select>' . '	<select name="filter_category_id" class="inputbox" onchange="this.form.submit()">' . '		<option value="">' . JText::_('JOPTION_SELECT_CATEGORY') . '</option>' . JHtml::_('select.options', JHtml::_('category.options', 'com_content'), 'value', 'text', $category_id) . '' . '	</select>' . '	<select name="filter_language" class="inputbox" onchange="this.form.submit()">' . '		<option value="">' . JText::_('JOPTION_SELECT_LANGUAGE') . '</option>' . JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $language) . '' . '	</select>' . '	</div>' . '	</fieldset>' . '<table class="adminlist table table-striped">' . '<thead>' . '	<tr>' . '		<th width="1%">' . '			<input type="checkbox" name="checkall-toggle" value="" title="' . JText::_('JGLOBAL_CHECK_ALL') . '" onclick="Joomla.checkAll(this)" />' . '		</th>' . '		<th class="title">' . JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder) . '' . '		</th>' . '		<th width="5%">' . JHtml::_('grid.sort', 'JSTATUS', 'a.state', $listDirn, $listOrder) . '' . '		</th>' . '	<th width="5%">' . JHtml::_('grid.sort', 'JFEATURED', 'a.featured', $listDirn, $listOrder, NULL, 'desc') . '' . '	</th>' . '		<th width="15%">' . JHtml::_('grid.sort', 'JGRID_HEADING_ACCESS', 'access_level', $listDirn, $listOrder) . '' . '		</th>' . '		<th width="15%">' . JHtml::_('grid.sort', 'JCATEGORY', 'a.catid', $listDirn, $listOrder) . '' . '		</th>' . '		<th width="5%">' . JHtml::_('grid.sort', 'JGRID_HEADING_LANGUAGE', 'language', $listDirn, $listOrder) . '' . '		</th>' . '		<th width="5%">' . JHtml::_('grid.sort', 'JDATE', 'a.created', $listDirn, $listOrder) . '' . '		</th>' . '		<th width="1%" class="nowrap">' . JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder) . '' . '		</th>' . '	</tr>' . '</thead>' . '<tfoot>' . '	<tr>' . '		<td colspan="15">' . $pageNav->getListFooter() . '' . '		</td>' . '	</tr>' . '</tfoot>';
     $html .= '<tbody>';
     foreach ($items as $i => $item) {
         $html .= '<tr class="row' . $i % 2 . '">' . '<td class="center">' . JHtml::_('grid.id', $i, $item->id) . '' . '</td>' . '<td>' . $item->title . '' . '</td>' . '<td class="center">' . JHtml::_('jgrid.published', $item->state, $i, 'articles.', '', 'cb', $item->publish_up, $item->publish_down) . '' . '</td>' . '<td class="center">' . JHtml::_('contentadministrator.featured', $item->featured, $i, '') . '' . '</td>' . '<td class="center">' . $item->access_level . '' . '</td>' . '<td class="center">' . $item->category_title . '' . '</td>' . '<td class="center">';
         if ($item->language == '*') {
             $html .= JText::alt('JALL', 'language');
         } else {
             $html .= $item->language_title ? $item->language_title : JText::_('JUNDEFINED');
         }
         $html .= '</td>' . '<td class="center nowrap">' . JHtml::_('date', $item->created, JText::_('DATE_FORMAT_LC4')) . '' . '</td>' . '<td class="center">' . $item->id . '' . '</td>' . '</tr>';
     }
     $html .= '</tbody>' . '</table>' . '<div>' . '<input type="hidden" name="task" value="" />' . '<input type="hidden" name="boxchecked" value="0" />' . '<input type="hidden" name="filter_order" value="' . $listOrder . '" />' . '<input type="hidden" name="filter_order_Dir" value="' . $listDirn . '" />' . JHtml::_('form.token') . '' . '</div>' . '	</div>';
     echo $html;
 }
示例#5
0
    echo '<tr>';
    foreach ($this->columns as $column) {
        $columns[] = $column['Field'];
        echo '<th>' . $column['Field'] . '</th>';
    }
    echo '</tr>';
    //radky
    foreach ($this->rows as $row) {
        echo '<tr>';
        foreach ($columns as $col) {
            echo '<td>' . $row[$col] . '</td>';
        }
        echo '</tr>';
    }
    echo '</table>';
} else {
    echo '<div class="error">' . JText::_('NO_ROWS_FOUND') . '</div>';
}
/*--tabulka s radky*/
/*strankovani*/
echo '<p>';
jimport('joomla.html.pagination');
$pageNav = new JPagination($this->total, $this->limitstart, $this->limit);
echo '<form action="' . JRoute::_('') . '" name="adminForm" id="adminForm" method="post">';
echo $pageNav->getListFooter();
echo '</form>';
echo '</p>';
/*--*/
?>

示例#6
0
    public function acymailingtagcontent_show()
    {
        $app = JFactory::getApplication();
        $pageInfo = new stdClass();
        $pageInfo->filter = new stdClass();
        $pageInfo->filter->order = new stdClass();
        $pageInfo->limit = new stdClass();
        $pageInfo->elements = new stdClass();
        $my = JFactory::getUser();
        $lang = JFactory::getLanguage();
        $lang->load('com_content', JPATH_SITE);
        $paramBase = ACYMAILING_COMPONENT . '.tagcontent';
        $pageInfo->filter->order->value = $app->getUserStateFromRequest($paramBase . ".filter_order", 'filter_order', 'a.id', 'cmd');
        $pageInfo->filter->order->dir = $app->getUserStateFromRequest($paramBase . ".filter_order_Dir", 'filter_order_Dir', 'desc', 'word');
        if (strtolower($pageInfo->filter->order->dir) !== 'desc') {
            $pageInfo->filter->order->dir = 'asc';
        }
        $pageInfo->search = $app->getUserStateFromRequest($paramBase . ".search", 'search', '', 'string');
        $pageInfo->search = JString::strtolower(trim($pageInfo->search));
        $pageInfo->filter_cat = $app->getUserStateFromRequest($paramBase . ".filter_cat", 'filter_cat', '', 'int');
        $pageInfo->contenttype = $app->getUserStateFromRequest($paramBase . ".contenttype", 'contenttype', $this->params->get('default_type', 'intro'), 'string');
        $pageInfo->author = $app->getUserStateFromRequest($paramBase . ".author", 'author', $this->params->get('default_author', '0'), 'string');
        $pageInfo->titlelink = $app->getUserStateFromRequest($paramBase . ".titlelink", 'titlelink', $this->params->get('default_titlelink', 'link'), 'string');
        $pageInfo->lang = $app->getUserStateFromRequest($paramBase . ".lang", 'lang', '', 'string');
        $pageInfo->pict = $app->getUserStateFromRequest($paramBase . ".pict", 'pict', $this->params->get('default_pict', 1), 'string');
        $pageInfo->pictheight = $app->getUserStateFromRequest($paramBase . ".pictheight", 'pictheight', $this->params->get('maxheight', 150), 'string');
        $pageInfo->pictwidth = $app->getUserStateFromRequest($paramBase . ".pictwidth", 'pictwidth', $this->params->get('maxwidth', 150), 'string');
        $pageInfo->limit->value = $app->getUserStateFromRequest($paramBase . '.list_limit', 'limit', $app->getCfg('list_limit'), 'int');
        $pageInfo->limit->start = $app->getUserStateFromRequest($paramBase . '.limitstart', 'limitstart', 0, 'int');
        $picts = array();
        $picts[] = JHTML::_('select.option', "1", JText::_('JOOMEXT_YES'));
        $pictureHelper = acymailing_get('helper.acypict');
        if ($pictureHelper->available()) {
            $picts[] = JHTML::_('select.option', "resized", JText::_('RESIZED'));
        }
        $picts[] = JHTML::_('select.option', "0", JText::_('JOOMEXT_NO'));
        $contenttype = array();
        $contenttype[] = JHTML::_('select.option', "title", JText::_('TITLE_ONLY'));
        $contenttype[] = JHTML::_('select.option', "intro", JText::_('INTRO_ONLY'));
        $contenttype[] = JHTML::_('select.option', "text", JText::_('FIELD_TEXT'));
        $contenttype[] = JHTML::_('select.option', "full", JText::_('FULL_TEXT'));
        $titlelink = array();
        $titlelink[] = JHTML::_('select.option', "link", JText::_('JOOMEXT_YES'));
        $titlelink[] = JHTML::_('select.option', "0", JText::_('JOOMEXT_NO'));
        $authorname = array();
        $authorname[] = JHTML::_('select.option', "author", JText::_('JOOMEXT_YES'));
        $authorname[] = JHTML::_('select.option', "0", JText::_('JOOMEXT_NO'));
        $searchFields = array('a.id', 'a.title', 'a.alias', 'a.created_by', 'b.name', 'b.username');
        if (!empty($pageInfo->search)) {
            $searchVal = '\'%' . acymailing_getEscaped($pageInfo->search, true) . '%\'';
            $filters[] = implode(" LIKE {$searchVal} OR ", $searchFields) . " LIKE {$searchVal}";
        }
        if (!empty($pageInfo->filter_cat)) {
            $filters[] = "a.catid = " . $pageInfo->filter_cat;
        }
        if ($this->params->get('displayart', 'all') == 'onlypub') {
            $filters[] = "a.state = 1";
        } else {
            $filters[] = "a.state != -2";
        }
        if (!$app->isAdmin()) {
            if (!ACYMAILING_J16) {
                $filters[] = 'a.`access` <= ' . (int) $my->get('aid');
            } else {
                $groups = implode(',', $my->getAuthorisedViewLevels());
                $filters[] = 'a.`access` IN (' . $groups . ')';
            }
        }
        if ($this->params->get('frontendaccess') == 'author' && !$app->isAdmin()) {
            $filters[] = "a.created_by = " . intval($my->id);
        }
        $whereQuery = '';
        if (!empty($filters)) {
            $whereQuery = ' WHERE (' . implode(') AND (', $filters) . ')';
        }
        $query = 'SELECT SQL_CALC_FOUND_ROWS a.*,b.name,b.username,a.created_by FROM ' . acymailing_table('content', false) . ' as a';
        $query .= ' LEFT JOIN `#__users` AS b ON b.id = a.created_by';
        if (!empty($whereQuery)) {
            $query .= $whereQuery;
        }
        if (!empty($pageInfo->filter->order->value)) {
            $query .= ' ORDER BY ' . $pageInfo->filter->order->value . ' ' . $pageInfo->filter->order->dir;
        }
        $this->db->setQuery($query, $pageInfo->limit->start, $pageInfo->limit->value);
        $rows = $this->db->loadObjectList();
        if (!empty($pageInfo->search)) {
            $rows = acymailing_search($pageInfo->search, $rows);
        }
        $this->db->setQuery('SELECT FOUND_ROWS()');
        $pageInfo->elements->total = $this->db->loadResult();
        $pageInfo->elements->page = count($rows);
        if (!ACYMAILING_J16) {
            $query = 'SELECT a.id, a.id as catid, a.title as category, b.title as section, b.id as secid from #__categories as a ';
            $query .= 'INNER JOIN #__sections as b on a.section = b.id ORDER BY b.ordering,a.ordering';
            $this->db->setQuery($query);
            $categories = $this->db->loadObjectList('id');
            $categoriesValues = array();
            $categoriesValues[] = JHTML::_('select.option', '', JText::_('ACY_ALL'));
            $currentSec = '';
            foreach ($categories as $catid => $oneCategorie) {
                if ($currentSec != $oneCategorie->section) {
                    if (!empty($currentSec)) {
                        $this->values[] = JHTML::_('select.option', '</OPTGROUP>');
                    }
                    $categoriesValues[] = JHTML::_('select.option', '<OPTGROUP>', $oneCategorie->section);
                    $currentSec = $oneCategorie->section;
                }
                $categoriesValues[] = JHTML::_('select.option', $catid, $oneCategorie->category);
            }
        } else {
            $query = "SELECT * from #__categories WHERE `extension` = 'com_content' ORDER BY lft ASC";
            $this->db->setQuery($query);
            $categories = $this->db->loadObjectList('id');
            $categoriesValues = array();
            $categoriesValues[] = JHTML::_('select.option', '', JText::_('ACY_ALL'));
            foreach ($categories as $catid => $oneCategorie) {
                $categories[$catid]->title = str_repeat('- - ', $categories[$catid]->level) . $categories[$catid]->title;
                $categoriesValues[] = JHTML::_('select.option', $catid, $categories[$catid]->title);
            }
        }
        jimport('joomla.html.pagination');
        $pagination = new JPagination($pageInfo->elements->total, $pageInfo->limit->start, $pageInfo->limit->value);
        $tabs = acymailing_get('helper.acytabs');
        echo $tabs->startPane('joomlacontent_tab');
        echo $tabs->startPanel(JText::_('JOOMLA_CONTENT'), 'joomlacontent_content');
        ?>
		<script language="javascript" type="text/javascript">
			<!--
			var selectedContents = new Array();
			function applyContent(contentid, rowClass){
				var tmp = selectedContents.indexOf(contentid)
				if(tmp != -1){
					window.document.getElementById('content' + contentid).className = rowClass;
					delete selectedContents[tmp];
				}else{
					window.document.getElementById('content' + contentid).className = 'selectedrow';
					selectedContents.push(contentid);
				}
				updateTag();
			}

			function updateTag(){
				var tag = '';
				var otherinfo = '';
				for(var i = 0; i < document.adminForm.contenttype.length; i++){
					if(document.adminForm.contenttype[i].checked){
						selectedtype = document.adminForm.contenttype[i].value;
						otherinfo += '| type:' + document.adminForm.contenttype[i].value;
					}
				}
				for(var i = 0; i < document.adminForm.titlelink.length; i++){
					if(document.adminForm.titlelink[i].checked && document.adminForm.titlelink[i].value.length > 1){
						otherinfo += '| ' + document.adminForm.titlelink[i].value;
					}
				}
				if(selectedtype != 'title'){
					for(var i = 0; i < document.adminForm.author.length; i++){
						if(document.adminForm.author[i].checked && document.adminForm.author[i].value.length > 1){
							otherinfo += '| ' + document.adminForm.author[i].value;
						}
					}
					for(var i = 0; i < document.adminForm.pict.length; i++){
						if(document.adminForm.pict[i].checked){
							otherinfo += '| pict:' + document.adminForm.pict[i].value;
							if(document.adminForm.pict[i].value == 'resized'){
								document.getElementById('pictsize').style.display = '';
								if(document.adminForm.pictwidth.value) otherinfo += '| maxwidth:' + document.adminForm.pictwidth.value;
								if(document.adminForm.pictheight.value) otherinfo += '| maxheight:' + document.adminForm.pictheight.value;
							}else{
								document.getElementById('pictsize').style.display = 'none';
							}
						}
					}
					document.getElementById('format').style.display = '';
				}else{
					document.getElementById('format').style.display = 'none';
				}

				if(document.adminForm.contentformat && document.adminForm.contentformat.value){
					otherinfo += '| format:' + document.adminForm.contentformat.value;
				}

				if(window.document.getElementById('jflang') && window.document.getElementById('jflang').value != ''){
					otherinfo += '|lang:';
					otherinfo += window.document.getElementById('jflang').value;
				}

				for(var i in selectedContents){
					if(selectedContents[i] && !isNaN(i)){
						tag = tag + '{joomlacontent:' + selectedContents[i] + otherinfo + '}<br />';
					}
				}
				setTag(tag);
			}
			//-->
		</script>
		<div class="onelineblockoptions">
			<table width="100%" class="acymailing_table">
				<tr>
					<td>
						<?php 
        echo JText::_('DISPLAY');
        ?>
					</td>
					<td colspan="2">
						<?php 
        echo JHTML::_('acyselect.radiolist', $contenttype, 'contenttype', 'size="1" onclick="updateTag();"', 'value', 'text', $pageInfo->contenttype);
        ?>
					</td>
					<td>
						<?php 
        $jflanguages = acymailing_get('type.jflanguages');
        $jflanguages->onclick = 'onchange="updateTag();"';
        echo $jflanguages->display('lang', $pageInfo->lang);
        ?>
					</td>
				</tr>
				<tr id="format" class="acyplugformat">
					<td valign="top">
						<?php 
        echo JText::_('FORMAT');
        ?>
					</td>
					<td valign="top">
						<?php 
        echo $this->acypluginsHelper->getFormatOption('tagcontent');
        ?>
					</td>
					<td valign="top"><?php 
        echo JText::_('DISPLAY_PICTURES');
        ?>
</td>
					<td valign="top"><?php 
        echo JHTML::_('acyselect.radiolist', $picts, 'pict', 'size="1" onclick="updateTag();"', 'value', 'text', $pageInfo->pict);
        ?>
						<span id="pictsize" <?php 
        if ($pageInfo->pict != 'resized') {
            echo 'style="display:none;"';
        }
        ?>
><br/><?php 
        echo JText::_('CAPTCHA_WIDTH');
        ?>
							<input name="pictwidth" type="text" onchange="updateTag();" value="<?php 
        echo $pageInfo->pictwidth;
        ?>
" style="width:30px;"/>
							x <?php 
        echo JText::_('CAPTCHA_HEIGHT');
        ?>
							<input name="pictheight" type="text" onchange="updateTag();" value="<?php 
        echo $pageInfo->pictheight;
        ?>
" style="width:30px;"/>
						</span>
					</td>
				</tr>
				<tr>
					<td>
						<?php 
        echo JText::_('CLICKABLE_TITLE');
        ?>
					</td>
					<td>
						<?php 
        echo JHTML::_('acyselect.radiolist', $titlelink, 'titlelink', 'size="1" onclick="updateTag();"', 'value', 'text', $pageInfo->titlelink);
        ?>
					</td>
					<td>
						<?php 
        echo JText::_('AUTHOR_NAME');
        ?>
					</td>
					<td>
						<?php 
        echo JHTML::_('acyselect.radiolist', $authorname, 'author', 'size="1" onclick="updateTag();"', 'value', 'text', (string) $pageInfo->author);
        ?>
					</td>
				</tr>
			</table>
		</div>
		<div class="onelineblockoptions">
			<table>
				<tr>
					<td width="100%">
						<?php 
        acymailing_listingsearch($pageInfo->search);
        ?>
					</td>
					<td nowrap="nowrap">
						<?php 
        echo JHTML::_('select.genericlist', $categoriesValues, 'filter_cat', 'class="inputbox" size="1" onchange="document.adminForm.submit( );"', 'value', 'text', (int) $pageInfo->filter_cat);
        ?>
					</td>
				</tr>
			</table>

			<table class="acymailing_table" cellpadding="1" width="100%">
				<thead>
				<tr>
					<th class="title">
					</th>
					<th class="title">
						<?php 
        echo JHTML::_('grid.sort', JText::_('FIELD_TITLE'), 'a.title', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
        ?>
					</th>
					<th class="title">
						<?php 
        echo JHTML::_('grid.sort', JText::_('ACY_AUTHOR'), 'b.name', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
        ?>
					</th>
					<th class="title">
						<?php 
        echo JHTML::_('grid.sort', JText::_(ACYMAILING_J16 ? 'COM_CONTENT_PUBLISHED_DATE' : 'START PUBLISHING'), 'a.publish_up', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
        ?>
					</th>
					<th class="title">
						<?php 
        echo JHTML::_('grid.sort', JText::_('ACY_CREATED'), 'a.created', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
        ?>
					</th>
					<th class="title titleid">
						<?php 
        echo JHTML::_('grid.sort', JText::_('ACY_ID'), 'a.id', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
        ?>
					</th>
				</tr>
				</thead>
				<tfoot>
				<tr>
					<td colspan="6">
						<?php 
        echo $pagination->getListFooter();
        ?>
						<?php 
        echo $pagination->getResultsCounter();
        ?>
					</td>
				</tr>
				</tfoot>
				<tbody>
				<?php 
        $k = 0;
        for ($i = 0, $a = count($rows); $i < $a; $i++) {
            $row =& $rows[$i];
            ?>
					<tr id="content<?php 
            echo $row->id;
            ?>
" class="<?php 
            echo "row{$k}";
            ?>
" onclick="applyContent(<?php 
            echo $row->id . ",'row{$k}'";
            ?>
);" style="cursor:pointer;">
						<td class="acytdcheckbox"></td>
						<td>
							<?php 
            $text = '<b>' . JText::_('JOOMEXT_ALIAS') . ': </b>' . $row->alias;
            echo acymailing_tooltip($text, $row->title, '', $row->title);
            ?>
						</td>
						<td>
							<?php 
            if (!empty($row->name)) {
                $text = '<b>' . JText::_('JOOMEXT_NAME') . ' : </b>' . $row->name;
                $text .= '<br /><b>' . JText::_('ACY_USERNAME') . ' : </b>' . $row->username;
                $text .= '<br /><b>' . JText::_('ACY_ID') . ' : </b>' . $row->created_by;
                echo acymailing_tooltip($text, $row->name, '', $row->name);
            }
            ?>
						</td>
						<td align="center">
							<?php 
            echo JHTML::_('date', strip_tags($row->publish_up), JText::_('DATE_FORMAT_LC4'));
            ?>
						</td>
						<td align="center">
							<?php 
            echo JHTML::_('date', strip_tags($row->created), JText::_('DATE_FORMAT_LC4'));
            ?>
						</td>
						<td align="center">
							<?php 
            echo $row->id;
            ?>
						</td>
					</tr>
					<?php 
            $k = 1 - $k;
        }
        ?>
				</tbody>
			</table>
		</div>
		<input type="hidden" name="boxchecked" value="0"/>
		<input type="hidden" name="filter_order" value="<?php 
        echo $pageInfo->filter->order->value;
        ?>
"/>
		<input type="hidden" name="filter_order_Dir" value="<?php 
        echo $pageInfo->filter->order->dir;
        ?>
"/>
		<?php 
        echo $tabs->endPanel();
        echo $tabs->startPanel(JText::_('TAG_CATEGORIES'), 'joomlacontent_auto');
        $type = JRequest::getString('type');
        ?>
		<script language="javascript" type="text/javascript">
			<!--
			window.onload = function(){
				if(window.document.getElementById('tagsauto')){
					window.document.getElementById('tagsauto').onchange = updateAutoTag;
				}
			}
			var selectedCategories = new Array();
			<?php 
        if (!ACYMAILING_J16) {
            ?>
			function applyAutoContent(secid, catid, rowClass){
				if(selectedCategories[secid] && selectedCategories[secid][catid]){
					window.document.getElementById('content_sec' + secid + '_cat' + catid).className = rowClass;
					delete selectedCategories[secid][catid];
				}else{
					if(!selectedCategories[secid]) selectedCategories[secid] = new Array();
					if(secid == 0){
						for(var isec in selectedCategories){
							for(var icat in selectedCategories[isec]){
								if(selectedCategories[isec][icat] == 'content'){
									window.document.getElementById('content_sec' + isec + '_cat' + icat).className = 'row0';
									delete selectedCategories[isec][icat];
								}
							}
						}
					}else{
						if(selectedCategories[0] && selectedCategories[0][0]){
							window.document.getElementById('content_sec0_cat0').className = 'row0';
							delete selectedCategories[0][0];
						}

						if(catid == 0){
							for(var icat in selectedCategories[secid]){
								if(selectedCategories[secid][icat] == 'content'){
									window.document.getElementById('content_sec' + secid + '_cat' + icat).className = 'row0';
									delete selectedCategories[secid][icat];
								}
							}
						}else{
							if(selectedCategories[secid][0]){
								window.document.getElementById('content_sec' + secid + '_cat0').className = 'row0';
								delete selectedCategories[secid][0];
							}
						}
					}

					window.document.getElementById('content_sec' + secid + '_cat' + catid).className = 'selectedrow';
					selectedCategories[secid][catid] = 'content';
				}

				updateAutoTag();
			}
			<?php 
        } else {
            ?>
			function applyAutoContent(catid, rowClass){
				if(selectedCategories[catid]){
					window.document.getElementById('content_cat' + catid).className = rowClass;
					delete selectedCategories[catid];
				}else{
					window.document.getElementById('content_cat' + catid).className = 'selectedrow';
					selectedCategories[catid] = 'content';
				}

				updateAutoTag();
			}
			<?php 
        }
        ?>

			function updateAutoTag(){
				tag = '{autocontent:';
				<?php 
        if (!ACYMAILING_J16) {
            ?>
				for(var isec in selectedCategories){
					for(var icat in selectedCategories[isec]){
						if(selectedCategories[isec][icat] == 'content'){
							if(icat != 0){
								tag += 'cat' + icat + '-';
							}else{
								tag += 'sec' + isec + '-';
							}
						}
					}
				}
				<?php 
        } else {
            ?>
				for(var icat in selectedCategories){
					if(selectedCategories[icat] == 'content'){
						tag += icat + '-';
					}
				}
				<?php 
        }
        ?>

				if(document.adminForm.min_article && document.adminForm.min_article.value && document.adminForm.min_article.value != 0){
					tag += '| min:' + document.adminForm.min_article.value;
				}
				if(document.adminForm.max_article.value && document.adminForm.max_article.value != 0){
					tag += '| max:' + document.adminForm.max_article.value;
				}
				if(document.adminForm.contentorder.value){
					tag += "| order:" + document.adminForm.contentorder.value + "," + document.adminForm.contentorderdir.value;
				}
				if(document.adminForm.contentfilter && document.adminForm.contentfilter.value){
					tag += document.adminForm.contentfilter.value;
				}
				if(document.adminForm.meta_article && document.adminForm.meta_article.value){
					tag += '| meta:' + document.adminForm.meta_article.value;
				}

				for(var i = 0; i < document.adminForm.contenttypeauto.length; i++){
					if(document.adminForm.contenttypeauto[i].checked){
						selectedtype = document.adminForm.contenttypeauto[i].value;
						tag += '| type:' + document.adminForm.contenttypeauto[i].value;
					}
				}

				for(var i = 0; i < document.adminForm.titlelinkauto.length; i++){
					if(document.adminForm.titlelinkauto[i].checked && document.adminForm.titlelinkauto[i].value.length > 1){
						tag += '|' + document.adminForm.titlelinkauto[i].value;
					}
				}
				if(selectedtype != 'title'){
					for(var i = 0; i < document.adminForm.authorauto.length; i++){
						if(document.adminForm.authorauto[i].checked && document.adminForm.authorauto[i].value.length > 1){
							tag += '|' + document.adminForm.authorauto[i].value;
						}
					}
					for(var i = 0; i < document.adminForm.pictauto.length; i++){
						if(document.adminForm.pictauto[i].checked){
							tag += '| pict:' + document.adminForm.pictauto[i].value;
							if(document.adminForm.pictauto[i].value == 'resized'){
								document.getElementById('pictsizeauto').style.display = '';
								if(document.adminForm.pictwidthauto.value) tag += '| maxwidth:' + document.adminForm.pictwidthauto.value;
								if(document.adminForm.pictheightauto.value) tag += '| maxheight:' + document.adminForm.pictheightauto.value;
							}else{
								document.getElementById('pictsizeauto').style.display = 'none';
							}
						}
					}
					document.getElementById('formatauto').style.display = '';
				}else{
					document.getElementById('formatauto').style.display = 'none';
				}

				if(document.getElementById('contentformatautoinvert').value == 1) tag += '| invert';
				if(document.adminForm.contentformatauto && document.adminForm.contentformatauto.value){
					tag += '| format:' + document.adminForm.contentformatauto.value;
				}

				if(document.adminForm.cols && document.adminForm.cols.value > 1){
					tag += '| cols:' + document.adminForm.cols.value;
				}
				if(window.document.getElementById('jflangauto') && window.document.getElementById('jflangauto').value != ''){
					tag += '| lang:' + window.document.getElementById('jflangauto').value;
				}
				if(window.document.getElementById('jlang') && window.document.getElementById('jlang').value != ''){
					tag += '| language:';
					tag += window.document.getElementById('jlang').value;
				}

				if(window.document.getElementById('tagsauto')){
					var tmp = 0;
					for(var i = 0; i < window.document.getElementById('tagsauto').length; i++){
						if(window.document.getElementById('tagsauto')[i].selected){
							if(tmp == 0){
								tag += '| tags:' + window.document.getElementById('tagsauto')[i].value;
								tmp = 1;
							}else{
								tag += ',' + window.document.getElementById('tagsauto')[i].value;
							}
						}
					}
				}

				tag += '}';

				setTag(tag);
			}
			//-->
		</script>
		<div class="onelineblockoptions">
			<table width="100%" class="acymailing_table">
				<tr>
					<td>
						<?php 
        echo JText::_('DISPLAY');
        ?>
					</td>
					<td colspan="2">
						<?php 
        echo JHTML::_('acyselect.radiolist', $contenttype, 'contenttypeauto', 'size="1" onclick="updateAutoTag();"', 'value', 'text', $this->params->get('default_type', 'intro'));
        ?>
					</td>
					<td id="languagesauto">
						<?php 
        $jflanguages = acymailing_get('type.jflanguages');
        $jflanguages->onclick = 'onchange="updateAutoTag();"';
        $jflanguages->id = 'jflangauto';
        echo $jflanguages->display('langauto');
        if (empty($jflanguages->found)) {
            echo $jflanguages->displayJLanguages('jlangauto');
        }
        ?>
					</td>
				</tr>
				<tr id="formatauto" class="acyplugformat">
					<td valign="top">
						<?php 
        echo JText::_('FORMAT');
        ?>
					</td>
					<td valign="top">
						<?php 
        echo $this->acypluginsHelper->getFormatOption('tagcontent', 'TOP_LEFT', false, 'updateAutoTag');
        ?>
					</td>
					<td valign="top"><?php 
        echo JText::_('DISPLAY_PICTURES');
        ?>
</td>
					<td valign="top"><?php 
        echo JHTML::_('acyselect.radiolist', $picts, 'pictauto', 'size="1" onclick="updateAutoTag();"', 'value', 'text', $this->params->get('default_pict', '1'));
        ?>
						<span id="pictsizeauto" <?php 
        if ($this->params->get('default_pict', '1') != 'resized') {
            echo 'style="display:none;"';
        }
        ?>
 ><br/><?php 
        echo JText::_('CAPTCHA_WIDTH');
        ?>
							<input name="pictwidthauto" type="text" onchange="updateAutoTag();" value="<?php 
        echo $this->params->get('maxwidth', '150');
        ?>
" style="width:30px;"/>
							x <?php 
        echo JText::_('CAPTCHA_HEIGHT');
        ?>
							<input name="pictheightauto" type="text" onchange="updateAutoTag();" value="<?php 
        echo $this->params->get('maxheight', '150');
        ?>
" style="width:30px;"/>
						</span>
					</td>
				</tr>
				<tr>
					<td>
						<?php 
        echo JText::_('CLICKABLE_TITLE');
        ?>
					</td>
					<td>
						<?php 
        echo JHTML::_('acyselect.radiolist', $titlelink, 'titlelinkauto', 'size="1" onclick="updateAutoTag();"', 'value', 'text', $this->params->get('default_titlelink', 'link'));
        ?>
					</td>
					<td>
						<?php 
        echo JText::_('AUTHOR_NAME');
        ?>
					</td>
					<td>
						<?php 
        echo JHTML::_('acyselect.radiolist', $authorname, 'authorauto', 'size="1" onclick="updateAutoTag();"', 'value', 'text', (string) $this->params->get('default_author', '0'));
        ?>
					</td>
				</tr>
				<tr>
					<?php 
        if (version_compare(JVERSION, '3.1.0', '>=')) {
            ?>
						<td valign="top">
							<?php 
            echo JText::_('TAGS');
            ?>
						</td>
						<td>
							<?php 
            $form = JForm::getInstance('acytagcontenttags', JPATH_SITE . DS . 'components' . DS . 'com_acymailing' . DS . 'params' . DS . 'tagcontenttags.xml');
            foreach ($form->getFieldset('tagcontenttagfield') as $field) {
                echo $field->input;
            }
            ?>
						</td>
					<?php 
        } else {
            ?>
						<td colspan="2"></td>
					<?php 
        }
        ?>
					<td valign="top"><?php 
        echo JText::_('FIELD_COLUMNS');
        ?>
</td>
					<td valign="top">
						<select name="cols" style="width:150px" onchange="updateAutoTag();" size="1">
							<?php 
        for ($o = 1; $o < 11; $o++) {
            echo '<option value="' . $o . '">' . $o . '</option>';
        }
        ?>
						</select>
					</td>
				</tr>
				<tr>
					<td>
						<?php 
        echo JText::_('MAX_ARTICLE');
        ?>
					</td>
					<td>
						<input type="text" name="max_article" style="width:50px" value="20" onchange="updateAutoTag();"/>
					</td>
					<td>
						<?php 
        echo JText::_('ACY_ORDER');
        ?>
					</td>
					<td>
						<?php 
        $values = array('id' => 'ACY_ID', 'ordering' => 'ACY_ORDERING', 'created' => 'CREATED_DATE', 'modified' => 'MODIFIED_DATE', 'title' => 'FIELD_TITLE');
        echo $this->acypluginsHelper->getOrderingField($values, 'id', 'DESC', 'updateAutoTag');
        ?>
					</td>
				</tr>
				<?php 
        if ($this->params->get('metaselect')) {
            ?>
					<tr>
						<td>
							<?php 
            echo JText::_('META_KEYWORDS');
            ?>
						</td>
						<td colspan="3">
							<input type="text" name="meta_article" style="width:200px" value="" onchange="updateAutoTag();"/>
						</td>
					</tr>
				<?php 
        }
        ?>
				<?php 
        if ($type == 'autonews') {
            ?>
					<tr>
						<td>
							<?php 
            echo JText::_('MIN_ARTICLE');
            ?>
						</td>
						<td>
							<input type="text" name="min_article" style="width:50px" value="1" onchange="updateAutoTag();"/>
						</td>
						<td>
							<?php 
            echo JText::_('JOOMEXT_FILTER');
            ?>
						</td>
						<td>
							<?php 
            $filter = acymailing_get('type.contentfilter');
            $filter->onclick = "updateAutoTag();";
            echo $filter->display('contentfilter', '|filter:created');
            ?>
						</td>
					</tr>
				<?php 
        }
        ?>
			</table>
		</div>

		<div class="onelineblockoptions">
			<table class="acymailing_table" cellpadding="1" width="100%">
				<thead>
				<tr>
					<th class="title"></th>
					<?php 
        if (!ACYMAILING_J16) {
            ?>
						<th class="title">
							<?php 
            echo JText::_('SECTION');
            ?>
						</th>
					<?php 
        }
        ?>
					<th class="title">
						<?php 
        echo JText::_('TAG_CATEGORIES');
        ?>
					</th>
				</tr>
				</thead>
				<tbody>
				<?php 
        $k = 0;
        if (!ACYMAILING_J16) {
            ?>
					<tr id="content_sec0_cat0" class="<?php 
            echo "row{$k}";
            ?>
" onclick="applyAutoContent(0,0,'<?php 
            echo "row{$k}";
            ?>
');" style="cursor:pointer;">
						<td class="acytdcheckbox"></td>
						<td style="font-weight: bold;">
							<?php 
            echo JText::_('ACY_ALL');
            ?>
						</td>
						<td style="text-align:center;font-weight: bold;">
							<?php 
            echo JText::_('ACY_ALL');
            ?>
						</td>
					</tr>

				<?php 
        }
        $k = 1 - $k;
        $currentSection = '';
        foreach ($categories as $row) {
            if (!ACYMAILING_J16 && $currentSection != $row->section) {
                ?>
						<tr id="content_sec<?php 
                echo $row->secid;
                ?>
_cat0" class="<?php 
                echo "row{$k}";
                ?>
" onclick="applyAutoContent(<?php 
                echo $row->secid;
                ?>
,0,'<?php 
                echo "row{$k}";
                ?>
');" style="cursor:pointer;">
							<td class="acytdcheckbox"></td>
							<td style="font-weight: bold;">
								<?php 
                echo $row->section;
                ?>
							</td>
							<td style="text-align:center;font-weight: bold;">
								<?php 
                echo JText::_('ACY_ALL');
                ?>
							</td>
						</tr>
						<?php 
                $k = 1 - $k;
                $currentSection = $row->section;
            }
            if (!ACYMAILING_J16) {
                ?>
						<tr id="content_sec<?php 
                echo $row->secid;
                ?>
_cat<?php 
                echo $row->catid;
                ?>
" class="<?php 
                echo "row{$k}";
                ?>
" onclick="applyAutoContent(<?php 
                echo $row->secid;
                ?>
,<?php 
                echo $row->catid;
                ?>
,'<?php 
                echo "row{$k}";
                ?>
');" style="cursor:pointer;">
							<td class="acytdcheckbox"></td>
							<td>
							</td>
							<td>
								<?php 
                echo $row->category;
                ?>
							</td>
						</tr>
					<?php 
            } else {
                ?>
						<tr id="content_cat<?php 
                echo $row->id;
                ?>
" class="<?php 
                echo "row{$k}";
                ?>
" onclick="applyAutoContent(<?php 
                echo $row->id;
                ?>
,'<?php 
                echo "row{$k}";
                ?>
');" style="cursor:pointer;">
							<td class="acytdcheckbox"></td>
							<td>
								<?php 
                echo $row->title;
                ?>
							</td>
						</tr>
					<?php 
            }
            $k = 1 - $k;
        }
        ?>
				</tbody>
			</table>
		</div>
		<?php 
        echo $tabs->endPanel();
        echo $tabs->endPane();
    }
示例#7
0
 /**
  *  Funkce pro zobrazení přehledu článků pro jejich výběr
  */
 function articlesHtml()
 {
     global $mainframe;
     $model = $this->getModel();
     $limit = JRequest::getVar('limit', $mainframe->getCfg(list_limit));
     $limitstart = JRequest::getVar('limitstart', 0);
     $articles = $model->getArticles(JRequest::getInt('section', -1), JRequest::getInt('categorie', -1), JRequest::getString('filter', ''), JRequest::getCmd('filter_order', 'title'), JRequest::getCmd('filter_order_Dir', 'asc'), $limitstart, $limit, true);
     $total = $model->getArticlesCount(JRequest::getInt('section', -1), JRequest::getInt('categorie', -1), JRequest::getString('filter', ''), true);
     $result = '';
     jimport('joomla.html.pagination');
     $pageNav = new JPagination($total, $limitstart, $limit);
     $result .= '<h3>' . JText::_('SELECT_ARTICLE') . '</h3>';
     $result .= '<form action="index.php?option=com_ginclude&amp;task=reload" name="adminForm" id="adminForm" method="post">';
     $orderDir = JRequest::getCmd('filter_order_Dir', 'asc');
     if ($orderDir == 'asc') {
         $orderDir2 = 'desc';
     } else {
         $orderDir2 = 'asc';
     }
     $result .= '<div style="position:relative;">' . JText::_(FILTER) . ': <input type="text" name="filter" value="' . JRequest::getString('filter', '') . '" id="filter" /><button onclick="this.form.submit();">OK</button><button onclick="document.getElementById(\'filter\').value=\'\';this.form.submit();">Reset</button>';
     $result .= '<div style="display:inline;position:absolute;right:5px;top:2px;"><select name="section" onchange="document.adminForm.submit();"><option value="-1">--' . JText::_(SELECT_SECTION) . '--</option>';
     $sections = $model->getSections();
     if (count($sections)) {
         foreach ($sections as $key => $value) {
             $result .= '<option value="' . $key . '"';
             if (JRequest::getInt('section', -1) == $key) {
                 $result .= ' selected="selected" ';
             }
             $result .= '>' . $value . '</option>';
         }
     }
     $result .= '</select> ';
     $result .= '<select name="categorie" onchange="document.adminForm.submit();"><option value="-1">--' . JText::_(SELECT_CATEGORY) . '--</option>';
     $categories = $model->getCategories(JRequest::getInt('section', -1));
     if (count($categories) > 0) {
         foreach ($categories as $key => $value) {
             $result .= '<option value="' . $key . '"';
             if (JRequest::getInt('categorie', -1) == $key) {
                 $result .= ' selected="selected" ';
             }
             $result .= '>' . $value . '</option>';
         }
     }
     $result .= '</select></div>';
     $result .= '</div>';
     $result .= '<table border="0" class="adminlist" cellspacing="1"><thead><tr><th><a href="javascript:tableOrdering(\'1\',\'' . $orderDir2 . '\',\'\');">' . JText::_('TITLE') . '</a></th><th width="150"><a href="javascript:tableOrdering(\'2\',\'' . $orderDir2 . '\',\'\');">' . JText::_('SECTION') . '</a></th><th width="150"><a href="javascript:tableOrdering(\'3\',\'' . $orderDir2 . '\',\'\');">' . JText::_('CATEGORY') . '</a></th><th width="80"><a href="javascript:tableOrdering(\'created\',\'' . $orderDir2 . '\',\'\');">' . JText::_('DATE') . '</a></th></tr></thead>';
     if ($total > 0 && count($articles) > 0) {
         foreach ($articles as $article) {
             if ($rowClass == 'row0') {
                 $rowClass = 'row1';
             } else {
                 $rowClass = 'row0';
             }
             $result .= '<tr class="' . $rowClass . '"><td><a href="index.php?option=com_ginclude&amp;task=reload&amp;article=' . $article->id . '">' . $article->title . '</a></td><td>' . $article->section . '</td><td>' . $article->categorie . '</td><td>' . $article->cdate . '</td></tr>';
         }
     }
     $result .= '<tfoot><tr><td colspan="4">' . $pageNav->getListFooter() . '</td></tr></tfoot></table>';
     $result .= '<input type="hidden" name="filter_order" value="' . JRequest::getCmd('filter_order', 'title') . '" />';
     $result .= '<input type="hidden" name="filter_order_Dir" value="' . $orderDir . '" />';
     $result .= '</form>';
     return $result;
 }
示例#8
0
    function acymailingtagvmproduct_show()
    {
        $app =& JFactory::getApplication();
        $contentType = array();
        $contentType[] = JHTML::_('select.option', "|type:title", JText::_('TITLE_ONLY'));
        $contentType[] = JHTML::_('select.option', "|type:intro", JText::_('INTRO_ONLY'));
        $contentType[] = JHTML::_('select.option', "|type:full", JText::_('FULL_TEXT'));
        $pageInfo = null;
        $paramBase = ACYMAILING_COMPONENT . '.tagvmproduct';
        $pageInfo->filter->order->value = $app->getUserStateFromRequest($paramBase . ".filter_order", 'filter_order', 'a.product_id', 'cmd');
        $pageInfo->filter->order->dir = $app->getUserStateFromRequest($paramBase . ".filter_order_Dir", 'filter_order_Dir', 'desc', 'word');
        $pageInfo->search = $app->getUserStateFromRequest($paramBase . ".search", 'search', '', 'string');
        $pageInfo->search = JString::strtolower($pageInfo->search);
        $pageInfo->lang = $app->getUserStateFromRequest($paramBase . ".lang", 'lang', '', 'string');
        $pageInfo->contenttype = $app->getUserStateFromRequest($paramBase . ".contenttype", 'contenttype', '|type:full', 'string');
        $pageInfo->limit->value = $app->getUserStateFromRequest($paramBase . '.list_limit', 'limit', $app->getCfg('list_limit'), 'int');
        $pageInfo->limit->start = $app->getUserStateFromRequest($paramBase . '.limitstart', 'limitstart', 0, 'int');
        $db =& JFactory::getDBO();
        if (!empty($pageInfo->search)) {
            $searchVal = '\'%' . $db->getEscaped($pageInfo->search) . '%\'';
            $filters[] = "a.product_id LIKE {$searchVal} OR a.product_s_desc LIKE {$searchVal} OR a.product_name LIKE {$searchVal} OR a.product_sku LIKE {$searchVal}";
        }
        $whereQuery = '';
        if (!empty($filters)) {
            $whereQuery = ' WHERE (' . implode(') AND (', $filters) . ')';
        }
        $query = 'SELECT SQL_CALC_FOUND_ROWS a.product_id,a.product_s_desc,a.product_sku,a.product_name FROM ' . acymailing::table('vm_product', false) . ' as a';
        if (!empty($whereQuery)) {
            $query .= $whereQuery;
        }
        if (!empty($pageInfo->filter->order->value)) {
            $query .= ' ORDER BY ' . $pageInfo->filter->order->value . ' ' . $pageInfo->filter->order->dir;
        }
        $db->setQuery($query, $pageInfo->limit->start, $pageInfo->limit->value);
        $rows = $db->loadObjectList();
        if (!empty($pageInfo->search)) {
            $rows = acymailing::search($pageInfo->search, $rows);
        }
        $db->setQuery('SELECT FOUND_ROWS()');
        $pageInfo->elements->total = $db->loadResult();
        $pageInfo->elements->page = count($rows);
        jimport('joomla.html.pagination');
        $pagination = new JPagination($pageInfo->elements->total, $pageInfo->limit->start, $pageInfo->limit->value);
        jimport('joomla.html.pane');
        $tabs =& JPane::getInstance('tabs');
        echo $tabs->startPane('vmproduct_tab');
        echo $tabs->startPanel(JText::_('VM_PRODUCT'), 'vm_product');
        ?>

			<script language="javascript" type="text/javascript">
		<!--
			function updateTag(productid){
				tag = '{vmproduct:'+productid;
				for(var i=0; i < document.adminForm.contenttype.length; i++){
				   if (document.adminForm.contenttype[i].checked){ tag += document.adminForm.contenttype[i].value; }
				}
				if(window.document.getElementById('jflang')  && window.document.getElementById('jflang').value != ''){
					tag += '|lang:';
					tag += window.document.getElementById('jflang').value;
				}
				tag += '}';
				setTag(tag);
				insertTag();
			}
		//-->
		</script>
		<table>
			<tr>
				<td width="100%">
					<?php 
        echo JText::_('JOOMEXT_FILTER');
        ?>
:
					<input type="text" name="search" id="acymailingsearch" value="<?php 
        echo $pageInfo->search;
        ?>
" class="text_area" onchange="document.adminForm.submit();" />
					<button onclick="this.form.submit();"><?php 
        echo JText::_('JOOMEXT_GO');
        ?>
</button>
					<button onclick="document.getElementById('acymailingsearch').value='';this.form.submit();"><?php 
        echo JText::_('JOOMEXT_RESET');
        ?>
</button>
				</td>
			</tr>
		</table>
		<table width="100%" class="adminform">
			<tr>
				<td>
					<?php 
        echo JText::_('DISPLAY');
        ?>

				</td>
				<td colspan="2">
				<?php 
        echo JHTML::_('select.radiolist', $contentType, 'contenttype', 'size="1"', 'value', 'text', $pageInfo->contenttype);
        ?>

				</td>
				<td>
					<?php 
        $jflanguages = acymailing::get('type.jflanguages');
        echo $jflanguages->display('lang', $pageInfo->lang);
        ?>

				</td>
			</tr>
		</table>
		<table class="adminlist" cellpadding="1" width="100%">
			<thead>
				<tr>
					<th class="title">
						<?php 
        echo JHTML::_('grid.sort', JText::_('NAME'), 'a.product_name', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
        ?>

					</th>
					<th class="title">
						<?php 
        echo JHTML::_('grid.sort', JText::_('DESCRIPTION'), 'a.product_s_desc', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
        ?>

					</th>
					<th class="title titleid">
						<?php 
        echo JHTML::_('grid.sort', JText::_('ID'), 'a.product_id', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
        ?>

					</th>
				</tr>
			</thead>
			<tfoot>
				<tr>
					<td colspan="3">
						<?php 
        echo $pagination->getListFooter();
        ?>

						<?php 
        echo $pagination->getResultsCounter();
        ?>

					</td>
				</tr>
			</tfoot>
			<tbody>
				<?php 
        $k = 0;
        for ($i = 0, $a = count($rows); $i < $a; $i++) {
            $row =& $rows[$i];
            ?>

					<tr id="content<?php 
            echo $row->product_id;
            ?>
" class="<?php 
            echo "row{$k}";
            ?>
" onclick="updateTag(<?php 
            echo $row->product_id;
            ?>
);" style="cursor:pointer;">
						<td>
						<?php 
            echo acymailing::tooltip('SKU : ' . $row->product_sku, $row->product_name, '', $row->product_name);
            ?>

						</td>
						<td>
						<?php 
            echo $row->product_s_desc;
            ?>

						</td>
						<td align="center">
							<?php 
            echo $row->product_id;
            ?>

						</td>
					</tr>
				<?php 
            $k = 1 - $k;
        }
        ?>

			</tbody>
		</table>
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="filter_order" value="<?php 
        echo $pageInfo->filter->order->value;
        ?>
" />
		<input type="hidden" name="filter_order_Dir" value="<?php 
        echo $pageInfo->filter->order->dir;
        ?>
" />
	<?php 
        echo $tabs->endPanel();
        echo $tabs->startPanel(JText::_('TAG_CATEGORIES'), 'vm_auto');
        $type = JRequest::getString('type');
        $db->setQuery('SELECT a.*,b.* FROM `#__vm_category` as a LEFT JOIN `#__vm_category_xref` as b ON a.category_id = b.category_child_id ORDER BY `list_order`');
        $categories = $db->loadObjectList('category_id');
        $this->cats = array();
        foreach ($categories as $oneCat) {
            $this->cats[$oneCat->category_parent_id][] = $oneCat;
        }
        $ordering = array();
        $ordering[] = JHTML::_('select.option', "|order:product_id,DESC", JText::_('ID'));
        $ordering[] = JHTML::_('select.option', "|order:cdate,DESC", JText::_('CREATED_DATE'));
        $ordering[] = JHTML::_('select.option', "|order:mdate,DESC", JText::_('MODIFIED_DATE'));
        $ordering[] = JHTML::_('select.option', "|order:product_name,ASC", JText::_('TITLE'));
        ?>

	<script language="javascript" type="text/javascript">
		<!--
			var selectedCat = new Array();
			function applyAutoProduct(catid,rowClass){
				if(selectedCat[catid]){
					window.document.getElementById('product_cat'+catid).className = rowClass;
					delete selectedCat[catid];
				}else{
					window.document.getElementById('product_cat'+catid).className = 'selectedrow';
					selectedCat[catid] = 'product';
				}
				updateTagAuto();
			}
			function updateTagAuto(){
				tag = '{autovmproduct:';
				for(var icat in selectedCat){
					if(selectedCat[icat] == 'product'){
						tag += icat+'-';
					}
				}
				for(var i=0; i < document.adminForm.contenttypeauto.length; i++){
				   if (document.adminForm.contenttypeauto[i].checked){ tag += document.adminForm.contenttypeauto[i].value; }
				}
				if(document.adminForm.min_article && document.adminForm.min_article.value && document.adminForm.min_article.value!=0){ tag += '|min:'+document.adminForm.min_article.value; }
				if(document.adminForm.max_article.value && document.adminForm.max_article.value!=0){ tag += '|max:'+document.adminForm.max_article.value; }
				if(document.adminForm.contentorder.value){ tag += document.adminForm.contentorder.value; }
				if(document.adminForm.contentfilter && document.adminForm.contentfilter.value){ tag += document.adminForm.contentfilter.value; }
				if(window.document.getElementById('jflangvm')  && window.document.getElementById('jflangvm').value != ''){
					tag += '|lang:';
					tag += window.document.getElementById('jflangvm').value;
				}
				tag += '}';
				setTag(tag);
			}
		//-->
	</script>
	<table width="100%" class="adminform">
		<tr>
			<td>
				<?php 
        echo JText::_('DISPLAY');
        ?>

			</td>
			<td colspan="2">
			<?php 
        echo JHTML::_('select.radiolist', $contentType, 'contenttypeauto', 'size="1" onclick="updateTagAuto();"', 'value', 'text', '|type:full');
        ?>

			</td>
			<td>
				<?php 
        $jflanguages = acymailing::get('type.jflanguages');
        if (!empty($jflanguages->values)) {
            $jflanguages->id = 'jflangvm';
            $jflanguages->onclick = 'onchange="updateTagAuto();"';
            echo $jflanguages->display('language');
        }
        ?>

			</td>
		</tr>
		<tr>
			<td>
			<?php 
        echo JText::_('MAX_ARTICLE');
        ?>

			 </td>
			 <td>
			 	<input name="max_article" size="10" value="" onchange="updateTagAuto();"/>
			</td>
			<td>
				<?php 
        echo JText::_('ORDER BY');
        ?>

			 </td>
			 <td>
			 	<?php 
        echo JHTML::_('select.genericlist', $ordering, 'contentorder', 'size="1" onchange="updateTagAuto();"');
        ?>

			</td>
		</tr>
		<?php 
        if ($type == 'autonews') {
            ?>

		<tr>
			<td>
			<?php 
            echo JText::_('MIN_ARTICLE');
            ?>

			 </td>
			 <td>
			 <input name="min_article" size="10" value="1" onchange="updateTagAuto();"/>
			 </td>
			<td>
			<?php 
            echo JText::_('FILTER');
            ?>

			 </td>
			 <td>
			 	<?php 
            $filter = acymailing::get('type.contentfilter');
            $filter->onclick = 'updateTagAuto();';
            echo $filter->display('contentfilter', '|filter:created');
            ?>

			</td>
		</tr>
		<?php 
        }
        ?>

	</table>
	<table class="adminlist" cellpadding="1" width="100%">
	<?php 
        $k = 0;
        echo $this->displayChildren(0, $k);
        ?>

	</table>
	<?php 
        echo $tabs->endPanel();
        echo $tabs->endPane();
    }
示例#9
0
    function acymailingtagcontent_show()
    {
        $app =& JFactory::getApplication();
        $pageInfo = null;
        $my = JFactory::getUser();
        $paramBase = ACYMAILING_COMPONENT . '.tagcontent';
        $pageInfo->filter->order->value = $app->getUserStateFromRequest($paramBase . ".filter_order", 'filter_order', 'a.id', 'cmd');
        $pageInfo->filter->order->dir = $app->getUserStateFromRequest($paramBase . ".filter_order_Dir", 'filter_order_Dir', 'desc', 'word');
        $pageInfo->search = $app->getUserStateFromRequest($paramBase . ".search", 'search', '', 'string');
        $pageInfo->search = JString::strtolower($pageInfo->search);
        $pageInfo->filter_cat = $app->getUserStateFromRequest($paramBase . ".filter_cat", 'filter_cat', '', 'int');
        $pageInfo->contenttype = $app->getUserStateFromRequest($paramBase . ".contenttype", 'contenttype', '|type:intro', 'string');
        $pageInfo->author = $app->getUserStateFromRequest($paramBase . ".author", 'author', '', 'string');
        $pageInfo->titlelink = $app->getUserStateFromRequest($paramBase . ".titlelink", 'titlelink', '|link', 'string');
        $pageInfo->lang = $app->getUserStateFromRequest($paramBase . ".lang", 'lang', '', 'string');
        $pageInfo->pict = $app->getUserStateFromRequest($paramBase . ".pict", 'pict', '1', 'string');
        $pageInfo->limit->value = $app->getUserStateFromRequest($paramBase . '.list_limit', 'limit', $app->getCfg('list_limit'), 'int');
        $pageInfo->limit->start = $app->getUserStateFromRequest($paramBase . '.limitstart', 'limitstart', 0, 'int');
        $picts = array();
        $picts[] = JHTML::_('select.option', "1", JText::_('JOOMEXT_YES'));
        $pictureHelper = acymailing::get('helper.acypict');
        if ($pictureHelper->available()) {
            $picts[] = JHTML::_('select.option', "resized", JText::_('RESIZED'));
        }
        $picts[] = JHTML::_('select.option', "0", JText::_('JOOMEXT_NO'));
        $db =& JFactory::getDBO();
        $searchFields = array('a.id', 'a.title', 'a.alias', 'a.created_by', 'b.name', 'b.username');
        if (!empty($pageInfo->search)) {
            $searchVal = '\'%' . $db->getEscaped($pageInfo->search, true) . '%\'';
            $filters[] = implode(" LIKE {$searchVal} OR ", $searchFields) . " LIKE {$searchVal}";
        }
        if (!empty($pageInfo->filter_cat)) {
            $filters[] = "a.catid = " . $pageInfo->filter_cat;
        }
        if ($this->params->get('displayart', 'all') == 'onlypub') {
            $filters[] = "a.state = 1";
        } else {
            $filters[] = "a.state != -2";
        }
        if (version_compare(JVERSION, '1.6.0', '<')) {
            $filters[] = 'a.`access` <= ' . (int) $my->get('aid');
        } else {
            $groups = implode(',', $my->authorisedLevels());
            $filters[] = 'a.`access` IN (' . $groups . ')';
        }
        if ($this->params->get('frontendaccess') == 'author' and !$app->isAdmin()) {
            $filters[] = "a.created_by = " . intval($my->id);
        }
        $whereQuery = '';
        if (!empty($filters)) {
            $whereQuery = ' WHERE (' . implode(') AND (', $filters) . ')';
        }
        $query = 'SELECT SQL_CALC_FOUND_ROWS a.id,a.created,a.title,a.alias,a.catid,a.sectionid,b.name,b.username,a.created_by FROM ' . acymailing::table('content', false) . ' as a';
        $query .= ' LEFT JOIN `#__users` AS b ON b.id = a.created_by';
        if (!empty($whereQuery)) {
            $query .= $whereQuery;
        }
        if (!empty($pageInfo->filter->order->value)) {
            $query .= ' ORDER BY ' . $pageInfo->filter->order->value . ' ' . $pageInfo->filter->order->dir;
        }
        $db->setQuery($query, $pageInfo->limit->start, $pageInfo->limit->value);
        $rows = $db->loadObjectList();
        if (!empty($pageInfo->search)) {
            $rows = acymailing::search($pageInfo->search, $rows);
        }
        $db->setQuery('SELECT FOUND_ROWS()');
        $pageInfo->elements->total = $db->loadResult();
        $pageInfo->elements->page = count($rows);
        if (version_compare(JVERSION, '1.6.0', '<')) {
            $query = 'SELECT a.id, a.id as catid, a.title as category, b.title as section, b.id as secid from #__categories as a ';
            $query .= 'INNER JOIN #__sections as b on a.section = b.id ORDER BY b.ordering,a.ordering';
            $db->setQuery($query);
            $categories = $db->loadObjectList('id');
            $categoriesValues = array();
            $categoriesValues[] = JHTML::_('select.option', '', JText::_('ACY_ALL'));
            $currentSec = '';
            foreach ($categories as $catid => $oneCategorie) {
                if ($currentSec != $oneCategorie->section) {
                    if (!empty($currentSec)) {
                        $this->values[] = JHTML::_('select.option', '</OPTGROUP>');
                    }
                    $categoriesValues[] = JHTML::_('select.option', '<OPTGROUP>', $oneCategorie->section);
                    $currentSec = $oneCategorie->section;
                }
                $categoriesValues[] = JHTML::_('select.option', $catid, $oneCategorie->category);
            }
        } else {
            $query = "SELECT * from #__categories WHERE `extension` = 'com_content' ORDER BY lft ASC";
            $db->setQuery($query);
            $categories = $db->loadObjectList('id');
            $categoriesValues = array();
            $categoriesValues[] = JHTML::_('select.option', '', JText::_('ACY_ALL'));
            foreach ($categories as $catid => $oneCategorie) {
                $categories[$catid]->title = str_repeat('- - ', $categories[$catid]->level) . $categories[$catid]->title;
                $categoriesValues[] = JHTML::_('select.option', $catid, $categories[$catid]->title);
            }
        }
        jimport('joomla.html.pagination');
        $pagination = new JPagination($pageInfo->elements->total, $pageInfo->limit->start, $pageInfo->limit->value);
        jimport('joomla.html.pane');
        $tabs =& JPane::getInstance('tabs');
        echo $tabs->startPane('joomlacontent_tab');
        echo $tabs->startPanel(JText::_('JOOMLA_CONTENT'), 'joomlacontent_content');
        ?>
		<br style="font-size:1px"/>
		<script language="javascript" type="text/javascript">
		<!--
			var selectedContents = new Array();
			function applyContent(contentid,rowClass){
				if(selectedContents[contentid]){
					window.document.getElementById('content'+contentid).className = rowClass;
					delete selectedContents[contentid];
				}else{
					window.document.getElementById('content'+contentid).className = 'selectedrow';
					selectedContents[contentid] = 'content';
				}
				updateTag();
			}
			function updateTag(){
				var tag = '';
				var otherinfo = '';
				for(var i=0; i < document.adminForm.contenttype.length; i++){
				   if (document.adminForm.contenttype[i].checked){ selectedtype = document.adminForm.contenttype[i].value; otherinfo += document.adminForm.contenttype[i].value; }
				}
				for(var i=0; i < document.adminForm.titlelink.length; i++){
				   if (document.adminForm.titlelink[i].checked){ otherinfo += document.adminForm.titlelink[i].value; }
				}
				if(selectedtype != '|type:title'){
					for(var i=0; i < document.adminForm.author.length; i++){
					   if (document.adminForm.author[i].checked){ otherinfo += document.adminForm.author[i].value; }
					}
					for(var i=0; i < document.adminForm.pict.length; i++){
					   if (document.adminForm.pict[i].checked){ otherinfo += '|pict:'+document.adminForm.pict[i].value; }
					}
				}
				if(window.document.getElementById('jflang')  && window.document.getElementById('jflang').value != ''){
					otherinfo += '|lang:';
					otherinfo += window.document.getElementById('jflang').value;
				}
				for(var i in selectedContents){
					if(selectedContents[i] == 'content'){
						tag = tag + '{joomlacontent:'+i+otherinfo+'}<br/>';
					}
				}
				setTag(tag);
			}
		//-->
		</script>
		<table width="100%" class="adminform">
			<tr>
				<td>
					<?php 
        echo JText::_('DISPLAY');
        ?>
				</td>
				<td colspan="2">
				<?php 
        $contentType = acymailing::get('type.content');
        echo $contentType->display('contenttype', $pageInfo->contenttype);
        ?>
				</td>
				<td>
				<?php 
        $jflanguages = acymailing::get('type.jflanguages');
        $jflanguages->onclick = 'onchange="updateTag();"';
        echo $jflanguages->display('lang', $pageInfo->lang);
        ?>
				</td>
			</tr>
			<tr>
				<td>
				<?php 
        echo JText::_('CLICKABLE_TITLE');
        ?>
				 </td>
				 <td>
				 	<?php 
        $titlelinkType = acymailing::get('type.titlelink');
        echo $titlelinkType->display('titlelink', $pageInfo->titlelink);
        ?>
				</td>
				<td>
				<?php 
        echo JText::_('AUTHOR_NAME');
        ?>
				 </td>
				 <td>
				 	<?php 
        $authorname = acymailing::get('type.authorname');
        echo $authorname->display('author', $pageInfo->author);
        ?>
				</td>
			</tr>
			<tr>
				<td><?php 
        echo JText::_('DISPLAY_PICTURES');
        ?>
</td>
				<td><?php 
        echo JHTML::_('select.radiolist', $picts, 'pict', 'size="1" onclick="updateTag();"', 'value', 'text', $pageInfo->pict);
        ?>
</td>
				<td></td>
				<td></td>
			</tr>
		</table>
		<table>
			<tr>
				<td width="100%">
					<?php 
        echo JText::_('JOOMEXT_FILTER');
        ?>
:
					<input type="text" name="search" id="acymailingsearch" value="<?php 
        echo $pageInfo->search;
        ?>
" class="text_area" onchange="document.adminForm.submit();" />
					<button onclick="this.form.submit();"><?php 
        echo JText::_('JOOMEXT_GO');
        ?>
</button>
					<button onclick="document.getElementById('acymailingsearch').value='';this.form.submit();"><?php 
        echo JText::_('JOOMEXT_RESET');
        ?>
</button>
				</td>
				<td nowrap="nowrap">
					<?php 
        echo JHTML::_('select.genericlist', $categoriesValues, 'filter_cat', 'class="inputbox" size="1" onchange="document.adminForm.submit( );"', 'value', 'text', (int) $pageInfo->filter_cat);
        ?>
				</td>
			</tr>
		</table>
		<table class="adminlist" cellpadding="1" width="100%">
			<thead>
				<tr>
					<th class="title">
						<?php 
        echo JHTML::_('grid.sort', JText::_('FIELD_TITLE'), 'a.title', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
        ?>
					</th>
					<th class="title">
						<?php 
        echo JHTML::_('grid.sort', JText::_('ACY_AUTHOR'), 'b.name', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
        ?>
					</th>
					<th class="title">
						<?php 
        echo JHTML::_('grid.sort', JText::_('ACY_CREATED'), 'a.created', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
        ?>
					</th>
					<th class="title titleid">
						<?php 
        echo JHTML::_('grid.sort', JText::_('ACY_ID'), 'a.id', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
        ?>
					</th>
				</tr>
			</thead>
			<tfoot>
				<tr>
					<td colspan="4">
						<?php 
        echo $pagination->getListFooter();
        ?>
						<?php 
        echo $pagination->getResultsCounter();
        ?>
					</td>
				</tr>
			</tfoot>
			<tbody>
				<?php 
        $k = 0;
        for ($i = 0, $a = count($rows); $i < $a; $i++) {
            $row =& $rows[$i];
            ?>
					<tr id="content<?php 
            echo $row->id;
            ?>
" class="<?php 
            echo "row{$k}";
            ?>
" onclick="applyContent(<?php 
            echo $row->id . ",'row{$k}'";
            ?>
);" style="cursor:pointer;">
						<td>
						<?php 
            $text = '<b>' . JText::_('ALIAS', true) . ': </b>' . $row->alias;
            echo acymailing::tooltip($text, $row->title, '', $row->title);
            ?>
						</td>
						<td>
						<?php 
            if (!empty($row->name)) {
                $text = '<b>' . JText::_('JOOMEXT_NAME') . ' : </b>' . $row->name;
                $text .= '<br/><b>' . JText::_('ACY_USERNAME') . ' : </b>' . $row->username;
                $text .= '<br/><b>' . JText::_('ACY_ID') . ' : </b>' . $row->created_by;
                echo acymailing::tooltip($text, $row->name, '', $row->name);
            }
            ?>
						</td>
						<td align="center">
							<?php 
            echo JHTML::_('date', $row->created, JText::_('DATE_FORMAT_LC4'));
            ?>
						</td>
						<td align="center">
							<?php 
            echo $row->id;
            ?>
						</td>
					</tr>
				<?php 
            $k = 1 - $k;
        }
        ?>
			</tbody>
		</table>
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="filter_order" value="<?php 
        echo $pageInfo->filter->order->value;
        ?>
" />
		<input type="hidden" name="filter_order_Dir" value="<?php 
        echo $pageInfo->filter->order->dir;
        ?>
" />
	<?php 
        echo $tabs->endPanel();
        echo $tabs->startPanel(JText::_('TAG_CATEGORIES'), 'joomlacontent_auto');
        $type = JRequest::getString('type');
        ?>
		<br style="font-size:1px"/>
		<script language="javascript" type="text/javascript">
		<!--
			var selectedCategories = new Array();
		<?php 
        if (version_compare(JVERSION, '1.6.0', '<')) {
            ?>
			function applyAutoContent(secid,catid,rowClass){
				if(selectedCategories[secid] && selectedCategories[secid][catid]){
					window.document.getElementById('content_sec'+secid+'_cat'+catid).className = rowClass;
					delete selectedCategories[secid][catid];
				}else{
					if(!selectedCategories[secid]) selectedCategories[secid] = new Array();
					if(secid == 0){
						for(var isec in selectedCategories){
							for(var icat in selectedCategories[isec]){
								if(selectedCategories[isec][icat] == 'content'){
									window.document.getElementById('content_sec'+isec+'_cat'+icat).className = 'row0';
									delete selectedCategories[isec][icat];
								}
							}
						}
					}else{
						if(selectedCategories[0] && selectedCategories[0][0]){
							window.document.getElementById('content_sec0_cat0').className = 'row0';
							delete selectedCategories[0][0];
						}
						if(catid == 0){
							for(var icat in selectedCategories[secid]){
								if(selectedCategories[secid][icat] == 'content'){
									window.document.getElementById('content_sec'+secid+'_cat'+icat).className = 'row0';
									delete selectedCategories[secid][icat];
								}
							}
						}else{
							if(selectedCategories[secid][0]){
								window.document.getElementById('content_sec'+secid+'_cat0').className = 'row0';
								delete selectedCategories[secid][0];
							}
						}
					}
					window.document.getElementById('content_sec'+secid+'_cat'+catid).className = 'selectedrow';
					selectedCategories[secid][catid] = 'content';
				}
				updateAutoTag();
			}
		<?php 
        } else {
            ?>
			function applyAutoContent(catid,rowClass){
				if(selectedCategories[catid]){
					window.document.getElementById('content_cat'+catid).className = rowClass;
					delete selectedCategories[catid];
				}else{
					window.document.getElementById('content_cat'+catid).className = 'selectedrow';
					selectedCategories[catid] = 'content';
				}
				updateAutoTag();
			}
		<?php 
        }
        ?>
			function updateAutoTag(){
				tag = '{autocontent:';
			<?php 
        if (version_compare(JVERSION, '1.6.0', '<')) {
            ?>
				for(var isec in selectedCategories){
					for(var icat in selectedCategories[isec]){
						if(selectedCategories[isec][icat] == 'content'){
							if(icat != 0){
								tag += 'cat'+icat+'-';
							}else{
								tag += 'sec'+isec+'-';
							}
						}
					}
				}
			<?php 
        } else {
            ?>
				for(var icat in selectedCategories){
					if(selectedCategories[icat] == 'content'){
						tag += icat+'-';
					}
				}
			<?php 
        }
        ?>
				if(document.adminForm.min_article && document.adminForm.min_article.value && document.adminForm.min_article.value!=0){ tag += '|min:'+document.adminForm.min_article.value; }
				if(document.adminForm.max_article.value && document.adminForm.max_article.value!=0){ tag += '|max:'+document.adminForm.max_article.value; }
				if(document.adminForm.contentorder.value){ tag += document.adminForm.contentorder.value; }
				if(document.adminForm.contentfilter && document.adminForm.contentfilter.value){ tag += document.adminForm.contentfilter.value; }
				if(document.adminForm.meta_article && document.adminForm.meta_article.value){ tag += '|meta:'+document.adminForm.meta_article.value; }
				for(var i=0; i < document.adminForm.contenttypeauto.length; i++){
				   if (document.adminForm.contenttypeauto[i].checked){selectedtype = document.adminForm.contenttypeauto[i].value; tag += document.adminForm.contenttypeauto[i].value; }
				}
				for(var i=0; i < document.adminForm.titlelinkauto.length; i++){
				   if (document.adminForm.titlelinkauto[i].checked){ tag += document.adminForm.titlelinkauto[i].value; }
				}
				if(selectedtype != '|type:title'){
					for(var i=0; i < document.adminForm.authorauto.length; i++){
					   if (document.adminForm.authorauto[i].checked){ tag += document.adminForm.authorauto[i].value; }
					}
					for(var i=0; i < document.adminForm.pictauto.length; i++){
					   if (document.adminForm.pictauto[i].checked){ tag += '|pict:'+document.adminForm.pictauto[i].value; }
					}
				}
				if(window.document.getElementById('jflangauto')  && window.document.getElementById('jflangauto').value != ''){
					tag += '|lang:';
					tag += window.document.getElementById('jflangauto').value;
				}
				tag += '}';
				setTag(tag);
			}
		//-->
		</script>
		<table width="100%" class="adminform">
			<tr>
				<td>
					<?php 
        echo JText::_('DISPLAY');
        ?>
				</td>
				<td colspan="2">
				<?php 
        $contentType = acymailing::get('type.content');
        $contentType->onclick = "updateAutoTag();";
        echo $contentType->display('contenttypeauto', '|type:intro');
        ?>
				</td>
				<td>
					<?php 
        $jflanguages = acymailing::get('type.jflanguages');
        $jflanguages->onclick = 'onchange="updateAutoTag();"';
        $jflanguages->id = 'jflangauto';
        echo $jflanguages->display('langauto');
        ?>
				</td>
			</tr>
			<tr>
				<td>
				<?php 
        echo JText::_('CLICKABLE_TITLE');
        ?>
				 </td>
				 <td>
				 	<?php 
        $titlelinkType = acymailing::get('type.titlelink');
        $titlelinkType->onclick = "updateAutoTag();";
        echo $titlelinkType->display('titlelinkauto', '|link');
        ?>
				</td>
				<td>
				<?php 
        echo JText::_('AUTHOR_NAME');
        ?>
				 </td>
				 <td>
				 	<?php 
        $authorname = acymailing::get('type.authorname');
        $authorname->onclick = "updateAutoTag();";
        echo $authorname->display('authorauto', '');
        ?>
				</td>
			</tr>
			<tr>
				<td><?php 
        echo JText::_('DISPLAY_PICTURES');
        ?>
</td>
				<td><?php 
        echo JHTML::_('select.radiolist', $picts, 'pictauto', 'size="1" onclick="updateAutoTag();"', 'value', 'text', "1");
        ?>
</td>
				<td></td>
				<td></td>
			</tr>
			<tr>
				<td>
				<?php 
        echo JText::_('MAX_ARTICLE');
        ?>
				 </td>
				 <td>
				 	<input name="max_article" size="10" value="20" onchange="updateAutoTag();"/>
				</td>
				<td>
				<?php 
        echo JText::_('ACY_ORDER');
        ?>
				 </td>
				 <td>
				 	<?php 
        $ordertype = acymailing::get('type.contentorder');
        $ordertype->onclick = "updateAutoTag();";
        echo $ordertype->display('contentorder', '|order:id');
        ?>
				</td>
			</tr>
			<?php 
        if ($this->params->get('metaselect')) {
            ?>
				<tr>
					<td>
					<?php 
            echo JText::_('META_KEYWORDS');
            ?>
					 </td>
					 <td colspan="3">
					 	<input name="meta_article" size="50" value="" onchange="updateAutoTag();"/>
					</td>
				</tr>
			<?php 
        }
        ?>
			<?php 
        if ($type == 'autonews') {
            ?>
			<tr>
				<td>
				<?php 
            echo JText::_('MIN_ARTICLE');
            ?>
				 </td>
				 <td>
				 <input name="min_article" size="10" value="1" onchange="updateAutoTag();"/>
				</td>
				<td>
				<?php 
            echo JText::_('JOOMEXT_FILTER');
            ?>
				 </td>
				 <td>
				 	<?php 
            $filter = acymailing::get('type.contentfilter');
            $filter->onclick = "updateAutoTag();";
            echo $filter->display('contentfilter', '|filter:created');
            ?>
				</td>
			</tr>
			<?php 
        }
        ?>
		</table>
		<table class="adminlist" cellpadding="1" width="100%">
			<thead>
				<tr>
				<?php 
        if (version_compare(JVERSION, '1.6.0', '<')) {
            ?>
					<th class="title">
						<?php 
            echo JText::_('SECTION');
            ?>
					</th>
				<?php 
        }
        ?>
					<th class="title">
						<?php 
        echo JText::_('TAG_CATEGORIES');
        ?>
					</th>
				</tr>
			</thead>
			<tbody>
				<?php 
        $k = 0;
        if (version_compare(JVERSION, '1.6.0', '<')) {
            ?>
					<tr id="content_sec0_cat0" class="<?php 
            echo "row{$k}";
            ?>
" onclick="applyAutoContent(0,0,'<?php 
            echo "row{$k}";
            ?>
');" style="cursor:pointer;">
						<td style="font-weight: bold;">
						<?php 
            echo JText::_('ACY_ALL');
            ?>
						</td>
						<td style="text-align:center;font-weight: bold;">
						<?php 
            echo JText::_('ACY_ALL');
            ?>
						</td>
					</tr>
					<?php 
        }
        $k = 1 - $k;
        $currentSection = '';
        foreach ($categories as $row) {
            if (version_compare(JVERSION, '1.6.0', '<') and $currentSection != $row->section) {
                ?>
						<tr id="content_sec<?php 
                echo $row->secid;
                ?>
_cat0" class="<?php 
                echo "row{$k}";
                ?>
" onclick="applyAutoContent(<?php 
                echo $row->secid;
                ?>
,0,'<?php 
                echo "row{$k}";
                ?>
');" style="cursor:pointer;">
							<td style="font-weight: bold;">
							<?php 
                echo $row->section;
                ?>
							</td>
							<td style="text-align:center;font-weight: bold;">
							<?php 
                echo JText::_('ALL');
                ?>
							</td>
						</tr>
						<?php 
                $k = 1 - $k;
                $currentSection = $row->section;
            }
            if (version_compare(JVERSION, '1.6.0', '<')) {
                ?>
					<tr id="content_sec<?php 
                echo $row->secid;
                ?>
_cat<?php 
                echo $row->catid;
                ?>
" class="<?php 
                echo "row{$k}";
                ?>
" onclick="applyAutoContent(<?php 
                echo $row->secid;
                ?>
,<?php 
                echo $row->catid;
                ?>
,'<?php 
                echo "row{$k}";
                ?>
');" style="cursor:pointer;">
						<td>
						</td>
						<td>
						<?php 
                echo $row->category;
                ?>
						</td>
					</tr>
				<?php 
            } else {
                ?>
						<tr id="content_cat<?php 
                echo $row->id;
                ?>
" class="<?php 
                echo "row{$k}";
                ?>
" onclick="applyAutoContent(<?php 
                echo $row->id;
                ?>
,'<?php 
                echo "row{$k}";
                ?>
');" style="cursor:pointer;">
						<td>
						<?php 
                echo $row->title;
                ?>
						</td>
					</tr>
					<?php 
            }
            $k = 1 - $k;
        }
        ?>
			</tbody>
		</table>
	<?php 
        echo $tabs->endPanel();
        echo $tabs->endPane();
    }
示例#10
0
 /**
  * ujTag felvételi form
  * @return void
  * &JRequest: limit, limitstart, filterStr, order
  */
 public function ujTag()
 {
     JHTML::_('behavior.modal');
     $total = 0;
     $pagination = null;
     $user = JFactory::getUser();
     $db = JFactory::getDBO();
     if (!$this->temakorokHelper->isAdmin($user) & !$this->temakor_admin) {
         echo '<div class="">Access denied</div>';
         return;
     }
     // alapértelmezett browser status beolvasása sessionból
     $session = JFactory::getSession();
     $brStatusStr = '{"limit":20,"limitstart":0,"order":1,"filterStr":""}';
     $brStatus = JSON_decode($brStatusStr);
     $limitStart = JRequest::getVar('limitstart', $brStatus->limitstart);
     $limit = JRequest::getVar('limit', $brStatus->limit);
     $order = JRequest::getVar('order', $brStatus->order);
     $filterStr = urldecode(JRequest::getVar('filterStr', $brStatus->filterStr));
     JRequest::setVar('limit', $limit);
     JRequest::setVar('limitstart', $limitStart);
     JRequest::setVar('order', $order);
     JRequest::setVar('filterStr', $filterStr);
     // adattábla tartalom elérése és átadása a view -nek
     $items = $this->model->getItems();
     //DBG echo $this->model->getDBO()->getQuery();
     $this->view->set('Items', $items);
     // browser müködéshez linkek definiálása
     $reorderLink = JURI::base() . 'index.php?option=com_' . $this->NAME . '&view=' . $this->NAME . 'list&tas=ujTag' . '&limit=' . JRequest::getVar('limit', '20') . '&limitstart=0' . '&temakor=' . $this->temakor_id . '&filterStr=' . urlencode($filterStr);
     $doFilterLink = JURI::base() . 'index.php?option=com_' . $this->NAME . '&view=' . $this->NAME . 'list&task=ujTag' . '&limit=' . JRequest::getVar('limit', '20') . '&limitstart=0' . '&temakor=' . $this->temakor_id . '&order=' . JRequest::getVar('order', '1');
     if ($this->temakor_id > 0) {
         $itemLink = JURI::base() . 'index.php?option=com_tagok&view=tagok&task=doujtag' . '&limit=' . JRequest::getVar('limit', '20') . '&limitstart=0' . '&filterStr=' . urlencode($filterStr) . '&temakor=' . $this->temakor_id . '&order=' . JRequest::getVar('order', '1');
     }
     $this->view->set('reorderLink', $reorderLink);
     $this->view->set('doFilterLink', $doFilterLink);
     $this->view->set('itemLink', $itemLink);
     // akciók definiálása
     $akciok = array();
     if ($this->temakor_id > 0) {
         $akciok['temakor'] = JURI::base() . 'index.php?option=com_szavazasok&view=szavazasoklist&task=browse' . '&temakor=' . $this->temakor_id;
     } else {
         $akciok['temakorok'] = JURI::base() . 'index.php?option=com_temakorok&view=temakoroklist&task=browse';
     }
     $akciok['sugo'] = JURI::base() . 'index.php?option=com_content&view=article' . '&id=' . JText::_('UJTAG_SUGO') . '&Itemid=435&tmpl=component';
     $this->view->set('Akciok', $akciok);
     $this->view->set('Title', JText::_('UJTAG'));
     $this->view->set('Temakor', $this->temakor);
     //lapozósor definiálása
     jimport('joomla.html.pagination');
     $total = $this->model->getTotal($filterStr);
     $pagination = new JPagination($total, $limitStart, $limit);
     $pagination->setAdditionalUrlParam('order', $order);
     $pagination->setAdditionalUrlParam('filterStr', urlencode($filterStr));
     $pagination->setAdditionalUrlParam('temakor', $this->temakor_id);
     $this->view->set('LapozoSor', $pagination->getListFooter());
     $this->view->setLayout('ujtag');
     $this->view->display();
 }
示例#11
0
 /**
  * képviselő eddigi szavazatainak megjelenítése
  * (böngésző képernyő)   
  * @return void
  * @JRequest integer temakor
  * @JRequest integer id  - kepviselo_id
  * @JRequest integer limitstart
  * @JRequest integer limit
  * @JRequest string filterStr
  * @JRequest integer order                     
  */
 public function szavazatok()
 {
     JHTML::_('behavior.modal');
     $total = 0;
     $pagination = null;
     $user = JFactory::getUser();
     $db = JFactory::getDBO();
     $document = JFactory::getDocument();
     $viewType = $document->getType();
     $view =& $this->getView('szavazatoklist', $viewType);
     $model =& $this->getModel('szavazatoklist');
     // alapértelmezett browser status beolvasása sessionból
     $session = JFactory::getSession();
     $brStatusStr = $session->get('szavazasoklist_status');
     if ($brStatusStr == '') {
         $brStatusStr = '{"limit":20,"limitstart":0,"order":1,"filterStr":""}';
     }
     $brStatus = JSON_decode($brStatus);
     $limitStart = JRequest::getVar('limitstart', $brStatus->limitstart);
     $limit = JRequest::getVar('limit', $brStatus->limit);
     $order = JRequest::getVar('order', $brStatus->order);
     $filterStr = urldecode(JRequest::getVar('filterStr', $brStatus->filterStr));
     // browser status save to session and JRequest
     $brStatus->limit = $limit;
     $brStatus->limitStart = $limitStart;
     $brStatus->order = $order;
     $brStatus->filterStr = $filterStr;
     // ebben az esetben inkább ne jegyezze meg....
     //$session->set('szavazatoklist_status', JSON_encode($brStatus));
     JRequest::setVar('limit', $limit);
     JRequest::setVar('limitstart', $limitStart);
     JRequest::setVar('order', $order);
     JRequest::setVar('filterStr', $filterStr);
     // adattábla tartalom elérése és átadása a view -nek
     $items = $model->getItems();
     //DBG echo '<p>'.$model->getDBO()->getQuery().'</p>';
     // items-temakor-user hozzáférés ellenörzés
     if ($this->temakorokHelper->isAdmin($user) == false) {
         for ($i = 0; $i < count($items); $i++) {
             $item = $items[$i];
             if ($item->lathatosag == 1 & $user->id == 0 | $item->lathatosag == 2 & $this->temakorokHelper->userTag($item->id, $user) == false) {
                 // letiltott
                 $items[$i]->szmegenevezes = '***';
                 $items[$i]->amegenevezes = '***';
                 $items[$i]->pozicio = '**';
             }
         }
     }
     $view->set('Items', $items);
     // témakör beolvasása
     $db->setQuery('select * from #__temakorok where id="' . JRequest::getVar('temakor', 0) . '"');
     $view->Temakor = $db->loadObject();
     if ($view->Temakor == false) {
         $view->Temakor = new stdclass();
         $view->Temakor->megnevezes = JText::_('ALTALANOSKEPVISELO');
         $view->Temakor->id = 0;
     } else {
         $view->Temakor->megnevezes .= ' ' . JText::_('KEPVISELO');
     }
     // képviselő adatok beolvasása
     $view->set('Kuser', JFactory::getUser(JRequest::getVar('id', 0)));
     // browser müködéshez linkek definiálása
     $reorderLink = JURI::base() . 'index.php?option=com_kepviselok&view=kepviselok&task=szavazatok' . '&limit=' . JRequest::getVar('limit', '20') . '&limitstart=0' . '&filterStr=' . urlencode($filterStr) . '&temakor=' . JRequest::getVar('temakor') . '&id=' . JRequest::getVar('id', 0);
     $doFilterLink = JURI::base() . 'index.php?option=com_kepviselok&view=kepviselok&task=add' . '&limit=' . JRequest::getVar('limit', '20') . '&limitstart=0' . '&order=' . JRequest::getVar('order', '1') . '&temakor=' . JRequest::getVar('temakor') . '&id=' . JRequest::getVar('id', 0);
     $view->set('reorderLink', $reorderLink);
     $view->set('doFilterLink', $doFilterLink);
     // akciók definiálása
     $akciok = array();
     $akciok['back'] = JURI::base() . 'index.php?option=com_kepviselok&view=kepviselok&task=show' . '&temakor=' . JRequest::getVar('temakor') . '&id=' . JRequest::getVar('id', 0);
     $akciok['sugo'] = JURI::base() . 'index.php?option=com_content&view=article' . '&id=' . JText::_('SZAVAZATOKSUGO') . '&Itemid=435&tmpl=component';
     $view->set('Akciok', $akciok);
     //lapozósor definiálása
     jimport('joomla.html.pagination');
     $total = $model->getTotal($filterStr);
     $pagination = new JPagination($total, $limitStart, $limit);
     $pagination->setAdditionalUrlParam('order', $order);
     $pagination->setAdditionalUrlParam('filterStr', urlencode($filterStr));
     $view->set('LapozoSor', $pagination->getListFooter());
     // display
     $view->setLayout('browse');
     $view->display();
 }
示例#12
0
    /**
     * browse task
     * @return void
     * @request integer limit
     * @request integer limitstart
     * @request integer order
     * @request integer filterStr
     * @request integer temakor
     * @request integer szavazas      
     * @session object 'temakoroklist_status'   
     */
    public function browse()
    {
        jimport('hs.user.user');
        JHTML::_('behavior.modal');
        $total = 0;
        $pagination = null;
        $user = JFactory::getUser();
        $db = JFactory::getDBO();
        // hozzáférés ellenörzés
        if ($this->temakorokHelper->isAdmin($user) == false) {
            if ($this->temakor->lathatosag == 1 & $user->id == 0 | $this->temakor->lathatosag == 2 & $this->temakorokHelper->userTag($this->temakor->id, $user) == false) {
                // Redirect to login
                $this->temakorokHelper->getLogin(JText::_('TEMAKOR_NEKED_NEM_ELERHETO'));
            }
        }
        // alapértelmezett browser status beolvasása sessionból
        $session = JFactory::getSession();
        $brStatusStr = $session->get($this->NAME . 'list_status');
        if ($brStatusStr == '') {
            $brStatusStr = '{"limit":20,"limitStart":0,"order":1,"filterStr":"","temakor_id":0,"szavazas_id":0}';
        }
        $brStatus = JSON_decode($brStatusStr);
        $limitStart = JRequest::getVar('limitstart', $brStatus->limitstart);
        $limit = JRequest::getVar('limit', $brStatus->limit);
        $order = JRequest::getVar('order', $brStatus->order);
        $filterStr = urldecode(JRequest::getVar('filterStr', $brStatus->filterStr));
        if ($this->temakor_id == '') {
            $this->temakor_id = $brStatus->temakor_id;
        }
        if ($this->szavazas_id == '') {
            $this->szavazas_id = $brStatus->szavazas_id;
        }
        // browser status save to session and JRequest
        $brStatus->limit = $limit;
        $brStatus->limitStart = $limitStart;
        $brStatus->order = $order;
        $brStatus->filterStr = $filterStr;
        $brStatus->temakor_id = $this->temakor_id;
        $brStatus->szavazas_id = $this->szavazas_id;
        $session->set($this->NAME . 'list_status', JSON_encode($brStatus));
        JRequest::setVar('limit', $limit);
        JRequest::setVar('limitstart', $limitStart);
        JRequest::setVar('order', $order);
        JRequest::setVar('filterStr', $filterStr);
        JRequest::setVar('temakor', $this->temakor_id);
        JRequest::setVar('szavazas', $this->szavazas_id);
        // adattábla tartalom elérése és átadása a view -nek
        $items = $this->model->getItems();
        $db->setQuery('select sum(igen) igen, sum(nem) nem
	from #__szavazasok_in
	where szavazas_id = ' . $db->quote($this->szavazas_id));
        $igenNem = $db->loadObject();
        // user szavazott?
        $db->setQuery('select * from #__szavazok where szavazas_id="' . $this->szavazas->id . '" and user_id="' . $user->id . '"');
        $szavazo = $db->loadObject();
        //DBG echo $this->model->getDBO()->getQuery();
        if ($this->model->getError() != '') {
            $this->view->Msg = $this->model->getError();
        }
        $this->view->set('Items', $items);
        $this->view->set('igen', $igenNem->igen);
        $this->view->set('nem', $igenNem->nem);
        $this->view->set('Temakor', $this->temakor);
        $this->view->set('Szulok', $this->temakorokHelper->getSzulok());
        $this->view->set('Szavazas', $this->szavazas);
        $this->view->set('Szavazo', $szavazo);
        $this->view->set('Title', JText::_('ALTERNATIVAK'));
        $this->view->set('TemakorGroupId', $this->temakorokHelper->getTemakorGroupId($this->temakor->id));
        //+ 2014.09.10 Az alternativa név csak akkor link ha jogosult módosítani
        $this->view->set('isAdmin', $this->temakorokHelper->isAdmin($user));
        $this->view->set('temakor_admin', $this->temakor_admin);
        $this->view->set('user', $user);
        //- 2014.09.10 Az alternativa név csak akkor link ha jogosult módosítani
        // hányan szavaztak már?
        $db->setQuery('select count(distinct szavazo_id) cc from #__szavazatok where szavazas_id="' . $this->szavazas->id . '"');
        $res = $db->loadObject();
        $szavaztak = $res->cc;
        $this->view->set('szavaztak', $szavaztak);
        // browser müködéshez linkek definiálása
        if ($this->szavazas->vita1 == 1) {
            $itemLink = JURI::base() . 'index.php?option=com_alternativak&view=alternativak' . '&task=edit' . '&limit=' . JRequest::getVar('limit', '20') . '&limitstart=0' . '&filterStr=' . urlencode($filterStr) . '&order=' . JRequest::getVar('order', '1') . '&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
        } else {
            $itemLink = '';
        }
        $backLink = JURI::base() . 'index.php?option=com_szavazasok&view=szavazasoklist' . '&temakor=' . $this->temakor_id . '&task=browse';
        $homeLink = JURI::base() . 'index.php?option=com_temakorok&view=temakoroklist' . '&task=browse';
        $this->view->set('itemLink', $itemLink);
        $this->view->set('backLink', $backLink);
        $this->view->set('homeLink', $homeLink);
        // van ált. képviselője?
        $altKepviseloje = 0;
        $db->setQuery('select k.kepviselo_id, u.name 
    from #__kepviselok k, #__users u
    where k.kepviselo_id = u.id and
            k.user_id = "' . $user->id . '" and k.temakor_id=0 and k.szavazas_id = 0 and
            k.lejarat >= "' . date('Y-m-d') . '"');
        $res = $db->loadObject();
        if ($db->getErrorNum() > 0) {
            $db->stderr();
        }
        if ($res) {
            $altKepviseloje = $res->kepviselo_id;
        }
        // van témakör képviselője?
        $kepviseloje = 0;
        $db->setQuery('select k.kepviselo_id, u.name 
    from #__kepviselok k, #__users u
    where k.kepviselo_id = u.id and
            k.user_id = "' . $user->id . '" and k.temakor_id=' . $this->temakor_id . ' and k.szavazas_id = 0 and
            k.lejarat >= "' . date('Y-m-d') . '"');
        $res = $db->loadObject();
        if ($db->getErrorNum() > 0) {
            $db->stderr();
        }
        if ($res) {
            $kepviseloje = $res->kepviselo_id;
        }
        // Ő maga képviselő jelölt?
        $kepviseloJelolt = false;
        $db->setQuery('select user_id 
    from #__kepviselojeloltek
    where  user_id = "' . $user->id . '"');
        $res = $db->loadObject();
        if ($db->getErrorNum() > 0) {
            $db->stderr();
        }
        if ($res) {
            $kepviseloJelolt = true;
        }
        // kik az alternativa felvivők?
        $alternativa_felvivo = $this->alternativa_felvivo($user);
        // akciók definiálása
        $akciok = array();
        if ($this->temakorokHelper->isAdmin($user) | $szavazas_felvivo == 10 & ($this->szavazas->szavazok = 1) & $user->id > 0 | $szavazas_felvivo == 10 & $this->temakorokHelper->userTag($this->temakor_id, $user) | $this->temakor_admin | $this->alternativa_felvivo($user)) {
            if ($this->szavazas->vita1 == 1) {
                $akciok['ujAlternativa'] = JURI::base() . 'index.php?option=com_' . $this->NAME . '&view=' . $this->NAME . '&task=add' . '&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id . '&limit=' . JRequest::getVar('limit', 20) . '&limitstart=' . JRequest::getVar('limitstart', 0) . '&order=' . JRequest::getVar('order', 1) . '&filterStr=' . JRequest::getVar('filterStr', '');
            }
        }
        if ($this->temakorokHelper->isAdmin($user) | $this->temakor_admin | $this->szavazas->letrehozo == $user->id) {
            $akciok['szavazasedit'] = JURI::base() . 'index.php?option=com_szavazasok&view=szavazasok&task=edit' . '&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
        }
        if ($this->temakorokHelper->isAdmin($user) | $this->temakor_admin | $this->szavazas->letrehozo == $user->id) {
            $akciok['szavazastorles'] = JURI::base() . 'index.php?option=com_szavazasok&view=szavazasok&task=deleteform' . '&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
        }
        if ($this->temakorokHelper->isAdmin($user) | $this->temakor_admin | $this->temakorIndito($this->temakor_id, $user)) {
            $akciok['temakoredit'] = JURI::base() . 'index.php?option=com_temakorok&view=temakorok&task=edit' . '&temakor=' . $this->temakor_id;
        }
        if ($this->temakorokHelper->isAdmin($user) | $this->temakor_admin | $this->temakorIndito($this->temakor_id, $user)) {
            $akciok['temakortorles'] = JURI::base() . 'index.php?option=com_temakorok&view=temakorok&task=deleteform' . '&temakor=' . $this->temakor_id;
        }
        if ($this->temakorokHelper->isAdmin($user) | $this->temakor_admin | $this->temakorIndito($this->temakor_id, $user)) {
            if ($this->szavazas->vita1 == 1) {
                $akciok['alternativaedit'] = JURI::base() . 'index.php?option=com_alternativak&view=alternativak&task=edit' . '&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
            }
        }
        if ($this->temakorokHelper->isAdmin($user) | $this->temakor_admin | $this->temakorIndito($this->temakor_id, $user)) {
            if ($this->szavazas->vita1 == 1) {
                $akciok['alternativatorles'] = JURI::base() . 'index.php?option=com_alternativak&view=alternativak&task=deleteform' . '&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
            }
        }
        if ($this->szavazas->szavazas == 1 & $user->id > 0) {
            // a szavazás folyamatban van és bejelentkezett user
            $db = JFactory::getDBO();
            $db->setQuery('select id from #__szavazatok
      where szavazas_id="' . $this->szavazas_id . '" and
      user_id="' . $user->id . '"');
            $res = $db->loadObjectList();
            if (count($res) == 0) {
                // ez a user még nem szavazott
                if ($this->szavazas->szavazok == 1 | $this->szavazas->szavazok == 2 & $this->temakorokHelper->userTag($this->temakor_id, $user, false) | $this->szavazas->szavazok == 3 & $this->temakorokHelper->userTag($this->temakor_id, $user, true)) {
                    $akciok['szavazok'] = JURI::base() . 'index.php?option=com_szavazasok&view=szavazasok&task=szavazoform&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
                }
            } else {
                $akciok['szavaztal'] = 'Y';
                if ($this->szavazas->titkos == 0) {
                    $akciok['szavazatTorles'] = JURI::base() . 'index.php?option=com_alternativak&&task=szavazattorles&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
                }
            }
        }
        // if ($this->szavazas->lezart == 1) {
        $akciok['eredmeny'] = JURI::base() . 'index.php?option=com_szavazasok&view=szavazasok&task=eredmeny&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
        // }
        if ($this->szavazas->szavazas == 1 & $user->id > 0) {
            $akciok['emailszavazas'] = JURI::base() . 'index.php?option=com_szavazasok&view=szavazasok&task=meghivo&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
        }
        $akciok['copy'] = JURI::base() . 'index.php?option=com_alternativak&view=alternativaklist&task=copy' . '&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
        $akciok['tagok'] = JURI::base() . 'index.php?option=com_tagok&temakor=' . $this->temakor_id;
        $akciok['sugo'] = JURI::base() . 'index.php?option=com_content&view=article' . '&id=' . JText::_(strtoupper($this->NAME) . 'LIST_SUGO') . '&Itemid=435&tmpl=component';
        $akciok['deleteSzavazas'] = JURI::base() . 'index.php?option=com_szavazasok&view=szavazasok&task=deleteform' . '&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
        $this->view->set('Akciok', $akciok);
        // globális képviselő/képviselő jelölt gombok definiálása
        $altKepviselo = array();
        $altKepviselo['kepviselojeLink'] = '';
        $kepviselo = array();
        $kepviselo['kepviselojeLink'] = '';
        $kepviselo['kepviseloJeloltLink'] = '';
        $kepviselo['kepviselotValasztLink'] = '';
        $kepviselo['ujJeloltLink'] = '';
        if ($user->id > 0) {
            if ($altKepviseloje > 0) {
                $kepviseloUser = JFactory::getUser($altKepviseloje);
                if ($kepviseloUser) {
                    $userEx = HsUser::getInstance($altKepviseloje);
                    $altKepviselo['kepviselojeLink'] = JURI::base() . 'index.php?option=com_kepviselok&task=show&id=' . $altKepviseloje;
                    if (isset($userEx->image)) {
                        $altKepviselo['image'] = $userEx->get('image');
                    } else {
                        $altKepviselo['image'] = '<img src="components/com_hs_users/asset/images/noimage.png" width="50" height="50" />';
                    }
                    $altKepviselo['nev'] = $kepviseloUser->name;
                }
            }
            if ($kepviseloje > 0) {
                $kepviseloUser = JFactory::getUser($kepviseloje);
                if ($kepviseloUser) {
                    $userEx = HsUser::getInstance($kepviseloje);
                    $kepviselo['kepviselojeLink'] = JURI::base() . 'index.php?option=com_kepviselok&task=show&id=' . $kepviseloje;
                    if (isset($userEx->image)) {
                        $kepviselo['image'] = $userEx->get('image');
                    } else {
                        $kepviselo['image'] = '<img src="components/com_hs_users/asset/images/noimage.png" width="50" height="50" />';
                    }
                    $kepviselo['nev'] = $kepviseloUser->name;
                }
            } else {
                if ($kepviseloJelolt) {
                    $kepviselo['kepviseloJeloltLink'] = JURI::base() . 'index.php?option=com_kepviselo&task=edit&id=' . $user->id;
                } else {
                    $kepviselo['kepviselotValasztLink'] = JURI::base() . 'index.php?option=com_kepviselok&task=find&temekor=' . $this->temakor_id . '&szavazas=0';
                    $kepviselo['ujJeloltLink'] = JURI::base() . 'index.php?option=com_kepviselojeloltek&task=add&temekor=' . $this->temakor_id . '&szavazas=0&id=' . $user->id;
                }
            }
        }
        $this->view->set('Kepviselo', $kepviselo);
        $this->view->set('AltKepviselo', $altKepviselo);
        //lapozósor definiálása
        jimport('joomla.html.pagination');
        $total = $this->model->getTotal($filterStr);
        $pagination = new JPagination($total, $limitStart, $limit);
        $pagination->setAdditionalUrlParam('order', $order);
        $pagination->setAdditionalUrlParam('filterStr', urlencode($filterStr));
        $this->view->set('LapozoSor', $pagination->getListFooter());
        // kacsolodó cikk id-jének elérése és átadása a viewer-nek
        $db->setQuery('SELECT id from #__content WHERE alias="sz' . $this->szavazas_id . '"');
        $res = $db->loadObject();
        if ($res) {
            $this->view->set('CommentId', $res->id);
        } else {
            $this->view->set('CommentId', 0);
        }
        $this->view->display();
    }
	public function listRecords()
	{
                JToolBarHelper::title('<img src="'. JURI::root() . 'administrator/components/com_breezingforms/libraries/jquery/themes/easymode/i/logo-breezingforms.png'.'" align="top"/>');
		JToolBarHelper::custom('exportPdf',    'ff_download',             'ff_download_f2',             BFText::_('COM_BREEZINGFORMS_PDF'),    false);
		JToolBarHelper::custom('exportCsv',    'ff_download',             'ff_download_f2',             BFText::_('COM_BREEZINGFORMS_CSV'),    false);
		JToolBarHelper::custom('exportXml',    'ff_download',             'ff_download_f2',             BFText::_('COM_BREEZINGFORMS_XML'),    false);
		JToolBarHelper::custom('remove',    'delete.png',       'delete_f2.png',    BFText::_('COM_BREEZINGFORMS_TOOLBAR_DELETE'),    false);
		JToolBarHelper::custom('all',    'ff_switch',             'ff_switch_f2',             BFText::_('COM_BREEZINGFORMS_ALL'),    false);
		JToolBarHelper::custom('viewed',    'ff_switch',             'ff_switch_f2',             BFText::_('COM_BREEZINGFORMS_TOOLBAR_VIEWED'),    false);
		JToolBarHelper::custom('exported',  'ff_switch',             'ff_switch_f2',             BFText::_('COM_BREEZINGFORMS_TOOLBAR_EXPORTED'),  false);
		JToolBarHelper::custom('archived',  'ff_switch',             'ff_switch_f2',             BFText::_('COM_BREEZINGFORMS_TOOLBAR_ARCHIVED'),  false);

		JFactory::getDocument()->addStyleDeclaration(
			'

			.icon-32-ff_switch {
				background-image:url(components/com_breezingforms/images/icons/switch.png);
			}

			.icon-32-ff_switch_f2 {
				background-image:url(components/com_breezingforms/images/icons/switch_f2.png);
			}

			.icon-32-ff_download {
				background-image:url(components/com_breezingforms/images/icons/download.png);
			}

			.icon-32-ff_download_f2 {
				background-image:url(components/com_breezingforms/images/icons/download_f2.png);
			}

			'
		);

		//print_r($_REQUEST);
		$ids = JRequest::getVar('ids', array());
		$offset = JRequest::getInt('limitstart', 0);
		$limit  = JRequest::getInt('mylimit', 20);

		if(JRequest::getVar('task','') == 'all')
		{
			JFactory::getSession()->set('bfStatus', '');
		}
		else if(JRequest::getVar('task','')=='exported')
		{
			JFactory::getSession()->set('bfStatus', 'exported');
		}
		else if(JRequest::getVar('task','')=='archived')
		{
			JFactory::getSession()->set('bfStatus', 'archived');
		}
		else if(JRequest::getVar('task','')=='viewed')
		{
			JFactory::getSession()->set('bfStatus', 'viewed');
		}
		else if(JRequest::getVar('task','')=='remove')
		{
			$size = count($ids);
			for($i = 0; $i < $size; $i++)
			{
				$this->db->setQuery("Delete From #__facileforms_records Where id = " . $this->db->Quote($ids[$i]));
				$this->db->query();
				$this->db->setQuery("Delete From #__facileforms_subrecords Where record = " . $this->db->Quote($ids[$i]));
				$this->db->query();
				//echo $this->db->getQuery() . '<br/>';
			}
		}
		else if(JRequest::getVar('task','')=='save')
		{
			$id = JRequest::getInt('record_id', 0);
			$updates = JRequest::getVar('update', array());
			foreach($updates As $update)
			{
				$this->db->setQuery("Update #__facileforms_subrecords Set value = ".$this->db->Quote(JRequest::getVar('ff_nm_'.$update,''))." Where name = ".$this->db->Quote($update)." And record = " . $id);
				$this->db->query();
			}
		}
		else if(JRequest::getVar('task','')=='exportXml' && JRequest::getInt('exportt',0) == 1)
		{
			$this->expxml($ids);
		}
		else if(JRequest::getVar('task','')=='exportCsv' && JRequest::getInt('exportt',0) == 1)
		{
			$this->expcsv($ids);
		}
		else if(JRequest::getVar('task','')=='exportPdf' && JRequest::getInt('exportt',0) == 1)
		{
			$this->exppdf($ids);
		}

		if(JRequest::getInt('status_update',0) == 1)
		{
			$offset = 0;
			$limit = 20;
			JRequest::setVar('limitstart', 0);
			JRequest::setVar('mylimit', 20);
		}

		if(JRequest::getInt('id', 0) != '' && JRequest::getInt('viewed', -1) != -1)
		{
			$value = 1;
			if(JRequest::getInt('viewed', -1) == 1)
			{
				$value = 0;
			}
			$this->db->setQuery("Update #__facileforms_records Set viewed = ".$value." Where id = " . JRequest::getInt('id', 0));
			$this->db->query();
		}

		if(JRequest::getInt('id', 0) != '' && JRequest::getInt('exported', -1) != -1)
		{
			$value = 1;
			if(JRequest::getInt('exported', -1) == 1)
			{
				$value = 0;
			}
			$this->db->setQuery("Update #__facileforms_records Set exported = ".$value." Where id = " . JRequest::getInt('id', 0));
			$this->db->query();
		}

		if(JRequest::getInt('id', 0) != '' && JRequest::getInt('archived', -1) != -1)
		{
			$value = 1;
			if(JRequest::getInt('archived', -1) == 1)
			{
				$value = 0;
			}
			$this->db->setQuery("Update #__facileforms_records Set archived = ".$value." Where id = " . JRequest::getInt('id', 0));
			$this->db->query();
		}

		if(JRequest::getInt('status_update',0) == 1 && JRequest::getVar('write_status','') != '')
		{
			$in = '';

			if(is_array($ids) && count($ids) != 0)
			{
				$status = '';
				if(JFactory::getSession()->get('bfStatus', '') == 'exported')
				{
					$status = "exported = ".(JRequest::getVar('write_status','') == 'set' ? 1 : 0);
				}
				else
				if(JFactory::getSession()->get('bfStatus', '') == 'archived')
				{
					$status = "archived = ".(JRequest::getVar('write_status','') == 'set' ? 1 : 0);
				}
				else
				if(JFactory::getSession()->get('bfStatus', '') == 'viewed')
				{
					$status = "viewed = ".(JRequest::getVar('write_status','') == 'set' ? 1 : 0);
				}

				if($status != '' )
				{
					$size = count($ids);
					for($i = 0; $i < $size; $i++)
					{
						$this->db->setQuery("Update #__facileforms_records Set $status Where id = " . $this->db->Quote($ids[$i]));
						$this->db->query();
						//echo $this->db->getQuery() . '<br/>';
					}
				}
			}
		}

		$ands = '';
		$subs = '';

		if(JRequest::getVar('search','') != '')
		{
			//echo JRequest::getVar('txtsearch','false');
			if(JRequest::getVar('txtsearch','false')=='true')
			{
				$subs .= ', #__facileforms_subrecords As subrecord';
				$ands .= 'subrecord.value Like ' . $this->db->Quote('%'.JRequest::getVar('search','').'%') . ' And record.id = subrecord.record And ';
			}

			$headerSearch = '';
			if(is_numeric(JRequest::getVar('search','')))
			{
				$headerSearch .= 'record.id = ' . intval(JRequest::getVar('search','')) . ' Or ';
			}

			$ex = explode('-', JRequest::getVar('search',''));
			//print_r($ex);
			if(count($ex) == 3 && checkdate($ex[1], $ex[2], $ex[0]))
			{
				$headerSearch .= "record.submitted Between '" . $ex[0] . '-' . $ex[1] . '-' . $ex[2] . " 00:00:00' And '" . $ex[0] . '-' . $ex[1] . '-' . $ex[2] . " 23:59:59' Or ";
				$headerSearch .= "record.paypal_payment_date Between '" . $ex[0] . '-' . $ex[1] . '-' . $ex[2] . " 00:00:00' And '" . $ex[0] . '-' . $ex[1] . '-' . $ex[2] . " 23:59:59' Or ";
			}

			if(is_ip(JRequest::getVar('search','')))
			{
				$headerSearch .= 'record.ip = ' . $this->db->Quote(JRequest::getVar('search','')) . ' Or ';
			}

			if(substr(trim(JRequest::getVar('search','')), 0,4) == 'tx: ')
			{
				$text = trim(JRequest::getVar('search',''));
				$text = substr($text, 3,strlen($text));
				$headerSearch .= 'record.paypal_tx_id Like ' . $this->db->Quote('%'.$text) . ' Or ';
			}

			if($headerSearch == '' && JRequest::getVar('txtsearch','false')!='true')
			{
				$headerSearch .= 'record.`name` Like ' . $this->db->Quote('%'.trim(JRequest::getVar('search','')).'%') . ' Or ';
			}

			if($headerSearch != '')
			{
				$headerSearch = substr($headerSearch,0,strlen($headerSearch)-4);
				$ands .= "(".$headerSearch.") And ";
			}
		}

		if(JRequest::getInt('form',0) != 0)
		{
			$ands .= 'record.form = ' . $this->db->Quote(JRequest::getInt('form',0)) . ' And ';
		}

		if(JFactory::getSession()->get('bfStatus', '') == 'exported')
		{
			$ands .= "record.exported = 1 And";
		}
		else
		if(JFactory::getSession()->get('bfStatus', '') == 'archived')
		{
			$ands .= "record.archived = 1 And";
		}
		else
		if(JFactory::getSession()->get('bfStatus', '') == 'viewed')
		{
			$ands .= "record.viewed = 1 And";
		}

		if($ands != '')
		{
			$ands = 'Where ' . substr($ands,0,strlen($ands)-4);
		}

		$limiter = " Limit $offset, $limit";
		if($limit == 0)
		{
			$limiter = '';
		}

		$this->db->setQuery("Select Distinct SQL_CALC_FOUND_ROWS record.* From #__facileforms_records As record $subs $ands Order By record.".JRequest::getWord('orderBy','submitted')." ".(JRequest::getWord('order','DESC') == 'DESC' ? 'ASC' : 'DESC').$limiter);
		$rows = $this->db->loadObjectList();
                
		//echo $this->db->getQuery();
		$this->db->setQuery("SELECT FOUND_ROWS();");
		$foundRows = $this->db->loadResult();
                jimport('joomla.html.pagination');
		$pagination = new JPagination($foundRows, $offset, $limit);

		$this->db->setQuery("Select Distinct form As id, `name`, title From #__facileforms_records Order By title");
		$forms = $this->db->loadObjectList();
		$size = count($forms);
		$formsArray = array();
		for($i = 0;$i < $size;$i++)
		{
			if(!isset($formsArray['_'.$forms[$i]->id])){
				$formsArray['_'.$forms[$i]->id] = $forms[$i];
			}
		}

                $forms = $formsArray;
                ?>
<script type="text/javascript">
var bf_submitbutton = function(pressbutton)
			{
				var form = document.adminForm;
				switch (pressbutton) {
					case 'remove':
					case 'exportCsv':
					case 'exportXls':
					case 'exportPdf':
					case 'exportXml':
						if (form.boxchecked.value==0) {
							alert("<?php echo BFText::_('COM_BREEZINGFORMS_RECORDS_PLSSELECTRECS'); ?>");
							return;
						} // if
						form.exportt.value = 1;
						break;
					case 'viewed':
					case 'exported':
					case 'archived':
						var writeStatus = false;
						for(var i = 0; i < form.write_status.length; i++)
						{
							if(form.write_status[i].checked && (form.write_status[i].value == 'set' || form.write_status[i].value == 'unset'))
							{
								writeStatus = true;
								break;
							}
						}
						if (writeStatus && form.boxchecked.value==0) {
							alert("<?php echo BFText::_('COM_BREEZINGFORMS_RECORDS_PLSSELECTRECS'); ?>");
							return;
						} // if
						form.status_update.value = 1;
						break;
					default:
						break;
				} // switch
				switch (pressbutton) {
					case 'remove':
						if (!confirm("<?php echo BFText::_('COM_BREEZINGFORMS_RECORDS_ASKDELETE'); ?>")) return;
						break;
					default:
						break;
				} // switch
				submitform(pressbutton);
				form.exportt.value = 0;
}; // submitbutton

if(typeof Joomla != "undefined"){
    Joomla.submitbutton = bf_submitbutton;
}else{
    submitbutton = bf_submitbutton;
}

function bf_listItemTask( id, task )
{
	var f = document.adminForm;
	cb = eval( 'f.' + id );
	if (cb) {
		for (i = 0; true; i++) {
			cbx = eval('f.cb'+i);
			if (!cbx) break;
				cbx.checked = false;
			} // for
			cb.checked = true;
			f.boxchecked.value = 1;
			submitbutton(task);
		}
	return false;
} // listItemTask
</script>

<form action="index.php" method="post" name="adminForm">
<div id="editcell">

    <table class="adminlist">
    <thead>
    	<tr>
    		<td valign="top" colspan="1000">
    			<table class="adminlist" width="100%">
    				<thead>
	    			<tr>
	    				<td>
			    			<?php echo BFText::_('COM_BREEZINGFORMS_FILTER'); ?>:
			    			<input type="text" name="search" value="<?php echo htmlentities(JRequest::getVar('search',''),ENT_QUOTES, 'UTF-8'); ?>" onchange="form.status_update.value = 1;document.adminForm.submit()"/>
			    			<?php echo BFText::_('COM_BREEZINGFORMS_TEXT'); ?>: <input type="checkbox" name="txtsearch" onclick="form.status_update.value = 1;document.adminForm.submit()" value="true"<?php echo JRequest::getWord('txtsearch','false') == 'true' ? ' checked="checked"' : ''; ?>/>
			    			<select name="form" onchange="form.status_update.value = 1;document.adminForm.submit()">
			    				<option value=""><?php echo BFText::_('COM_BREEZINGFORMS_ALL'); ?></option>
			    				<?php
								foreach($forms As $form)
								{
									if(trim($form->name) != '')
									{
										echo '<option value="'.$form->id.'"'.(JRequest::getInt('form',0) == $form->id ? ' selected="selected"' : '').'>'.htmlentities($form->title, ENT_QUOTES, 'UTF-8').' ('.htmlentities($form->name, ENT_QUOTES, 'UTF-8').')</option>'."\n";
									}
								}
			    				?>
			    			</select>
						</td>
						<td align="right" valign="top">
			    			<?php echo BFText::_('COM_BREEZINGFORMS_WRITE_STATUS'); ?>: <input type="radio" name="write_status" value=""<?php echo JRequest::getVar('write_status','') == '' ? ' checked="checked"' : ''; ?>/>  <?php echo BFText::_('COM_BREEZINGFORMS_NONE'); ?> <input type="radio" name="write_status" value="unset"<?php echo JRequest::getVar('write_status','') == 'unset' ? ' checked="checked"' : ''; ?>/> <?php echo BFText::_('COM_BREEZINGFORMS_UNSET'); ?> <input type="radio" name="write_status" value="set"<?php echo JRequest::getVar('write_status','') == 'set' ? ' checked="checked"' : ''; ?>/> <?php echo BFText::_('COM_BREEZINGFORMS_SET'); ?>
			    		</td>
					</tr>
					</thead>
				</table>
    		</td>
    	</tr>
        <tr>
        	<th nowrap align="center"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($rows); ?>);" /></th>
            <th>
                <a href="index.php?option=com_breezingforms&amp;act=recordmanagement&amp;txtsearch=<?php echo JRequest::getWord('txtsearch','false'); ?>&amp;search=<?php echo htmlentities(JRequest::getVar('search',''), ENT_QUOTES, 'UTF-8'); ?>&amp;form=<?php echo htmlentities(JRequest::getVar('form',''), ENT_QUOTES, 'UTF-8'); ?>&amp;task=<?php echo JRequest::getVar('task',''); ?>&amp;limitstart=<?php echo JRequest::getInt('limitstart',0); ?>&amp;mylimit=<?php echo JRequest::getInt('mylimit',20); ?>&amp;order=<?php echo JRequest::getVar('order', 'DESC') == 'DESC' ? 'ASC' : 'DESC'; ?>&amp;orderBy=id"><?php echo BFText::_('COM_BREEZINGFORMS_ID'); ?></a>
            </th>
            <th>
                <a href="index.php?option=com_breezingforms&amp;act=recordmanagement&amp;txtsearch=<?php echo JRequest::getWord('txtsearch','false'); ?>&amp;search=<?php echo htmlentities(JRequest::getVar('search',''), ENT_QUOTES, 'UTF-8'); ?>&amp;form=<?php echo htmlentities(JRequest::getVar('form',''), ENT_QUOTES, 'UTF-8'); ?>&amp;task=<?php echo JRequest::getVar('task',''); ?>&amp;limitstart=<?php echo JRequest::getInt('limitstart',0); ?>&amp;mylimit=<?php echo JRequest::getInt('mylimit',20); ?>&amp;order=<?php echo JRequest::getVar('order', 'DESC') == 'DESC' ? 'ASC' : 'DESC'; ?>&amp;orderBy=submitted"><?php echo BFText::_('COM_BREEZINGFORMS_RECORDS_SUBMITTED'); ?></a>
            </th>
            <th>
                <a href="index.php?option=com_breezingforms&amp;act=recordmanagement&amp;txtsearch=<?php echo JRequest::getWord('txtsearch','false'); ?>&amp;search=<?php echo htmlentities(JRequest::getVar('search',''), ENT_QUOTES, 'UTF-8'); ?>&amp;form=<?php echo htmlentities(JRequest::getVar('form',''), ENT_QUOTES, 'UTF-8'); ?>&amp;task=<?php echo JRequest::getVar('task',''); ?>&amp;limitstart=<?php echo JRequest::getInt('limitstart',0); ?>&amp;mylimit=<?php echo JRequest::getInt('mylimit',20); ?>&amp;order=<?php echo JRequest::getVar('order', 'DESC') == 'DESC' ? 'ASC' : 'DESC'; ?>&amp;orderBy=ip"><?php echo BFText::_('COM_BREEZINGFORMS_IP'); ?></a>
            </th>
            <th>
                <a href="index.php?option=com_breezingforms&amp;act=recordmanagement&amp;txtsearch=<?php echo JRequest::getWord('txtsearch','false'); ?>&amp;search=<?php echo htmlentities(JRequest::getVar('search',''), ENT_QUOTES, 'UTF-8'); ?>&amp;form=<?php echo htmlentities(JRequest::getVar('form',''), ENT_QUOTES, 'UTF-8'); ?>&amp;task=<?php echo JRequest::getVar('task',''); ?>&amp;limitstart=<?php echo JRequest::getInt('limitstart',0); ?>&amp;mylimit=<?php echo JRequest::getInt('mylimit',20); ?>&amp;order=<?php echo JRequest::getVar('order', 'DESC') == 'DESC' ? 'ASC' : 'DESC'; ?>&amp;orderBy=provider"><?php echo BFText::_('COM_BREEZINGFORMS_RECORDS_PROVIDER'); ?></a>
            </th>
            <th>
                <a href="index.php?option=com_breezingforms&amp;act=recordmanagement&amp;txtsearch=<?php echo JRequest::getWord('txtsearch','false'); ?>&amp;search=<?php echo htmlentities(JRequest::getVar('search',''), ENT_QUOTES, 'UTF-8'); ?>&amp;form=<?php echo htmlentities(JRequest::getVar('form',''), ENT_QUOTES, 'UTF-8'); ?>&amp;task=<?php echo JRequest::getVar('task',''); ?>&amp;limitstart=<?php echo JRequest::getInt('limitstart',0); ?>&amp;mylimit=<?php echo JRequest::getInt('mylimit',20); ?>&amp;order=<?php echo JRequest::getVar('order', 'DESC') == 'DESC' ? 'ASC' : 'DESC'; ?>&amp;orderBy=title"><?php echo BFText::_('COM_BREEZINGFORMS_RECORDS_TITLE'); ?></a>
            </th>
            <th>
                <a href="index.php?option=com_breezingforms&amp;act=recordmanagement&amp;txtsearch=<?php echo JRequest::getWord('txtsearch','false'); ?>&amp;search=<?php echo htmlentities(JRequest::getVar('search',''), ENT_QUOTES, 'UTF-8'); ?>&amp;form=<?php echo htmlentities(JRequest::getVar('form',''), ENT_QUOTES, 'UTF-8'); ?>&amp;task=<?php echo JRequest::getVar('task',''); ?>&amp;limitstart=<?php echo JRequest::getInt('limitstart',0); ?>&amp;mylimit=<?php echo JRequest::getInt('mylimit',20); ?>&amp;order=<?php echo JRequest::getVar('order', 'DESC') == 'DESC' ? 'ASC' : 'DESC'; ?>&amp;orderBy=name"><?php echo BFText::_('COM_BREEZINGFORMS_RECORDS_NAME'); ?></a>
            </th>
            <th>
                <a href="index.php?option=com_breezingforms&amp;act=recordmanagement&amp;txtsearch=<?php echo JRequest::getWord('txtsearch','false'); ?>&amp;search=<?php echo htmlentities(JRequest::getVar('search',''), ENT_QUOTES, 'UTF-8'); ?>&amp;form=<?php echo htmlentities(JRequest::getVar('form',''), ENT_QUOTES, 'UTF-8'); ?>&amp;task=<?php echo JRequest::getVar('task',''); ?>&amp;limitstart=<?php echo JRequest::getInt('limitstart',0); ?>&amp;mylimit=<?php echo JRequest::getInt('mylimit',20); ?>&amp;order=<?php echo JRequest::getVar('order', 'DESC') == 'DESC' ? 'ASC' : 'DESC'; ?>&amp;orderBy=paypal_tx_id"><?php echo BFText::_('COM_BREEZINGFORMS_PAYMENT_TX_ID'); ?></a>
            </th>
            <th>
                <a href="index.php?option=com_breezingforms&amp;act=recordmanagement&amp;txtsearch=<?php echo JRequest::getWord('txtsearch','false'); ?>&amp;search=<?php echo htmlentities(JRequest::getVar('search',''), ENT_QUOTES, 'UTF-8'); ?>&amp;form=<?php echo htmlentities(JRequest::getVar('form',''), ENT_QUOTES, 'UTF-8'); ?>&amp;task=<?php echo JRequest::getVar('task',''); ?>&amp;limitstart=<?php echo JRequest::getInt('limitstart',0); ?>&amp;mylimit=<?php echo JRequest::getInt('mylimit',20); ?>&amp;order=<?php echo JRequest::getVar('order', 'DESC') == 'DESC' ? 'ASC' : 'DESC'; ?>&amp;orderBy=paypal_payment_date"><?php echo BFText::_('COM_BREEZINGFORMS_PAYMENT_TX_DATE'); ?></a>
            </th>
            <th>
                <a href="index.php?option=com_breezingforms&amp;act=recordmanagement&amp;txtsearch=<?php echo JRequest::getWord('txtsearch','false'); ?>&amp;search=<?php echo htmlentities(JRequest::getVar('search',''), ENT_QUOTES, 'UTF-8'); ?>&amp;form=<?php echo htmlentities(JRequest::getVar('form',''), ENT_QUOTES, 'UTF-8'); ?>&amp;task=<?php echo JRequest::getVar('task',''); ?>&amp;limitstart=<?php echo JRequest::getInt('limitstart',0); ?>&amp;mylimit=<?php echo JRequest::getInt('mylimit',20); ?>&amp;order=<?php echo JRequest::getVar('order', 'DESC') == 'DESC' ? 'ASC' : 'DESC'; ?>&amp;orderBy=paypal_testaccount"><?php echo BFText::_('COM_BREEZINGFORMS_PAYMENT_TESTACCOUNT'); ?></a>
            </th>
            <th>
                <a href="index.php?option=com_breezingforms&amp;act=recordmanagement&amp;txtsearch=<?php echo JRequest::getWord('txtsearch','false'); ?>&amp;search=<?php echo htmlentities(JRequest::getVar('search',''), ENT_QUOTES, 'UTF-8'); ?>&amp;form=<?php echo htmlentities(JRequest::getVar('form',''), ENT_QUOTES, 'UTF-8'); ?>&amp;task=<?php echo JRequest::getVar('task',''); ?>&amp;limitstart=<?php echo JRequest::getInt('limitstart',0); ?>&amp;mylimit=<?php echo JRequest::getInt('mylimit',20); ?>&amp;order=<?php echo JRequest::getVar('order', 'DESC') == 'DESC' ? 'ASC' : 'DESC'; ?>&amp;orderBy=paypal_download_tries"><?php echo BFText::_('COM_BREEZINGFORMS_PAYMENT_DOWNLOAD_TRIES'); ?></a>
            </th>
            <th nowrap align="center"><?php echo BFText::_('COM_BREEZINGFORMS_RECORDS_VIEWED'); ?></th>
			<th nowrap align="center"><?php echo BFText::_('COM_BREEZINGFORMS_RECORDS_EXPORTED'); ?></th>
			<th nowrap align="center"><?php echo BFText::_('COM_BREEZINGFORMS_RECORDS_ARCHIVED'); ?></th>
        </tr>
    </thead>
    <?php
    $k = 0;
    $cnt = count( $rows );
    for ($i=0; $i < $cnt; $i++)
    {
        $row = $rows[$i];
        if ($row->viewed) $view_src = "components/com_breezingforms/images/icons/publish_g.png"; else $view_src = "components/com_breezingforms/images/icons/publish_x.png";
		if ($row->exported) $exp_src = "components/com_breezingforms/images/icons/publish_g.png"; else $exp_src = "components/com_breezingforms/images/icons/publish_x.png";
		if ($row->archived) $arch_src = "components/com_breezingforms/images/icons/publish_g.png"; else $arch_src = "components/com_breezingforms/images/icons/publish_x.png";
        ?>
        <tr class="<?php echo "row$k"; ?>">
            <td nowrap align="center"><input type="checkbox" id="cb<?php echo $i; ?>" name="ids[]" value="<?php echo $row->id; ?>" onclick="isChecked(this.checked);" /></td>
			<td nowrap align="left"><a href="#" onclick="return listItemTask('cb<?php echo $i; ?>','edit')"><?php echo $row->id; ?></a></td>
			<td nowrap align="left"><a href="#" onclick="return listItemTask('cb<?php echo $i; ?>','edit')"><?php echo $row->submitted; ?></a></td>
			<td nowrap align="left"><?php echo $row->ip; ?></td>
			<td nowrap align="left"><?php echo $row->provider; ?></td>
			<td nowrap align="left"><?php echo $row->title; ?></td>
			<td nowrap align="left"><?php echo $row->name; ?></td>
			<td nowrap align="left"><?php echo $row->paypal_tx_id; ?></td>
			<td nowrap align="left"><?php echo $row->paypal_payment_date; ?></td>
			<td nowrap align="left"><?php echo $row->paypal_testaccount ? BFText::_('COM_BREEZINGFORMS_YES') : BFText::_('COM_BREEZINGFORMS_NO'); ?></td>
			<td nowrap align="left"><?php echo $row->paypal_download_tries; ?></td>
			<td nowrap align="center"><a href="index.php?option=com_breezingforms&amp;act=recordmanagement&amp;txtsearch=<?php echo JRequest::getWord('txtsearch','false'); ?>&amp;search=<?php echo htmlentities(JRequest::getVar('search',''), ENT_QUOTES, 'UTF-8'); ?>&amp;form=<?php echo htmlentities(JRequest::getVar('form',''), ENT_QUOTES, 'UTF-8'); ?>&amp;task=<?php echo JRequest::getVar('task',''); ?>&amp;limitstart=<?php echo JRequest::getInt('limitstart',0); ?>&amp;mylimit=<?php echo JRequest::getInt('mylimit',20); ?>&amp;id=<?php echo $row->id ?>&amp;viewed=<?php echo $row->viewed ?>&amp;order=<?php echo JRequest::getWord('order','DESC') ?>&amp;orderBy=<?php echo JRequest::getWord('orderBy','submitted') ?>"><img src="<?php echo $view_src; ?>" alt="+" border="0" /></a></td>
			<td nowrap align="center"><a href="index.php?option=com_breezingforms&amp;act=recordmanagement&amp;txtsearch=<?php echo JRequest::getWord('txtsearch','false'); ?>&amp;search=<?php echo htmlentities(JRequest::getVar('search',''), ENT_QUOTES, 'UTF-8'); ?>&amp;form=<?php echo htmlentities(JRequest::getVar('form',''), ENT_QUOTES, 'UTF-8'); ?>&amp;task=<?php echo JRequest::getVar('task',''); ?>&amp;limitstart=<?php echo JRequest::getInt('limitstart',0); ?>&amp;mylimit=<?php echo JRequest::getInt('mylimit',20); ?>&amp;id=<?php echo $row->id ?>&amp;exported=<?php echo $row->exported ?>&amp;order=<?php echo JRequest::getWord('order','DESC') ?>&amp;orderBy=<?php echo JRequest::getWord('orderBy','submitted') ?>"><img src="<?php echo $exp_src; ?>" alt="+" border="0" /></a></td>
			<td nowrap align="center"><a href="index.php?option=com_breezingforms&amp;act=recordmanagement&amp;txtsearch=<?php echo JRequest::getWord('txtsearch','false'); ?>&amp;search=<?php echo htmlentities(JRequest::getVar('search',''), ENT_QUOTES, 'UTF-8'); ?>&amp;form=<?php echo htmlentities(JRequest::getVar('form',''), ENT_QUOTES, 'UTF-8'); ?>&amp;task=<?php echo JRequest::getVar('task',''); ?>&amp;limitstart=<?php echo JRequest::getInt('limitstart',0); ?>&amp;mylimit=<?php echo JRequest::getInt('mylimit',20); ?>&amp;id=<?php echo $row->id ?>&amp;archived=<?php echo $row->archived ?>&amp;order=<?php echo JRequest::getWord('order','DESC') ?>&amp;orderBy=<?php echo JRequest::getWord('orderBy','submitted') ?>"><img src="<?php echo $arch_src; ?>" alt="+" border="0" /></a></td>
        </tr>
        <?php
        $k = 1 - $k;
    }
    ?>
    </table>
</div>

<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="option" value="com_breezingforms" />
<input type="hidden" id="task" name="task" value="<?php echo JRequest::getVar('task',''); ?>" />
<input type="hidden" name="act" value="recordmanagement" />
<input type="hidden" name="status_update" value="0" />
<input type="hidden" name="order" value="<?php echo JRequest::getWord('order','DESC') ?>" />
<input type="hidden" name="orderBy" value="<?php echo JRequest::getWord('orderBy','submitted') ?>" />
<input type="hidden" id="limitstart" name="limitstart" value="<?php echo JRequest::getInt('limitstart',0); ?>" />
<input type="hidden" id="mylimit" name="mylimit" value="<?php echo JRequest::getInt('mylimit',20); ?>" />
<input type="hidden" id="exportt" name="exportt" value="0" />

</form>

<table class="adminlist">
	<tfoot>
    	<tr>
    		<td colspan="14">
    			<form action="#">
    				<?php echo $pagination->getListFooter() ?>
    			</form>
    		</td>
    	</tr>
	</tfoot>
</table>

<script>
// fixing limit, since it seems not to be available through JRequest or even $_POST/$_GET/$_REQUEST
document.getElementById('limit').onchange =
function(){
	document.getElementById('mylimit').value = document.getElementById('limit').options[document.getElementById('limit').selectedIndex].value;
	document.adminForm.submit();
};
</script>

<?php
	}
示例#14
0
 /**
  * browse task
  * @return void
  * @request integer limit
  * @request integer limitstart
  * @request integer order
  * @request integer filterStr
  * @session object 'temakoroklist_status'   
  */
 public function browse()
 {
     jimport('hs.user.user');
     JHTML::_('behavior.modal');
     $temakor_id = JRequest::getVar('temakor', 0);
     $config = $this->temakorokHelper->getConfig($temakor_id);
     $kepviseletAtruhazasMegngedett = $config->tobbszintu_atruhazas == 1;
     $total = 0;
     $pagination = null;
     $user = JFactory::getUser();
     $db = JFactory::getDBO();
     // alapértelmezett browser status beolvasása sessionból
     $session = JFactory::getSession();
     $brStatusStr = $session->get($this->NAME . 'list_status');
     if ($brStatusStr == '') {
         $brStatusStr = '{"limit":20,"limitStart":0,"order":1,"filterStr":""}';
     }
     $brStatus = JSON_decode($brStatusStr);
     $limitStart = JRequest::getVar('limitstart', $brStatus->limitstart);
     $limit = JRequest::getVar('limit', $brStatus->limit);
     $order = JRequest::getVar('order', $brStatus->order);
     $filterStr = urldecode(JRequest::getVar('filterStr', $brStatus->filterStr));
     // browser status save to session and JRequest
     $brStatus->limit = $limit;
     $brStatus->limitStart = $limitStart;
     $brStatus->order = $order;
     $brStatus->filterStr = $filterStr;
     $session->set($this->NAME . 'list_status', JSON_encode($brStatus));
     JRequest::setVar('limit', $limit);
     JRequest::setVar('limitstart', $limitStart);
     JRequest::setVar('order', $order);
     JRequest::setVar('filterStr', $filterStr);
     // adattábla tartalom elérése és átadása a view -nek
     $items = $this->model->getItems();
     $this->view->set('Items', $items);
     // browser müködéshez linkek definiálása
     $reorderLink = JURI::base() . 'index.php?option=com_' . $this->NAME . '&view=' . $this->NAME . 'list' . '&limit=' . JRequest::getVar('limit', '20') . '&limitstart=0' . '&filterStr=' . urlencode($filterStr);
     $doFilterLink = JURI::base() . 'index.php?option=com_' . $this->NAME . '&view=' . $this->NAME . 'list' . '&limit=' . JRequest::getVar('limit', '20') . '&limitstart=0' . '&order=' . JRequest::getVar('order', '1');
     $itemLink = JURI::base() . 'index.php?option=com_szavazasok&view=szavazasoklist' . '&limit=' . JRequest::getVar('limit', '20') . '&limitstart=0' . '&filterStr=' . urlencode($filterStr) . '&order=' . JRequest::getVar('order', '1');
     $this->view->set('reorderLink', $reorderLink);
     $this->view->set('doFilterLink', $doFilterLink);
     $this->view->set('itemLink', $itemLink);
     // van ált. képviselője?
     $kepviseloje = 0;
     $db->setQuery('select k.kepviselo_id, u.name 
 from #__kepviselok k, #__users u
 where k.kepviselo_id = u.id and
         k.user_id = "' . $user->id . '" and k.temakor_id=0 and k.szavazas_id = 0 and
         k.lejarat >= "' . date('Y-m-d') . '"');
     $res = $db->loadObject();
     if ($db->getErrorNum() > 0) {
         $db->stderr();
     }
     if ($res) {
         $kepviseloje = $res->kepviselo_id;
     }
     // Ő maga képviselő jelölt?
     $kepviseloJelolt = false;
     $db->setQuery('select user_id 
 from #__kepviselojeloltek
 where  user_id = "' . $user->id . '" and temakor_id=0');
     $res = $db->loadObject();
     if ($db->getErrorNum() > 0) {
         $db->stderr();
     }
     if ($res) {
         $kepviseloJelolt = true;
     }
     // kik a témakor felvivők?
     $temakor_felvivo = $this->temakor_felvivo();
     // akciók definiálása
     $akciok = array();
     if ($this->temakorokHelper->isAdmin($user) | $temakor_felvivo == 1 & $user->id > 0) {
         $akciok['ujTemakor'] = JURI::base() . 'index.php?option=com_' . $this->NAME . '&view=' . $this->NAME . '&task=add';
     }
     if ($this->temakorokHelper->isAdmin($user)) {
         $akciok['beallitasok'] = JURI::base() . 'index.php?option=com_beallitasok';
     }
     $akciok['tagok'] = JURI::base() . 'index.php?option=com_tagok';
     $akciok['sugo'] = JURI::base() . 'index.php?option=com_content&view=article' . '&id=' . JText::_(strtoupper($this->NAME) . 'LIST_SUGO') . '&Itemid=435&tmpl=component';
     $this->view->set('Akciok', $akciok);
     // globális képviselő/képviselő jelölt gombok definiálása
     $kepviselo = array();
     $kepviselo['kepviselojeLink'] = '';
     $kepviselo['kepviseloJeloltLink'] = '';
     $kepviselo['kepviselotValasztLink'] = '';
     $kepviselo['ujJeloltLink'] = '';
     if ($user->id > 0) {
         if ($kepviseloje > 0) {
             $kepviseloUser = JFactory::getUser($kepviseloje);
             if ($kepviseloUser) {
                 $userEx = HsUser::getInstance($kepviseloje);
                 $kepviselo['kepviselojeLink'] = JURI::base() . 'index.php?option=com_kepviselok&view=kepviselok&task=show&id=' . $kepviseloje;
                 if (isset($userEx->image)) {
                     $kepviselo['image'] = $userEx->get('image');
                 } else {
                     $kepviselo['image'] = '<img src="components/com_hs_users/asset/images/noimage.png" width="50" height="50" />';
                 }
                 $kepviselo['nev'] = $kepviseloUser->name;
             }
         } else {
             if ($kepviseloJelolt) {
                 $kepviselo['kepviseloJeloltLink'] = JURI::base() . 'index.php?option=com_kepviselojeloltek&view=kepviselojeloltek&task=add&id=' . $user->id;
             } else {
                 $kepviselo['kepviselotValasztLink'] = JURI::base() . 'index.php?option=com_kepviselok&view=kepviseloklist&task=add&temekor=0&szavazas=0';
                 $kepviselo['ujJeloltLink'] = JURI::base() . 'index.php?option=com_kepviselojeloltek&task=add&temekor=0&szavazas=0&id=' . $user->id;
             }
         }
         if ($kepviseletAtruhazasMegngedett) {
             if ($kepviseloje == 0) {
                 $kepviselo['kepviselotValasztLink'] = JURI::base() . 'index.php?option=com_kepviselok&view=kepviseloklist&task=add&temekor=0&szavazas=0';
             }
             if (!$kepviseloJelolt) {
                 $kepviselo['ujJeloltLink'] = JURI::base() . 'index.php?option=com_kepviselojeloltek&task=add&temekor=0&szavazas=0&id=' . $user->id;
             }
         }
     }
     $this->view->set('Kepviselo', $kepviselo);
     //lapozósor definiálása
     jimport('joomla.html.pagination');
     $total = $this->model->getTotal($filterStr);
     $pagination = new JPagination($total, $limitStart, $limit);
     $pagination->setAdditionalUrlParam('order', $order);
     $pagination->setAdditionalUrlParam('filterStr', urlencode($filterStr));
     $this->view->set('LapozoSor', $pagination->getListFooter());
     $this->view->display();
 }
示例#15
0
 /**
  * szavaztam
  * @return void
  * @request integer limit
  * @request integer limitstart
  * @request integer order
  * @request integer filterStr
  * @session object 'temakoroklist_status'   
  */
 public function szavaztam()
 {
     jimport('hs.user.user');
     JHTML::_('behavior.modal');
     $total = 0;
     $pagination = null;
     $user = JFactory::getUser();
     $db = JFactory::getDBO();
     // hozzáférés ellenörzés
     if ($user->id == 0) {
         $this->temakorokHelper->getLogin(JText::_('JELENTKEZZBE'));
     }
     // alapértelmezett browser status beolvasása sessionból
     $session = JFactory::getSession();
     $brStatusStr = '{"limit":20,"limitstart":0,"order":1,"filterStr":"|1"}';
     $brStatus = JSON_decode($brStatus);
     $limitStart = JRequest::getVar('limitstart', $brStatus->limitstart);
     $limit = JRequest::getVar('limit', $brStatus->limit);
     $order = JRequest::getVar('order', $brStatus->order);
     $filterStr = urldecode(JRequest::getVar('filterStr', $brStatus->filterStr));
     if ($this->temakor_id == '') {
         $this->temakor_id = $brStatus->temakor_id;
     }
     JRequest::setVar('limit', $limit);
     JRequest::setVar('limitstart', $limitStart);
     JRequest::setVar('order', $order);
     JRequest::setVar('filterStr', $filterStr);
     JRequest::setVar('temakor', $this->temakor_id);
     // adattábla tartalom elérése és átadása a view -nek
     $items = $this->model->getItems();
     if ($this->model->getDBO()->getErrorNum() > 0) {
         $this->model->getDBO()->stderr();
     }
     if ($this->model->getError() != '') {
         $this->view->Msg = $this->model->getError();
     }
     $this->view->set('Items', $items);
     $this->view->set('Title', JText::_('SZAVAZASOK_SZAVAZTAM'));
     // browser müködéshez linkek definiálása
     $reorderLink = JURI::base() . 'index.php?option=com_' . $this->NAME . '&view=szavazhatok&task=szavazhatok' . '&limit=' . JRequest::getVar('limit', '20') . '&limitstart=0' . '&filterStr=' . urlencode($filterStr) . '&temakor=' . $this->temakor_id;
     $doFilterLink = JURI::base() . 'index.php?option=com_' . $this->NAME . '&view=szavazhatok&task=szavazhatok' . '&limit=' . JRequest::getVar('limit', '20') . '&limitstart=0' . '&order=' . JRequest::getVar('order', '1') . '&temakor=' . $this->temakor_id;
     $itemLink = JURI::base() . 'index.php?option=com_alternativak&view=alternativaklist&task=szavazhatok' . '&task=browse' . '&limit=' . JRequest::getVar('limit', '20') . '&limitstart=0' . '&filterStr=' . urlencode($filterStr) . '&order=' . JRequest::getVar('order', '1');
     $backLink = JURI::base() . 'index.php?option=com_temakorok&view=temakoroklist' . '&task=browse';
     $this->view->set('reorderLink', $reorderLink);
     $this->view->set('doFilterLink', $doFilterLink);
     $this->view->set('itemLink', $itemLink);
     $this->view->set('backLink', $backLink);
     $this->view->set('temakorLink', $temakorLink);
     // kik a szavazaás felvivők?
     $szavazas_felvivo = $this->szavazas_felvivo();
     // akciók definiálása
     $akciok = array();
     $this->view->set('Akciok', $akciok);
     //lapozósor definiálása
     jimport('joomla.html.pagination');
     $total = $this->model->getTotal($filterStr);
     $pagination = new JPagination($total, $limitStart, $limit);
     $pagination->setAdditionalUrlParam('order', $order);
     $pagination->setAdditionalUrlParam('filterStr', urlencode($filterStr));
     $this->view->set('LapozoSor', $pagination->getListFooter());
     $this->view->display();
 }
示例#16
0
                $pagesStop = 10;
            }
        }
    }
}
$pagination->set("limitstart", $limitstart);
$pagination->set("limit", $limit);
$pagination->set("total", $total);
$pagination->set("pagesStart", $pagesStart);
$pagination->set("pagesStop", $pagesStop);
$pagination->set("pagesCurrent", $pagesCurrent);
$pagination->set("pagesTotal", $pagesTotal);
/*echo "<pre>";
		print_r($pagination);
		echo "</pre>";*/
echo $pagination->getListFooter();
?>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        
                         <div class="g_table_wrap g_mobile">   
                            <table class="table table-striped">
                                <tr class="g_table_header">
                                    <th class="g_cell_1"><?php 
echo JText::_("GURU_DAYS_NAME");
?>
</th>
                                    <th class="g_cell_2"><?php 
echo JText::_("GURU_ATTEPMT_Q");
 /**
  * Return the pagination footer.
  *
  * @return  string   Pagination footer.
  *
  * @since   11.1
  */
 public function getListFooter()
 {
     $app = JFactory::getApplication();
     if (JVM_VERSION === 3 || $app->isSite() && jrequest::getVar('tmpl') !== 'component') {
         return parent::getListFooter();
     }
     $list = array();
     $list['prefix'] = $this->prefix;
     $list['limit'] = $this->limit;
     $list['limitstart'] = $this->limitstart;
     $list['total'] = $this->total;
     $list['limitfield'] = $this->getLimitBox();
     $list['pagescounter'] = $this->getPagesCounter();
     $list['pageslinks'] = $this->getPagesLinks();
     // Initialise variables.
     $lang = JFactory::getLanguage();
     $html = "<div class='pagination'>\n";
     // TODO $html .= "\n<div class=\"limit\">".JText::_('JGLOBAL_DISPLAY_NUM').$list['limitfield']."</div>";
     $html .= $list['pageslinks'];
     // TODO $html .= "\n<div class=\"limit\">".$list['pagescounter']."</div>";
     $html .= "\n<input type='hidden' name=\"" . $list['prefix'] . "limitstart\" value=\"" . $list['limitstart'] . "\" />";
     $html .= "\n</div>";
     return $html;
 }
示例#18
0
 /** function that will create pagination for views
  * @param object $setLimit
  * total - total number of rows
  * start - number or index to start e.g 0 ( will start from 0 - limit )
  * value - ending number or limit e.g 20 ( will only show 20 rows )
  * @return $display
  */
 private static function _pagination($setLimit, $onlyBox = false, $showTotal = false)
 {
     jimport('joomla.html.pagination');
     $total = $setLimit->total;
     $start = $setLimit->start;
     $value = $setLimit->end;
     $pagination = new JPagination($total, $start, $value);
     //alex pagination
     $pagination->setAdditionalUrlParam('limit', JRequest::getVar('limit'));
     if (version_compare(JVERSION, '3.0.0', '<')) {
         if ($onlyBox) {
             $display = "<div class=\"list-footer\">\n";
             $display .= "\n<div class=\"limit\" style=\"float:left; height:22px; line-height:22px; margin:0 10px;\">" . JText::_('Display Num') . ' ' . $pagination->getLimitBox() . "</div>";
             $display .= "\n<div class=\"counter\" style=\"float:left; height:22px; line-height:22px; margin:0 10px;\">" . ' ' . $pagination->getPagesCounter() . "</div>";
             if ($showTotal) {
                 $display .= "\n<div class=\"outof\" style=\"float:left; height:22px; line-height:22px; margin:0 10px;\">" . ' ' . JText::_('Total Result:') . ' <span style="font-weight: bold; text-decoration: underlined;">' . $total . "</span></div>";
             }
             $display .= "\n</div>";
         } else {
             $display = $pagination->getListFooter();
         }
     } else {
         $display = '<div style="display:inline; font-size:14px;">';
         $display .= '<div class="jnews_pagination_one" style="float:right; margin-left:15px;">';
         $display .= $pagination->getLimitBox();
         $display .= '</div>';
         $pagi = $pagination->getListFooter();
         if (!empty($pagi)) {
             $display .= '<div class="jnews_pagination" style="float:right; margin-left:15px;">';
             $display .= $pagi;
             $display .= '</div>';
         }
         $pagi = $pagination->getPagesCounter();
         if (!empty($pagi)) {
             $display .= '<div style="float:right;padding-top: 4px;">';
             $display .= $pagi;
             $display .= '</div>';
         }
         $display .= '</div>';
     }
     return $display;
 }
示例#19
0
    function productDisplay()
    {
        $app = JFactory::getApplication();
        $db = JFactory::getDBO();
        $editor_name = JRequest::getString('editor_name', 'jform_articletext');
        $pageInfo = new stdClass();
        $pageInfo->limit = new stdClass();
        $pageInfo->search = $app->getUserStateFromRequest("com_content.productbutton.search", 'search', '', 'string');
        $pageInfo->search = JString::strtolower(trim($pageInfo->search));
        $pageInfo->limit->value = $app->getUserStateFromRequest('com_content.productbutton.limit', 'limit', $app->getCfg('list_limit'), 'int');
        $pageInfo->limit->start = $app->getUserStateFromRequest('com_content.productbutton.limitstart', 'limitstart', 0, 'int');
        if (JRequest::getVar('search') != $app->getUserState('com_content.productbutton.search') || JRequest::getVar('limit') != $app->getUserState('com_content.productbutton.limit')) {
            $pageInfo->limit->start = 0;
            $app->setUserState('com_content.productbutton.limitstart', 0);
        }
        $Select = 'SELECT * FROM ' . hikashop_table('product');
        $Where = ' WHERE product_type=\'main\' AND product_access=\'all\' AND product_published=1 ';
        $orderBY = ' ORDER BY product_id ASC';
        $searchMap = array('product_name', 'product_code', 'product_id');
        $filters = array();
        if (!empty($pageInfo->search)) {
            $searchVal = '\'%' . hikashop_getEscaped(JString::strtolower(trim($pageInfo->search)), true) . '%\'';
            $filter = '(' . implode(" LIKE {$searchVal} OR ", $searchMap) . " LIKE {$searchVal}" . ')';
            $filters[] = $filter;
        }
        if (is_array($filters) && count($filters)) {
            $filters = ' AND ' . implode(' AND ', $filters);
        } else {
            $filters = '';
        }
        $db->setQuery($Select . $Where . $filters . $orderBY, (int) $pageInfo->limit->start, (int) $pageInfo->limit->value);
        $products = $db->loadObjectList();
        $db->setQuery('SELECT COUNT(product_id) FROM ' . hikashop_table('product') . ' WHERE product_type=\'main\' AND product_access=\'all\' AND product_published=1' . $filters);
        $nbrow = $db->loadResult();
        $db->setQuery('SELECT * FROM ' . hikashop_table('price') . ' ORDER BY price_product_id ASC');
        $prices = $db->loadObjectList();
        if (HIKASHOP_J30) {
            $pagination = hikashop_get('helper.pagination', $nbrow, $pageInfo->limit->start, $pageInfo->limit->value);
        } else {
            jimport('joomla.html.pagination');
            $pagination = new JPagination($nbrow, $pageInfo->limit->start, $pageInfo->limit->value);
        }
        $scriptV1 = "function insertTag(tag){ window.parent.jInsertEditorText(tag,'text'); return true;}";
        $scriptV2 = "function insertTag(tag){ window.parent.jInsertEditorText(tag,'" . str_replace(array('\\', '\''), array('\\\\', '\\\''), $editor_name) . "'); return true;}";
        if (!HIKASHOP_PHP5) {
            $doc =& JFactory::getDocument();
        } else {
            $doc = JFactory::getDocument();
        }
        if (version_compare(JVERSION, '1.6.0', '<')) {
            $doc->addScriptDeclaration($scriptV1);
        } else {
            $doc->addScriptDeclaration($scriptV2);
        }
        $config =& hikashop_config();
        $pricetaxType = hikashop_get('type.pricetax');
        $discountDisplayType = hikashop_get('type.discount_display');
        ?>
	<script language="JavaScript" type="text/javascript">
		function divhidder(){
			if (document.getElementById('price').checked) {
				document.getElementById('Priceopt').style.visibility = 'visible';
			}
			else {
				document.getElementById('Priceopt').style.visibility = 'hidden';
			}
		}
		function checkSelect(){
			form = document.getElementById('adminForm');
			inputs = form.getElementsByTagName('input');
			nbbox = 0;
			nbboxOk = 0;
			nbboxProd = 0;
			for(i=0 ; i < inputs.length ; i++){
				if(inputs[i].type == 'checkbox' && inputs[i].checked==true){
					nbbox++;
				}
			}
			for(i=0 ; i < inputs.length ; i++){
				if(inputs[i].type == 'checkbox' && inputs[i].checked==true){
					nbboxOk++;
					if(inputs[i].id.match(/product_checkbox.*/)){
						if (nbboxProd == 0)
							document.getElementById('product_insert').value = '{product ';
						nbboxProd++;
						document.getElementById('product_insert').value = document.getElementById('product_insert').value +  inputs[i].name;
						if(nbbox > nbboxOk){
							document.getElementById('product_insert').value = document.getElementById('product_insert').value + '|';
						}
					}
				}
			}
			if( nbboxProd > 0 )
			{
				if(document.getElementById('name').checked==true){
					document.getElementById('product_insert').value =document.getElementById('product_insert').value +  '|name';
				}
				if(document.getElementById('cart').checked==true){
					document.getElementById('product_insert').value =document.getElementById('product_insert').value +  '|cart';
				}
				if(document.getElementById('quantityfield').checked==true){
					document.getElementById('product_insert').value =document.getElementById('product_insert').value +  '|quantityfield';
				}
				if(document.getElementById('description').checked==true){
					document.getElementById('product_insert').value =document.getElementById('product_insert').value +  '|description';
				}
				if(document.getElementById('picture').checked==true){
					document.getElementById('product_insert').value =document.getElementById('product_insert').value +  '|picture';
				}
				if(document.getElementById('link').checked==true){
					document.getElementById('product_insert').value =document.getElementById('product_insert').value +  '|link';
				}
				if(document.getElementById('border').checked==true){
					document.getElementById('product_insert').value =document.getElementById('product_insert').value +  '|border';
				}
				if(document.getElementById('badge').checked==true){
					document.getElementById('product_insert').value =document.getElementById('product_insert').value +  '|badge';
				}
				if(document.getElementById('menuid').value.length != 0){
					document.getElementById('product_insert').value =document.getElementById('product_insert').value +  '|menuid:' + document.getElementById('menuid').value;
				}
				if(document.getElementById('pricedisc').value==1 && document.getElementById('price').checked==true){
					document.getElementById('product_insert').value =document.getElementById('product_insert').value +  '|pricedis1';
				}
				if(document.getElementById('pricedisc').value==2 && document.getElementById('price').checked==true){
					document.getElementById('product_insert').value =document.getElementById('product_insert').value +  '|pricedis2';
				}
				if(document.getElementById('pricedisc').value==3 && document.getElementById('price').checked==true){
					document.getElementById('product_insert').value =document.getElementById('product_insert').value +  '|pricedis3';
				}
				if(document.getElementById('pricetax').value==1 && document.getElementById('price').checked==true){
					document.getElementById('product_insert').value =document.getElementById('product_insert').value +  '|pricetax1';
				}
				if(document.getElementById('pricetax').value==2 && document.getElementById('price').checked==true){
					document.getElementById('product_insert').value =document.getElementById('product_insert').value +  '|pricetax2';
				}
				if(document.getElementById('pricedisc').value==0 && document.getElementById('pricetax').value==0 && document.getElementById('price').checked==true){
					document.getElementById('product_insert').value =document.getElementById('product_insert').value +  '|price';
				}
				document.getElementById('product_insert').value=document.getElementById('product_insert').value + '}';
			}
			if(document.getElementById('name').checked==false
			&& document.getElementById('price').checked==false
			&& document.getElementById('cart').checked==false
			&& document.getElementById('description').checked==false
			&& document.getElementById('picture').checked==false){
				document.getElementById('product_insert').value='';
			}
		}
		function checkAllBox(){
			var checkAll = document.getElementById('checkAll');
			var toCheck = document.getElementById('ToCheck').getElementsByTagName('input');
			for (i = 0 ; i < toCheck.length ; i++) {
				if (toCheck[i].type == 'checkbox') {
					if(checkAll.checked == true){
						toCheck[i].checked = true;
					}else{
						toCheck[i].checked = false;
					}
				}
			}
		}
	</script>
	<form action="<?php 
        echo hikashop_currentURL();
        ?>
" method="POST" name="adminForm" id="adminForm">
		<table class="hikashop_no_border">
			<tr>
				<td width="100%">
					<?php 
        echo JText::_('FILTER');
        ?>
:
					<input type="text" name="search" id="hikashop_search" value="<?php 
        echo hikashop_getEscaped($pageInfo->search);
        ?>
" class="inputbox" onchange="document.adminForm.submit();" />
					<button class="btn" onclick="this.form.submit();"><?php 
        echo JText::_('GO');
        ?>
</button>
					<button class="btn" onclick="document.getElementById('hikashop_search').value='';this.form.submit();"><?php 
        echo JText::_('RESET');
        ?>
</button>
				</td>
			</tr>
		</table>
		<fieldset>
			<legend>OPTIONS</legend>
			<div id="productInsertOptions">
				<input type="checkbox" name="name" id="name" value="1" checked/><?php 
        echo JText::_('HIKA_NAME');
        ?>
				<input type="checkbox" name="description" id="description" value="1" checked/><?php 
        echo JText::_('PRODUCT_DESCRIPTION');
        ?>
				<input type="checkbox" name="cart" id="cart" value="1" <?php 
        if (!empty($_REQUEST['cart'])) {
            echo 'checked';
        }
        ?>
 /><?php 
        echo JText::_('HIKASHOP_CHECKOUT_CART');
        ?>
				<input type="checkbox" name="quantity" id="quantityfield" value="1" <?php 
        if (!empty($_REQUEST['quantityfield'])) {
            echo 'checked';
        }
        ?>
 /><?php 
        echo JText::_('HIKA_QUANTITY_FIELD');
        ?>
				<input type="checkbox" name="picture" id="picture" value="1" <?php 
        if (!empty($_REQUEST['picture'])) {
            echo 'checked';
        }
        ?>
/><?php 
        echo JText::_('HIKA_IMAGE');
        ?>
				<input type="checkbox" name="link" id="link" value="1" <?php 
        if (!empty($_REQUEST['link'])) {
            echo 'checked';
        }
        ?>
/><?php 
        echo JText::_('LINK_TO_PRODUCT_PAGE');
        ?>
				<input type="checkbox" name="border" id="border" value="1" <?php 
        if (!empty($_REQUEST['border'])) {
            echo 'checked';
        }
        ?>
 /><?php 
        echo JText::_('ITEM_BOX_BORDER');
        ?>
				<input type="checkbox" name="badge" id="badge" value="1" <?php 
        if (!empty($_REQUEST['badge'])) {
            echo 'checked';
        }
        ?>
 /><?php 
        echo JText::_('HIKA_BADGE');
        ?>
				<br/>
				Menu ID : <input type="text" name="menuid" id="menuid"  <?php 
        if (!empty($_REQUEST['menuid'])) {
            echo 'value="' . $_REQUEST['menuid'] . '"';
        }
        ?>
 />
				<input type="checkbox" name="pricetax" id="pricetax" value="<?php 
        echo $config->get('price_with_tax');
        ?>
" hidden/>
				<br/>
				<input type="checkbox" name="price" id="price" value="1" checked onclick="divhidder()"/><?php 
        echo JText::_('DISPLAY_PRICE');
        ?>
				<br/>
				<div id="Priceopt">
				<tr id="show_discount_line">
					<td class="key" valign="top">
						<?php 
        echo JText::_('SHOW_DISCOUNTED_PRICE');
        ?>
					</td>
					<td>
						<?php 
        $default_params = $config->get('default_params');
        echo $discountDisplayType->display('pricedisc', 3);
        ?>
					</td>
				</tr>
				<div>
				</div>
		</fieldset>
			<fieldset>
			<table class="adminlist table table-striped" cellpadding="1" width="100%">
				<thead>
					<tr>
						<th class="title titlenum">
							<?php 
        echo JText::_('HIKA_NUM');
        ?>
						</th>
						<th class="title titlebox">
							<input type="checkbox" name="checkAll" id="checkAll" value="" onclick="checkAllBox();"/>
						</th>
						<th class="title">
							<?php 
        echo JText::_('HIKA_NAME');
        ?>
						</th>
						<th class="title">
							<?php 
        echo JText::_('PRODUCT_PRICE');
        ?>
						</th>
						<th class="title">
							<?php 
        echo JText::_('PRODUCT_QUANTITY');
        ?>
						</th>
						<th class="title">
							<?php 
        echo 'ID';
        ?>
						</th>
					</tr>
				</thead>
				<tbody id="ToCheck">
					<?php 
        $i = 0;
        $row = '';
        $currencyClass = hikashop_get('class.currency');
        $currencies = new stdClass();
        $currency_symbol = '';
        foreach ($products as $product) {
            $i++;
            $row .= '<tr><td class="title titlenum">';
            $row .= $i;
            $row .= '</td><td class="title titlebox"><input type="checkbox" id="product_checkbox' . $product->product_id . '" name="' . $product->product_id;
            $row .= '" value=""/></td><td class="center">';
            $row .= $product->product_name;
            $row .= '</td><td class="center">';
            foreach ($prices as $price) {
                if ($price->price_product_id == $product->product_id) {
                    $row .= $price->price_value;
                    $currency = $currencyClass->getCurrencies($price->price_currency_id, $currencies);
                    foreach ($currency as $currrencie) {
                        if ($price->price_currency_id == $currrencie->currency_id) {
                            $currency_symbol = $currrencie->currency_symbol;
                        }
                    }
                    $row .= ' ' . $currency_symbol;
                }
            }
            $row .= '</td><td class="center">';
            if ($product->product_quantity > -1) {
                $row .= $product->product_quantity;
            } else {
                $row .= JText::_('UNLIMITED');
            }
            $row .= '</td><td class="center">';
            $row .= $product->product_id;
            $row .= '</td></tr>';
        }
        echo $row;
        ?>
				</tbody>
				<tfoot>
					<tr>
						<td colspan="7">
							<?php 
        echo $pagination->getListFooter();
        ?>
							<?php 
        echo $pagination->getResultsCounter();
        ?>
						</td>
					</tr>
				</tfoot>
			</table>
		</fieldset>
		<input type="hidden" name="product_insert" id="product_insert" value="" />
		<button class="btn" onclick="checkSelect(); insertTag(document.getElementById('product_insert').value); window.parent.SqueezeBox.close();"><?php 
        echo JText::_('HIKA_INSERT');
        ?>
</button>
		<?php 
        global $Itemid;
        ?>
		<input type="hidden" name="Itemid" value="<?php 
        echo $Itemid;
        ?>
"/>
		<?php 
        echo JHTML::_('form.token');
    }
示例#20
0
		</td> 
		<td align="center" style="white-space:nowrap;">
			' . $ag_resourceManager_version . '
		</td>    
		<td style="white-space:nowrap;">
			' . $ag_resourceManager_creationDate . '
		</td>  
		<td>
			' . $ag_resourceManager_author . '
		</td>  
		</tr>
		';
        }
    }
    //foreach ($ag_resourceManager_installed as $ag_resourceManager_Key => $ag_resourceManager_Value)
}
//if(!empty($ag_resourceManager_installed))
echo '
<tfoot>
<tr>
    <td align="center" colspan="9">
	    ' . $pageNav->getListFooter() . '
    </td>
</tr>
</tfoot>
</table>
';
?>

</form>
示例#21
0
 /**
  *  Funkce pro zobrazení přehledu článků pro jejich výběr
  */
 function articlesHtml()
 {
     $mainframe = JFactory::getApplication();
     $model = $this->getModel();
     $limit = JRequest::getVar('limit', $mainframe->getCfg(list_limit));
     $limitstart = JRequest::getVar('limitstart', 0);
     /*kontrola, jestli je v session nastavena sekce a kategorie -> pouze při prvním zobrazení*/
     if (JRequest::getInt('category', -1) == -1 && $_SESSION['ginclude']['category'] > 0) {
         JRequest::setVar('category', $_SESSION['ginclude']['category']);
         $_SESSION['ginclude']['category'] = -1;
     }
     /**/
     $articles = $model->getArticles(JRequest::getInt('category', -1), JRequest::getString('filter', ''), JRequest::getCmd('filter_order', 'title'), JRequest::getCmd('filter_order_Dir', 'asc'), $limitstart, $limit, false);
     $total = $model->getArticlesCount(JRequest::getInt('category', -1), JRequest::getString('filter', ''), false);
     $result = '';
     jimport('joomla.html.pagination');
     $pageNav = new JPagination($total, $limitstart, $limit);
     $result .= '<h3>' . JText::_(SELECT_ARTICLE) . '</h3>';
     $result .= '<form action="index.php?option=com_ginclude&amp;task=articles&amp;tmpl=component" name="adminForm" id="adminForm" method="post">';
     $orderDir = JRequest::getCmd('filter_order_Dir', 'asc');
     if ($orderDir == 'asc') {
         $orderDir2 = 'desc';
     } else {
         $orderDir2 = 'asc';
     }
     $result .= '<div style="position:relative;">' . JText::_(FILTER) . ': <input type="text" name="filter" value="' . JRequest::getString('filter', '') . '" id="filter" /><button onclick="this.form.submit();">OK</button><button onclick="document.getElementById(\'filter\').value=\'\';this.form.submit();">Reset</button>';
     $result .= '<div style="display:inline;position:absolute;right:5px;top:2px;"><select name="category" onchange="document.adminForm.submit();"><option value="-1">--' . JText::_(SELECT_CATEGORY) . '--</option>';
     /*vypsani jednotlivych kategorii*/
     $categories = $model->getCategories(true);
     $currentCatId = JRequest::getInt('category', -1);
     if (count($categories) > 0) {
         foreach ($categories as $catId => $catArr) {
             $result .= '<option value="' . $catId . '"';
             if ($catId == $currentCatId) {
                 $result .= ' selected="selected"';
             } elseif ($catArr['disabled']) {
                 $result .= ' disabled="disabled"';
             }
             $result .= '>' . $catArr['title'] . '</option>';
         }
     }
     /*--vypsani jednotlivych kategorii*/
     $result .= '</select></div>';
     $result .= '</div>';
     $result .= '<table border="0" class="adminlist" cellspacing="1">
              <thead>
                <tr>
                  <th><a href="javascript:tableOrdering(\'1\',\'' . $orderDir2 . '\',\'\');">' . JText::_('TITLE') . '</a></th>
                  <th width="150"><a href="javascript:tableOrdering(\'3\',\'' . $orderDir2 . '\',\'\');">' . JText::_('CATEGORY') . '</a></th>
                  <th width="80"><a href="javascript:tableOrdering(\'created\',\'' . $orderDir2 . '\',\'\');">' . JText::_('DATE') . '</a></th>
                </tr>
              </thead>';
     if ($total > 0 && count($articles) > 0) {
         foreach ($articles as $article) {
             if ($rowClass == 'row0') {
                 $rowClass = 'row1';
             } else {
                 $rowClass = 'row0';
             }
             $result .= '<tr class="' . $rowClass . '">
                  <td>';
             if ($article->locked > 0) {
                 $result .= ' <img src="media/" alt="Locked" />';
             }
             if ($article->locked == 2) {
                 $result .= ' <span class="lockedArticle">' . $article->title . '</span>';
             } else {
                 $result .= ' <a href="index.php?option=com_ginclude&amp;tmpl=component&amp;task=insert&amp;article=' . $article->id . '">' . $article->title . '</a>';
             }
             $result .= '</td>
                  <td>' . $article->categoryTitle . '</td>
                  <td>' . $article->cdate . '</td>
                </tr>';
         }
     }
     $result .= '<tfoot><tr><td colspan="4">' . $pageNav->getListFooter() . '</td></tr></tfoot></table>';
     $result .= '<input type="hidden" name="filter_order" value="' . JRequest::getCmd('filter_order', 'title') . '" />';
     $result .= '<input type="hidden" name="filter_order_Dir" value="' . $orderDir . '" />';
     $result .= '</form>';
     return $result;
 }
示例#22
0
 function run($form, $actiondata)
 {
     $params = new JParameter($actiondata->params);
     $table_name = $params->get('table_name', '');
     if (!empty($table_name) && (int) $params->get('load_data', 1) == 1) {
         $mainframe =& JFactory::getApplication();
         $database =& JFactory::getDBO();
         $table_field = $params->get('dbfield', '');
         if (trim($actiondata->content1)) {
             $where = " WHERE " . $this->_processWhere(trim($actiondata->content1), $form);
         } else {
             if (!empty($table_field)) {
                 $where = " WHERE `" . $params->get('dbfield', '') . "` = '" . $form->data[$params->get('request_param', '')] . "'";
             } else {
                 $where = "";
             }
         }
         //load the model_id
         $model_id_sub = preg_replace('/(?:^|_)(.?)/e', "strtoupper('\$1')", $table_name);
         $model_id = $params->get('model_id', '');
         if (empty($model_id)) {
             $model_id = $model_id_sub;
         }
         //check fields
         $fields = array();
         if (trim($params->get('fields', ''))) {
             $fields_list = explode(",", trim($params->get('fields', '')));
             foreach ($fields_list as $field) {
                 $fields[] = "`" . $field . "`";
             }
         } else {
             $fields = array("`" . $model_id . "`.*");
         }
         //check the association
         $assoc = '';
         $assoc_models = array();
         $primaries = array();
         if ($params->get('enable_association', 0) == 1 && $params->get('load_data', 1) == 1) {
             if (trim($params->get('associated_models', ''))) {
                 //add primary key for the main table
                 $fields_list = $database->getTableFields(array(trim($params->get('table_name', ''))), false);
                 $table_fields = $fields_list[trim($params->get('table_name', ''))];
                 foreach ($table_fields as $table_field => $field_data) {
                     if ($field_data->Key == 'PRI') {
                         $primaries[$model_id] = $table_field;
                     }
                 }
                 //find associated models list
                 $assoc_models = explode(',', $params->get('associated_models'));
                 foreach ($assoc_models as $k => $assoc_model) {
                     $assoc_models[$k] = trim($assoc_model);
                 }
                 //find other multi record loaders
                 $models_list = array();
                 foreach ($form->form_actions as $form_action) {
                     if ($form_action->type == 'db_multi_record_loader') {
                         $action_params = new JParameter($form_action->params);
                         if (trim($action_params->get('model_id', '')) && trim($action_params->get('table_name', ''))) {
                             $models_list[trim($action_params->get('model_id', ''))] = trim($action_params->get('table_name', ''));
                             if (in_array(trim($action_params->get('model_id', '')), $assoc_models)) {
                                 //find some table info (primary key)
                                 $fields_list = $database->getTableFields(array(trim($action_params->get('table_name', ''))), false);
                                 $table_fields = $fields_list[trim($action_params->get('table_name', ''))];
                                 foreach ($table_fields as $table_field => $field_data) {
                                     if ($field_data->Key == 'PRI') {
                                         $primaries[trim($action_params->get('model_id', ''))] = $table_field;
                                     }
                                 }
                                 //get table fields list
                                 if (trim($action_params->get('fields', ''))) {
                                     $table_fields = explode(",", trim($action_params->get('fields', '')));
                                     foreach ($table_fields as $table_field) {
                                         $table_field = trim($table_field);
                                         $field_alias = "`" . trim($action_params->get('model_id', '')) . "." . $table_field . "`";
                                         $field_name = "`" . trim($action_params->get('model_id', '')) . "`.`" . $table_field . "`";
                                         $fields[] = $field_name . " AS " . $field_alias;
                                     }
                                 } else {
                                     foreach ($table_fields as $table_field => $field_data) {
                                         $fields[] = "`" . trim($action_params->get('model_id', '')) . "`.`" . $table_field . "` AS `" . trim($action_params->get('model_id', '')) . "." . $table_field . "`";
                                     }
                                 }
                                 //append any WHERE data
                                 if (trim($form_action->content1)) {
                                     if (!empty($where)) {
                                         $where .= " AND " . $this->_processWhere($form_action->content1);
                                     } else {
                                         $where = " WHERE " . $this->_processWhere($form_action->content1);
                                     }
                                 }
                             }
                         }
                     }
                 }
                 //build the JOIN statement
                 foreach ($assoc_models as $assoc_model) {
                     if (isset($models_list[$assoc_model])) {
                         $assoc .= " INNER JOIN `" . $models_list[$assoc_model] . "` AS `" . $assoc_model . "`";
                     }
                 }
             }
         }
         //add the page navigation data
         if ((bool) $params->get('enable_pagination', 0) === true) {
             $option = 'com_chronoforms.db_multi_record_loader.' . $actiondata->id;
             $session =& JFactory::getSession();
             if (isset($form->data['limit'])) {
                 $session->set($option . '.limit', (int) $form->data['limit'], md5('chrono'));
             }
             $limit = $mainframe->getUserStateFromRequest($option . '.limit', 'limit', $session->get($option . '.limit', (int) $params->get('pagination_limit', 50), md5('chrono')), 'int');
             $limitstart = $mainframe->getUserStateFromRequest($option . '.limitstart', 'limitstart', 0, 'int');
             $sql = "SELECT count(*) FROM `" . $params->get('table_name', '') . "` AS `" . $model_id . "`" . $assoc . $where;
             $database->setQuery($sql);
             $total = $database->loadResult();
             jimport('joomla.html.pagination');
             $pageNav = new JPagination($total, $limitstart, $limit);
             //get current page url
             //load show_html action helper class
             $form->loadActionHelper('show_html');
             $url = CfactionShowHtmlHelper::selfURL();
             if ($form->admin === false) {
                 $form->paginatior_footer = '<form action="' . $url . '" method="post" name="chronoform_pagination_' . $actiondata->id . '" id="chronoform_pagination_' . $actiondata->id . '">';
             } else {
                 $form->paginatior_footer = '<form action="' . $url . '" method="post" name="adminForm" id="adminForm">';
             }
             $form->paginatior_footer .= $pageNav->getListFooter();
             $form->paginatior_footer .= '</form>';
             //check order data
             $order = '';
             if (isset($form->data['order'])) {
                 $order = ' ORDER BY `' . trim($form->data['order']) . '`' . (isset($form->data['direction']) ? ' ' . $form->data['direction'] : ' ASC');
             }
             $sql = "SELECT " . implode(", ", $fields) . " FROM `" . $params->get('table_name', '') . "` AS `" . $model_id . "`" . $assoc . $where . $order . " LIMIT {$pageNav->limitstart},{$pageNav->limit}";
         } else {
             $sql = "SELECT " . implode(", ", $fields) . " FROM `" . $params->get('table_name', '') . "` AS `" . $model_id . "`" . $assoc . $where;
         }
         //echo $form->paginatior_footer;
         //run the sql and get the data
         $database->setQuery($sql);
         $data = $database->loadAssocList();
         //process the data if association was enabled
         if (!empty($assoc_models) && !empty($data)) {
             foreach ($data as $datak => $datav) {
                 if (is_array($datav)) {
                     foreach ($datav as $k => $v) {
                         if (strpos($k, '.')) {
                             $details = explode('.', $k);
                             $data[$datak][$details[0]][$details[1]] = $v;
                             unset($data[$datak][$k]);
                         }
                     }
                 }
             }
             if ((int) $params->get('group_model_data', 1) == 1) {
                 $data = $this->group_model_data($data, $model_id, $primaries);
             }
         }
         //print_r2($data);
         //data must be loaded under some model id
         $form->data[$model_id] = $data;
         //check the result
         //$request_val = $form->data[$params->get('request_param', '')];
         if (empty($data)) {
             $this->events['notfound'] = 1;
         } else {
             $this->events['found'] = 1;
         }
         //print_r2($form->data);
     }
 }
示例#23
0
 /**
  * browse task
  * @return void
  * @request integer limit
  * @request integer limitstart
  * @request integer order
  * @request integer filterStr
  * @request integer temakor
  * @request integer szavazas      
  * @session object 'temakoroklist_status'   
  */
 public function browse()
 {
     jimport('hs.user.user');
     JHTML::_('behavior.modal');
     $total = 0;
     $pagination = null;
     $user = JFactory::getUser();
     $db = JFactory::getDBO();
     // alapértelmezett browser status beolvasása sessionból
     $session = JFactory::getSession();
     $brStatusStr = $session->get($this->NAME . 'list_status');
     if ($brStatusStr == '') {
         $brStatusStr = '{"limit":20,"limitstart":0,"order":1,"filterStr":"","temakor_id":0,"szavazas_id":0}';
     }
     $brStatus = JSON_decode($brStatus);
     $limitStart = JRequest::getVar('limitstart', $brStatus->limitstart);
     $limit = JRequest::getVar('limit', $brStatus->limit);
     $order = JRequest::getVar('order', $brStatus->order);
     $filterStr = urldecode(JRequest::getVar('filterStr', $brStatus->filterStr));
     if ($this->temakor_id == '') {
         $this->temakor_id = $brStatus->temakor_id;
     }
     if ($this->szavazas_id == '') {
         $this->szavazas_id = $brStatus->szavazas_id;
     }
     // browser status save to session and JRequest
     $brStatus->limit = $limit;
     $brStatus->limitStart = $limitStart;
     $brStatus->order = $order;
     $brStatus->filterStr = $filterStr;
     $brStatus->temakor_id = $this->temakor_id;
     $brStatus->szavazas_id = $this->szavazas_id;
     $session->set($this->NAME . 'list_status', JSON_encode($brStatus));
     JRequest::setVar('limit', $limit);
     JRequest::setVar('limitstart', $limitstart);
     JRequest::setVar('order', $order);
     JRequest::setVar('filterStr', $filterStr);
     JRequest::setVar('temakor', $this->temakor_id);
     JRequest::setVar('szavazas', $this->szavazas_id);
     // adattábla tartalom elérése és átadása a view -nek
     $items = $this->model->getItems();
     //DBG echo $this->model->getDBO()->getQuery();
     if ($this->model->getError() != '') {
         $this->view->Msg = $this->model->getError();
     }
     $this->view->set('Items', $items);
     $this->view->set('Temakor', $this->temakor);
     $this->view->set('Szavazas', $this->szavazas);
     $this->view->set('Title', JText::_('ALTERNATIVAK'));
     // browser müködéshez linkek definiálása
     if ($this->szavazas->vita1 == 1) {
         $itemLink = JURI::base() . 'index.php?option=com_alternativak&view=alternativak' . '&task=edit' . '&limit=' . JRequest::getVar('limit', '20') . '&limitstart=0' . '&filterStr=' . urlencode($filterStr) . '&order=' . JRequest::getVar('order', '1') . '&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
     } else {
         $itemLink = '';
     }
     $backLink = JURI::base() . 'index.php?option=com_szavazasok&view=szavazasoklist' . '&temakor=' . $this->temakor_id . '&task=browse';
     $homeLink = JURI::base() . 'index.php?option=com_temakorok&view=temakoroklist' . '&task=browse';
     $this->view->set('itemLink', $itemLink);
     $this->view->set('backLink', $backLink);
     $this->view->set('homeLink', $homeLink);
     // van ált. képviselője?
     $altKepviseloje = 0;
     $db->setQuery('select k.kepviselo_id, u.name 
 from #__kepviselok k, #__users u
 where k.kepviselo_id = u.id and
         k.user_id = "' . $user->id . '" and k.temakor_id=0 and k.szavazas_id = 0 and
         k.lejarat >= "' . date('Y-m-d') . '"');
     $res = $db->loadObject();
     if ($db->getErrorNum() > 0) {
         $db->stderr();
     }
     if ($res) {
         $altKepviseloje = $res->kepviselo_id;
     }
     // van témakör képviselője?
     $kepviseloje = 0;
     $db->setQuery('select k.kepviselo_id, u.name 
 from #__kepviselok k, #__users u
 where k.kepviselo_id = u.id and
         k.user_id = "' . $user->id . '" and k.temakor_id=' . $this->temakor_id . ' and k.szavazas_id = 0 and
         k.lejarat >= "' . date('Y-m-d') . '"');
     $res = $db->loadObject();
     if ($db->getErrorNum() > 0) {
         $db->stderr();
     }
     if ($res) {
         $kepviseloje = $res->kepviselo_id;
     }
     // Ő maga képviselő jelölt?
     $kepviseloJelolt = false;
     $db->setQuery('select user_id 
 from #__kepviselojeloltek
 where  user_id = "' . $user->id . '"');
     $res = $db->loadObject();
     if ($db->getErrorNum() > 0) {
         $db->stderr();
     }
     if ($res) {
         $kepviseloJelolt = true;
     }
     // kik az alternativa felvivők?
     $alternativa_felvivo = $this->alternativa_felvivo();
     // akciók definiálása
     $akciok = array();
     if ($this->temakorokHelper->isAdmin($user) | $szavazas_felvivo == 10 & ($this->szavazas->szavazok = 1) & $user->id > 0 | $szavazas_felvivo == 10 & $this->userTag($this->temakor_id, $user) | $this->szavazasIndito($this->szavazas_id, $user)) {
         if ($this->szavazas->vita1 == 1) {
             $akciok['ujAlternativa'] = JURI::base() . 'index.php?option=com_' . $this->NAME . '&view=' . $this->NAME . '&task=add' . '&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id . '&limit=' . JRequest::getVar('limit', 20) . '&limitstart=' . JRequest::getVar('limitstart', 0) . '&order=' . JRequest::getVar('order', 1) . '&filterStr=' . JRequest::getVar('filterStr', '');
         }
     }
     if ($this->temakorokHelper->isAdmin($user) | $this->szavazas->letrehozo == $user->id) {
         $akciok['szavazasedit'] = JURI::base() . 'index.php?option=com_szavazasok&view=szavazasok&task=edit' . '&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
     }
     if ($this->temakorokHelper->isAdmin($user) | $this->szavazas->letrehozo == $user->id) {
         $akciok['szavazastorles'] = JURI::base() . 'index.php?option=com_szavazasok&view=szavazasok&task=deleteform' . '&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
     }
     if ($this->temakorokHelper->isAdmin($user) | $this->temakorIndito($this->temakor_id, $user)) {
         $akciok['temakoredit'] = JURI::base() . 'index.php?option=com_temakorok&view=temakorok&task=edit' . '&temakor=' . $this->temakor_id;
     }
     if ($this->temakorokHelper->isAdmin($user) | $this->temakorIndito($this->temakor_id, $user)) {
         $akciok['temakortorles'] = JURI::base() . 'index.php?option=com_temakorok&view=temakorok&task=deleteform' . '&temakor=' . $this->temakor_id;
     }
     if ($this->temakorokHelper->isAdmin($user) | $this->temakorIndito($this->temakor_id, $user)) {
         if ($this->szavazas->vita1 == 1) {
             $akciok['alternativaedit'] = JURI::base() . 'index.php?option=com_alternativak&view=alternativak&task=edit' . '&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
         }
     }
     if ($this->temakorokHelper->isAdmin($user) | $this->temakorIndito($this->temakor_id, $user)) {
         if ($this->szavazas->vita1 == 1) {
             $akciok['alternativatorles'] = JURI::base() . 'index.php?option=com_alternativak&view=alternativak&task=deleteform' . '&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
         }
     }
     if ($this->szavazas->szavazas == 1 & $user->id > 0) {
         $db = JFactory::getDBO();
         $db->setQuery('select id from #__szavazatok
   where szavazas_id="' . $this->szavazas_id . '" and
   user_id="' . $user->id . '"');
         $res = $db->loadObjectList();
         if (count($res) == 0) {
             $akciok['szavazok'] = JURI::base() . 'index.php?option=com_szavazasok&view=szavazasok&task=szavazoform&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
         }
     }
     if ($this->szavazas->lezart == 1) {
         $akciok['eredmeny'] = JURI::base() . 'index.php?option=com_szavazasok&view=szavazasok&task=eredmeny&temakor=' . $this->temakor_id . '&szavazas=' . $this->szavazas_id;
     }
     $akciok['tagok'] = JURI::base() . 'index.php?option=com_tagok&temakor=' . $this->temakor_id;
     $akciok['sugo'] = JURI::base() . 'index.php?option=com_content&view=article' . '&id=' . JText::_(strtoupper($this->NAME) . 'LIST_SUGO') . '&Itemid=435&tmpl=component';
     $this->view->set('Akciok', $akciok);
     // globális képviselő/képviselő jelölt gombok definiálása
     $altKepviselo = array();
     $altKepviselo['kepviselojeLink'] = '';
     $kepviselo = array();
     $kepviselo['kepviselojeLink'] = '';
     $kepviselo['kepviseloJeloltLink'] = '';
     $kepviselo['kepviselotValasztLink'] = '';
     $kepviselo['ujJeloltLink'] = '';
     if ($user->id > 0) {
         if ($altKepviseloje > 0) {
             $kepviseloUser = JFactory::getUser($altKepviseloje);
             if ($kepviseloUser) {
                 $userEx = HsUser::getInstance($altKepviseloje);
                 $altKepviselo['kepviselojeLink'] = JURI::base() . 'index.php?option=com_kepviselok&task=show&id=' . $altKepviseloje;
                 if (isset($userEx->image)) {
                     $altKepviselo['image'] = $userEx->get('image');
                 } else {
                     $altKepviselo['image'] = '<img src="components/com_hs_users/asset/images/noimage.png" width="50" height="50" />';
                 }
                 $altKepviselo['nev'] = $kepviseloUser->name;
             }
         }
         if ($kepviseloje > 0) {
             $kepviseloUser = JFactory::getUser($kepviseloje);
             if ($kepviseloUser) {
                 $userEx = HsUser::getInstance($kepviseloje);
                 $kepviselo['kepviselojeLink'] = JURI::base() . 'index.php?option=com_kepviselok&task=show&id=' . $kepviseloje;
                 if (isset($userEx->image)) {
                     $kepviselo['image'] = $userEx->get('image');
                 } else {
                     $kepviselo['image'] = '<img src="components/com_hs_users/asset/images/noimage.png" width="50" height="50" />';
                 }
                 $kepviselo['nev'] = $kepviseloUser->name;
             }
         } else {
             if ($kepviseloJelolt) {
                 $kepviselo['kepviseloJeloltLink'] = JURI::base() . 'index.php?option=com_kepviselo&task=edit&id=' . $user->id;
             } else {
                 $kepviselo['kepviselotValasztLink'] = JURI::base() . 'index.php?option=com_kepviselok&task=find&temekor=' . $this->temakor_id . '&szavazas=0';
                 $kepviselo['ujJeloltLink'] = JURI::base() . 'index.php?option=com_kepviselojeloltek&task=add&temekor=' . $this->temakor_id . '&szavazas=0&id=' . $user->id;
             }
         }
     }
     $this->view->set('Kepviselo', $kepviselo);
     $this->view->set('AltKepviselo', $altKepviselo);
     //lapozósor definiálása
     jimport('joomla.html.pagination');
     $total = $this->model->getTotal($filterStr);
     $pagination = new JPagination($total, $limitStart, $limit);
     $pagination->setAdditionalUrlParam('order', $order);
     $pagination->setAdditionalUrlParam('filterStr', urlencode($filterStr));
     $this->view->set('Lapozosor', $pagination->getListFooter());
     $this->view->display();
 }
示例#24
0
    function communitysurveys_show()
    {
        $db = JFactory::getDbo();
        $app = JFactory::getApplication();
        $limitstart = $app->getUserStateFromRequest(S_APP_NAME . '.acysurveys.limitstart', 'limitstart', 0, 'int');
        $limit = $app->input->getInt('limit', 20);
        $limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0;
        $content = '';
        $paramBase = S_APP_NAME . '.acysurveys';
        $pageInfo = new stdClass();
        $pageInfo->filter->order = $pageInfo->filter = new stdClass();
        $pageInfo->filter->order->value = $app->getUserStateFromRequest($paramBase . ".filter_order", 'filter_order', 'a.id', 'cmd');
        $pageInfo->filter->order->dir = $app->getUserStateFromRequest($paramBase . ".filter_order_Dir", 'filter_order_Dir', 'desc', 'word');
        $pageInfo->search = $app->getUserStateFromRequest($paramBase . ".search", 'search', '', 'string');
        $pageInfo->search = JString::strtolower($pageInfo->search);
        $query = '
				select 
					a.id, a.title, a.alias, a.created_by, a.created, u.name, u.username
				from
					#__survey a
				left join
					#__users u on a.created_by = u.id
				where
					a.published = 1
				order by
					a.created desc';
        $db->setQuery($query, $limitstart, $limit);
        $surveys = $db->loadObjectList();
        if (!empty($surveys)) {
            $query = 'select count(*) from #__survey a where a.published = 1';
            jimport('joomla.html.pagination');
            $db->setQuery($query);
            $total = $db->loadResult();
            $pagination = new JPagination($total, $limitstart, $limit);
            $content = '
						<table class="adminlist table table-striped table-hover" cellpadding="1" width="100%">
							<thead>
								<tr>
									<th class="title">' . JHTML::_('grid.sort', JText::_('FIELD_TITLE'), 'a.title', $pageInfo->filter->order->dir, $pageInfo->filter->order->value) . '</th>
									<th class="title">' . JHTML::_('grid.sort', JText::_('ACY_AUTHOR'), 'b.name', $pageInfo->filter->order->dir, $pageInfo->filter->order->value) . '</th>
									<th class="title">' . JHTML::_('grid.sort', JText::_('ACY_CREATED'), 'a.created', $pageInfo->filter->order->dir, $pageInfo->filter->order->value) . '</th>
									<th class="title titleid">' . JHTML::_('grid.sort', JText::_('ACY_ID'), 'a.id', $pageInfo->filter->order->dir, $pageInfo->filter->order->value) . '</th>
								</tr>
							</thead>
							<tfoot>
								<tr>
									<td colspan="5">' . $pagination->getListFooter() . $pagination->getResultsCounter() . '</td>
								</tr>
							</tfoot>
							<tbody>';
            foreach ($surveys as $row) {
                $k = 0;
                $content .= '<tr><td>';
                $text = '<b>' . JText::_('JOOMEXT_ALIAS') . ': </b>' . $row->alias;
                $content .= '<a href="#" onclick="setTag(\'{surveyurl:' . $row->id . '}\');insertTag();">' . acymailing_tooltip($text, $row->title, '', $row->title) . '</a>';
                $content .= '</td><td>';
                $text = '<b>' . JText::_('JOOMEXT_NAME') . ' : </b>' . $row->name;
                $text .= '<br/><b>' . JText::_('ACY_USERNAME') . ' : </b>' . $row->username;
                $text .= '<br/><b>' . JText::_('ACY_ID') . ' : </b>' . $row->created_by;
                $content .= acymailing_tooltip($text, $row->name, '', $row->name);
                $content .= '</td>
							<td align="center">' . JHTML::_('date', $row->created, JText::_('DATE_FORMAT_LC4')) . '</td>
							<td align="center">' . $row->id . '</td></tr>';
                $k = 1 - $k;
            }
            $content .= '</tbody></table>
					<input type="hidden" name="boxchecked" value="0" />
					<input type="hidden" name="filter_order" value="" />
					<input type="hidden" name="filter_order_Dir" value="" />';
        }
        echo $content;
    }
示例#25
0
    function acymailinghikaserial_show()
    {
        if (!$this->init()) {
            return 'Please install HikaSerial before using the HikaSerial tag plugin';
        }
        $app = JFactory::getApplication();
        $contentType = array();
        $pageInfo = new stdClass();
        $paramBase = ACYMAILING_COMPONENT . '.hikaserial';
        $pageInfo->filter->order->value = $app->getUserStateFromRequest($paramBase . ".filter_order", 'filter_order', 'a.pack_id', 'cmd');
        $pageInfo->filter->order->dir = $app->getUserStateFromRequest($paramBase . ".filter_order_Dir", 'filter_order_Dir', 'desc', 'word');
        $pageInfo->search = $app->getUserStateFromRequest($paramBase . ".search", 'search', '', 'string');
        $pageInfo->search = JString::strtolower($pageInfo->search);
        $pageInfo->lang = $app->getUserStateFromRequest($paramBase . ".lang", 'lang', '', 'string');
        $pageInfo->contenttype = $app->getUserStateFromRequest($paramBase . ".contenttype", 'contenttype', '|type:full', 'string');
        $pageInfo->limit->value = $app->getUserStateFromRequest($paramBase . '.list_limit', 'limit', $app->getCfg('list_limit'), 'int');
        $pageInfo->limit->start = $app->getUserStateFromRequest($paramBase . '.limitstart', 'limitstart', 0, 'int');
        $db = JFactory::getDBO();
        if (!empty($pageInfo->search)) {
            $searchVal = '\'%' . $db->getEscaped($pageInfo->search) . '%\'';
            $filters[] = 'a.pack_id LIKE ' . $searchVal . ' OR a.pack_name LIKE ' . $searchVal . ' OR a.pack_description LIKE ' . $searchVal;
        }
        $whereQuery = '';
        if (!empty($filters)) {
            $whereQuery = ' WHERE (' . implode(') AND (', $filters) . ')';
        }
        $query = 'SELECT SQL_CALC_FOUND_ROWS a.* FROM ' . acymailing::table('hikaserial_pack', false) . ' as a';
        if (!empty($whereQuery)) {
            $query .= $whereQuery;
        }
        if (!empty($pageInfo->filter->order->value)) {
            $query .= ' ORDER BY ' . $pageInfo->filter->order->value . ' ' . $pageInfo->filter->order->dir;
        }
        $db->setQuery($query, $pageInfo->limit->start, $pageInfo->limit->value);
        $rows = $db->loadObjectList();
        if (!empty($pageInfo->search)) {
            $rows = acymailing::search($pageInfo->search, $rows);
        }
        $db->setQuery('SELECT FOUND_ROWS()');
        $pageInfo->elements->total = $db->loadResult();
        $pageInfo->elements->page = count($rows);
        jimport('joomla.html.pagination');
        $pagination = new JPagination($pageInfo->elements->total, $pageInfo->limit->start, $pageInfo->limit->value);
        ?>
	<script language="javascript" type="text/javascript">
	<!--
	function updateTagProd(packid){
		tag = '{hikaserial_genpack:'+packid;
		for(var i=0; i < document.adminForm.contenttype.length; i++){
			 if (document.adminForm.contenttype[i].checked){ tag += document.adminForm.contenttype[i].value; }
		}
		tag += '}';
		setTag(tag);
		insertTag();
	}
	//-->
	</script>
	<table>
		<tr>
			<td width="100%">
				<?php 
        echo JText::_('JOOMEXT_FILTER');
        ?>
:
				<input type="text" name="search" id="acymailingsearch" value="<?php 
        echo $pageInfo->search;
        ?>
" class="text_area" onchange="document.adminForm.submit();" />
				<button class="btn" onclick="this.form.submit();"><?php 
        echo JText::_('JOOMEXT_GO');
        ?>
</button>
				<button class="btn" onclick="document.getElementById('acymailingsearch').value='';this.form.submit();"><?php 
        echo JText::_('JOOMEXT_RESET');
        ?>
</button>
			</td>
		</tr>
	</table>
<?php 
        ?>
	<table class="adminlist table table-striped" cellpadding="1" width="100%">
		<thead>
			<tr>
				<th class="title"><?php 
        echo JHTML::_('grid.sort', JText::_('HIKA_NAME'), 'a.pack_name', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
        ?>
</th>
				<th class="title titleid"><?php 
        echo JHTML::_('grid.sort', JText::_('ID'), 'a.pack_id', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
        ?>
</th>
			</tr>
		</thead>
		<tfoot>
			<tr>
				<td colspan="3">
					<?php 
        echo $pagination->getListFooter();
        ?>
					<?php 
        echo $pagination->getResultsCounter();
        ?>
				</td>
			</tr>
		</tfoot>
		<tbody>
<?php 
        $k = 0;
        for ($i = 0, $a = count($rows); $i < $a; $i++) {
            $row =& $rows[$i];
            ?>
			<tr id="content<?php 
            echo $row->pack_id;
            ?>
" class="row<?php 
            echo $k;
            ?>
" onclick="updateTagProd(<?php 
            echo $row->pack_id;
            ?>
);" style="cursor:pointer;">
				<td><?php 
            echo $row->pack_name;
            ?>
</td>
				<td align="center"><?php 
            echo $row->pack_id;
            ?>
</td>
			</tr>
<?php 
            $k = 1 - $k;
        }
        ?>
		</tbody>
	</table>
	<input type="hidden" name="boxchecked" value="0" />
	<input type="hidden" name="filter_order" value="<?php 
        echo $pageInfo->filter->order->value;
        ?>
" />
	<input type="hidden" name="filter_order_Dir" value="<?php 
        echo $pageInfo->filter->order->dir;
        ?>
" />
<?php 
    }
示例#26
0
    function acymailinghikashop_show()
    {
        $config = acymailing_config();
        if ($config->get('version') < '4.9.4') {
            acymailing_display('Please download and install the latest AcyMailing version otherwise this plugin will NOT work', 'error');
            return;
        }
        if (!$this->loadAcymailing()) {
            return 'Please install HikaShop before using the HikaShop tag plugin';
        }
        $app = JFactory::getApplication();
        $contentType = array();
        $contentType[] = JHTML::_('select.option', "title", JText::_('TITLE_ONLY'));
        $contentType[] = JHTML::_('select.option', "intro", JText::_('INTRO_ONLY'));
        $contentType[] = JHTML::_('select.option', "full", JText::_('FULL_TEXT'));
        $priceDisplay = array();
        $priceDisplay[] = JHTML::_('select.option', "full", JText::_('APPLY_DISCOUNTS'));
        $priceDisplay[] = JHTML::_('select.option', "no_discount", JText::_('NO_DISCOUNT'));
        $priceDisplay[] = JHTML::_('select.option', "none", JText::_('HIKASHOP_NO'));
        $pageInfo = new stdClass();
        $pageInfo->filter = new stdClass();
        $pageInfo->filter->order = new stdClass();
        $pageInfo->limit = new stdClass();
        $paramBase = ACYMAILING_COMPONENT . '.hikashop';
        $pageInfo->filter->order->value = $app->getUserStateFromRequest($paramBase . ".filter_order", 'filter_order', 'a.product_id', 'cmd');
        $pageInfo->filter->order->dir = $app->getUserStateFromRequest($paramBase . ".filter_order_Dir", 'filter_order_Dir', 'desc', 'word');
        if (strtolower($pageInfo->filter->order->dir) !== 'desc') {
            $pageInfo->filter->order->dir = 'asc';
        }
        $pageInfo->search = $app->getUserStateFromRequest($paramBase . ".search", 'search', '', 'string');
        $pageInfo->search = JString::strtolower(trim($pageInfo->search));
        $pageInfo->lang = $app->getUserStateFromRequest($paramBase . ".lang", 'lang', '', 'string');
        $pageInfo->contenttype = $app->getUserStateFromRequest($paramBase . ".contenttype", 'contenttype', 'full', 'string');
        $pageInfo->pricedisplay = $app->getUserStateFromRequest($paramBase . ".pricedisplay", 'pricedisplay', 'full', 'string');
        $pageInfo->limit->value = $app->getUserStateFromRequest($paramBase . '.list_limit', 'limit', $app->getCfg('list_limit'), 'int');
        $pageInfo->limit->start = $app->getUserStateFromRequest($paramBase . '.limitstart', 'limitstart', 0, 'int');
        if (!empty($pageInfo->search)) {
            $searchVal = '\'%' . acymailing_getEscaped($pageInfo->search) . '%\'';
            $filters[] = "a.product_id LIKE {$searchVal} OR a.product_description LIKE {$searchVal} OR a.product_name LIKE {$searchVal} OR a.product_code LIKE {$searchVal}";
        }
        $whereQuery = '';
        if (!empty($filters)) {
            $whereQuery = ' WHERE (' . implode(') AND (', $filters) . ')';
        }
        $query = 'SELECT SQL_CALC_FOUND_ROWS a.* FROM ' . acymailing_table('hikashop_product', false) . ' as a';
        if (!empty($whereQuery)) {
            $query .= $whereQuery;
        }
        if (!empty($pageInfo->filter->order->value)) {
            $query .= ' ORDER BY ' . $pageInfo->filter->order->value . ' ' . $pageInfo->filter->order->dir;
        }
        $this->db->setQuery($query, $pageInfo->limit->start, $pageInfo->limit->value);
        $rows = $this->db->loadObjectList();
        if (!empty($pageInfo->search)) {
            $rows = acymailing_search($pageInfo->search, $rows);
        }
        $this->db->setQuery('SELECT FOUND_ROWS()');
        $pageInfo->elements = new stdClass();
        $pageInfo->elements->total = $this->db->loadResult();
        $pageInfo->elements->page = count($rows);
        jimport('joomla.html.pagination');
        $pagination = new JPagination($pageInfo->elements->total, $pageInfo->limit->start, $pageInfo->limit->value);
        $tabs = acymailing_get('helper.acytabs');
        echo $tabs->startPane('hikashop_tab');
        echo $tabs->startPanel(JText::_('PRODUCTS'), 'hikashop_product');
        ?>
		<script language="javascript" type="text/javascript">
		<!--
			function updateTagProd(productid){
				var tag = '{hikashop_product:'+productid;
				for(var i=0; i < document.adminForm.contenttype.length; i++){
					 if (document.adminForm.contenttype[i].checked){ tag += '|type:'+document.adminForm.contenttype[i].value; }
				}
				for(i=0; i < document.adminForm.pricedisplay.length; i++){
					 if (document.adminForm.pricedisplay[i].checked){ tag += '|price:'+document.adminForm.pricedisplay[i].value; }
				}
				if(window.document.getElementById('jflang')  && window.document.getElementById('jflang').value != ''){
					tag += '|lang:';
					tag += window.document.getElementById('jflang').value;
				}
				tag += '}';
				setTag(tag);
				insertTag();
			}
		//-->
		</script>
		<table>
			<tr>
				<td width="100%">
					<?php 
        echo JText::_('JOOMEXT_FILTER');
        ?>
:
					<input type="text" name="search" id="acymailingsearch" value="<?php 
        echo $pageInfo->search;
        ?>
" class="text_area" onchange="document.adminForm.submit();" />
					<button class="btn" onclick="this.form.submit();"><?php 
        echo JText::_('JOOMEXT_GO');
        ?>
</button>
					<button class="btn" onclick="document.getElementById('acymailingsearch').value='';this.form.submit();"><?php 
        echo JText::_('JOOMEXT_RESET');
        ?>
</button>
				</td>
			</tr>
		</table>
		<table width="100%" class="adminform">
			<tr>
				<td>
					<?php 
        echo JText::_('DISPLAY');
        ?>
				</td>
				<td>
				<?php 
        echo JHTML::_('acyselect.radiolist', $contentType, 'contenttype', 'size="1"', 'value', 'text', $pageInfo->contenttype);
        ?>
				</td>
				<td>
					<?php 
        $jflanguages = acymailing_get('type.jflanguages');
        echo $jflanguages->display('lang', $pageInfo->lang);
        ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
        echo JText::_('PRICE');
        ?>
				</td>
				<td colspan="2">
				<?php 
        echo JHTML::_('acyselect.radiolist', $priceDisplay, 'pricedisplay', 'size="1"', 'value', 'text', $pageInfo->pricedisplay);
        ?>
				</td>
			</tr>
		</table>
		<table class="adminlist table table-striped" cellpadding="1" width="100%">
			<thead>
				<tr>
					<th></th>
					<th class="title">
						<?php 
        echo JHTML::_('grid.sort', JText::_('HIKA_NAME'), 'a.product_name', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
        ?>
					</th>
					<th class="title">
						<?php 
        echo JHTML::_('grid.sort', JText::_('HIKA_DESCRIPTION'), 'a.product_description', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
        ?>
					</th>
					<th class="title titleid">
						<?php 
        echo JHTML::_('grid.sort', JText::_('ID'), 'a.product_id', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
        ?>
					</th>
				</tr>
			</thead>
			<tfoot>
				<tr>
					<td colspan="4">
						<?php 
        echo $pagination->getListFooter();
        ?>
						<?php 
        echo $pagination->getResultsCounter();
        ?>
					</td>
				</tr>
			</tfoot>
			<tbody>
				<?php 
        $k = 0;
        for ($i = 0, $a = count($rows); $i < $a; $i++) {
            $row =& $rows[$i];
            ?>
					<tr id="content<?php 
            echo $row->product_id;
            ?>
" class="<?php 
            echo "row{$k}";
            ?>
" onclick="updateTagProd(<?php 
            echo $row->product_id;
            ?>
);" style="cursor:pointer;">
						<td class="acytdcheckbox"></td>
						<td>
						<?php 
            echo acymailing_tooltip('CODE : ' . $row->product_code, $row->product_name, '', $row->product_name);
            ?>
						</td>
						<td>
						<?php 
            echo $row->product_description;
            ?>
						</td>
						<td align="center">
							<?php 
            echo $row->product_id;
            ?>
						</td>
					</tr>
				<?php 
            $k = 1 - $k;
        }
        ?>
			</tbody>
		</table>
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="filter_order" value="<?php 
        echo $pageInfo->filter->order->value;
        ?>
" />
		<input type="hidden" name="filter_order_Dir" value="<?php 
        echo $pageInfo->filter->order->dir;
        ?>
" />
	<?php 
        echo $tabs->endPanel();
        echo $tabs->startPanel(JText::_('HIKA_CATEGORIES'), 'hikashop_auto');
        $type = JRequest::getString('type');
        $this->db->setQuery('SELECT * FROM ' . acymailing_table('hikashop_category', false) . ' WHERE category_type=\'product\' ORDER BY `category_ordering` ASC');
        $categories = $this->db->loadObjectList('category_id');
        $this->cats = array();
        foreach ($categories as $oneCat) {
            $this->cats[$oneCat->category_parent_id][] = $oneCat;
        }
        $catClass = hikashop_get('class.category');
        $root = $catClass->getRoot();
        ?>
	<script language="javascript" type="text/javascript">
		<!--
			var selectedCat = new Array();
			function applyAutoProduct(catid,rowClass){
				if(catid == 'all'){
					if(window.document.getElementById('product_cat'+catid).className == 'selectedrow'){
						window.document.getElementById('product_catall').className = rowClass;
					}else{
						window.document.getElementById('product_cat'+catid).className = 'selectedrow';
						for(var key in selectedCat)
						{
							if(!isNaN(key))
							{
								window.document.getElementById('product_cat'+key).className = rowClass;
								delete selectedCat[key];
							}
						}
					}
				}else{
					window.document.getElementById('product_catall').className = 'row0';
					if(selectedCat[catid]){
						window.document.getElementById('product_cat'+catid).className = rowClass;
						delete selectedCat[catid];
					}else{
						window.document.getElementById('product_cat'+catid).className = 'selectedrow';
						selectedCat[catid] = 'product';
					}
				}
				updateTagAuto();
			}

			function updateTagAuto(){
				var tag = '{hikashop_auto_product:';
				for(var icat in selectedCat){
					if(selectedCat[icat] == 'product'){
						tag += icat+'-';
					}
				}
				for(var i=0; i < document.adminForm.contenttypeauto.length; i++){
					 if (document.adminForm.contenttypeauto[i].checked){ tag += '| type:'+document.adminForm.contenttypeauto[i].value; }
				}


				if(document.adminForm.min_article && document.adminForm.min_article.value && document.adminForm.min_article.value!=0){ tag += '| min:'+document.adminForm.min_article.value; }
				if(document.adminForm.max_article.value && document.adminForm.max_article.value!=0){ tag += '| max:'+document.adminForm.max_article.value; }
				if(document.adminForm.contentorder.value){ tag += "| order:"+document.adminForm.contentorder.value+","+document.adminForm.contentorderdir.value; }
				if(document.adminForm.contentfilter && document.adminForm.contentfilter.value){ tag += '| filter:'+document.adminForm.contentfilter.value; }
				if(window.document.getElementById('jflang_auto') && window.document.getElementById('jflang_auto').value != ''){
					tag += '| lang:'+window.document.getElementById('jflang_auto').value;
				}
				for(i=0; i < document.adminForm.pricedisplayauto.length; i++){
					 if (document.adminForm.pricedisplayauto[i].checked){ tag += '| price:'+document.adminForm.pricedisplayauto[i].value; }
				}

				tag += '}';
				setTag(tag);
			}
		//-->
	</script>
	<table width="100%" class="adminform">
		<tr>
			<td>
				<?php 
        echo JText::_('DISPLAY');
        ?>
			</td>
			<td colspan="2">
			<?php 
        echo JHTML::_('acyselect.radiolist', $contentType, 'contenttypeauto', 'size="1" onclick="updateTagAuto();"', 'value', 'text', 'full');
        ?>
			</td>
			<td>
				<?php 
        $jflanguages = acymailing_get('type.jflanguages');
        if (!empty($jflanguages->values)) {
            $jflanguages->id = 'jflang_auto';
            $jflanguages->onclick = 'onchange="updateTagAuto();"';
            echo $jflanguages->display('language');
        }
        ?>
			</td>
		</tr>
		<tr>
			<td>
				<?php 
        echo JText::_('PRICE');
        ?>
			</td>
			<td colspan="3">
			<?php 
        echo JHTML::_('acyselect.radiolist', $priceDisplay, 'pricedisplayauto', 'size="1" onclick="updateTagAuto();"', 'value', 'text', 'full');
        ?>
			</td>
		</tr>
		<tr>
			<td>
				<label for="max_article"><?php 
        echo JText::_('MAX_ARTICLE');
        ?>
</label>
			</td>
			<td>
			 	<input type="text" name="max_article" id="max_article" style="width:50px" value="" onchange="updateTagAuto();"/>
			</td>
			<td>
				<?php 
        echo JText::_('ACY_ORDER');
        ?>
			</td>
			<td>
				<?php 
        $values = array('product_id' => 'ACY_ID', 'product_created' => 'CREATED_DATE', 'product_modified' => 'MODIFIED_DATE', 'product_name' => 'HIKA_TITLE');
        echo $this->acypluginsHelper->getOrderingField($values, 'product_id', 'DESC');
        ?>
			</td>
		</tr>
		<?php 
        if ($type == 'autonews') {
            ?>
		<tr>
			<td>
				<label for="min_article"><?php 
            echo JText::_('MIN_ARTICLE');
            ?>
</label>
			</td>
			<td>
				<input type="text" name="min_article" id="min_article" style="width:50px" value="1" onchange="updateTagAuto();"/>
			</td>
			<td>
				<?php 
            echo JText::_('FILTER');
            ?>
			</td>
			<td>
			 	<?php 
            $filter = acymailing_get('type.contentfilter');
            $filter->onclick = 'updateTagAuto();';
            echo $filter->display('contentfilter', 'created', false);
            ?>
			</td>
		</tr>
		<?php 
        }
        ?>
	</table>
	<table class="adminlist table table-striped" cellpadding="1" width="100%">
		<tr id="product_catall" class="<?php 
        echo "row0";
        ?>
" onclick="applyAutoProduct('all','<?php 
        echo "row{$k}";
        ?>
');" style="cursor:pointer;">
			<td class="acytdcheckbox"></td>
			<td><?php 
        echo JText::_('ACY_ALL');
        ?>
</td>
		</tr>
	<?php 
        $k = 0;
        echo $this->displayChildren($root, $k);
        ?>
	</table>
	<?php 
        echo $tabs->endPanel();
        echo $tabs->startPanel(JText::_('COUPONS'), 'hikashop_coupon');
        $currency = hikashop_get('type.currency');
        $config =& hikashop_config();
        ?>
		<script language="javascript" type="text/javascript">
		<!--
			function updateTag(){
				var tagname = document.adminForm.minimum_order.value+'|';
				tagname += document.adminForm.quota.value+'|';
				tagname += document.adminForm.start.value+'|';
				tagname += document.adminForm.end.value+'|';
				tagname += document.adminForm.percent_amount.value+'|';
				tagname += document.adminForm.flat_amount.value+'|';
				tagname += document.adminForm.currency_id.value+'|';
				tagname += document.adminForm.coupon_code.value+'|';
				tagname += document.adminForm.product_id.value;
				setTag('{hikashop_coupon:'+tagname+'}');
			}
		//-->
		</script>
		<table class="admintable" width="700px" style="margin:auto">
			<tr>
				<td>
					<table class="admintable" style="margin:auto">
						<tr>
							<td class="key">
								<label for="coupon_code">
									<?php 
        echo JText::_('DISCOUNT_CODE');
        ?>
								</label>
							</td>
							<td>
								<input type="text" id="coupon_code" onchange="updateTag();" value="[name][key][value]" />
							</td>
						</tr>
						<tr>
							<td class="key">
								<label for="flat_amount">
									<?php 
        echo JText::_('DISCOUNT_FLAT_AMOUNT');
        ?>
								</label>
							</td>
							<td>
								<input style="width:50px;" type="text" id="flat_amount" onchange="updateTag();" value="0" /><?php 
        echo $currency->display('currency_id', (int) $config->get('main_currency'), ' style="width:100px;" ');
        ?>
							</td>
						</tr>
						<tr>
							<td class="key">
								<label for="percent_amount">
									<?php 
        echo JText::_('DISCOUNT_PERCENT_AMOUNT');
        ?>
								</label>
							</td>
							<td>
								<input style="width:50px;" type="text" id="percent_amount" onchange="updateTag();" value="0" />
							</td>
						</tr>
					</table>
				</td>
				<td>
					<table class="admintable" style="margin:auto">
						<tr>
							<td class="key">
								<label for="start">
									<?php 
        echo JText::_('DISCOUNT_START_DATE');
        ?>
								</label>
							</td>
							<td>
								<?php 
        echo JHTML::_('calendar', '', 'start', 'start', '%Y-%m-%d %H:%M', array('style' => 'width:100px', 'onchange' => 'updateTag();'));
        ?>
							</td>
						</tr>
						<tr>
							<td class="key">
								<label for="end">
									<?php 
        echo JText::_('DISCOUNT_END_DATE');
        ?>
								</label>
							</td>
							<td>
								<?php 
        echo JHTML::_('calendar', '', 'end', 'end', '%Y-%m-%d %H:%M', array('style' => 'width:100px', 'onchange' => 'updateTag();'));
        ?>
							</td>
						</tr>
						<?php 
        if (hikashop_level(1)) {
            ?>
						<tr>
							<td class="key">
								<label for="minimum_order">
									<?php 
            echo JText::_('MINIMUM_ORDER_VALUE');
            ?>
								</label>
							</td>
							<td>
								<input style="width:50px;" type="text" id="minimum_order" value="0" onchange="updateTag();" />
							</td>
						</tr>
						<tr>
							<td class="key">
								<label for="quota">
									<?php 
            echo JText::_('DISCOUNT_QUOTA');
            ?>
								</label>
							</td>
							<td>
								<input style="width:50px;" type="text" id="quota" value="" onchange="updateTag();" />
							</td>
						</tr>
						<tr>
							<td class="key">
								<label for="product_id">
									<?php 
            echo JText::_('PRODUCT');
            ?>
								</label>
							</td>
							<td>
								<?php 
            $this->db->setQuery("SELECT `product_id`, CONCAT(product_name,' ( ',product_code,' )') as `title` FROM #__hikashop_product WHERE `product_type`='main' AND `product_published`=1  ORDER BY `product_code` ASC");
            $results = $this->db->loadObjectList();
            $obj = new stdClass();
            $obj->product_id = '';
            $obj->title = JText::_('HIKA_NONE');
            array_unshift($results, $obj);
            echo JHTML::_('select.genericlist', $results, 'product_id', 'size="1" style="width:150px;"  onchange="updateTag();"', 'product_id', 'title', '');
            ?>
							</td>
						</tr>
						<?php 
        } else {
            ?>
						<tr>
							<td>
								<input type="hidden" id="minimum_order" value="0" />
								<input type="hidden" id="quota" value="" />
							</td>
						</tr>
						<?php 
        }
        ?>
					</table>
				</td>
			</tr>
		</table>
<?php 
        echo $tabs->endPanel();
        echo $tabs->endPane();
    }
示例#27
0
 public function getListFooter($ajax = false)
 {
     if (!$ajax) {
         return parent::getListFooter();
     }
     $app = JFactory::getApplication();
     $list = array();
     $list['prefix'] = $this->prefix;
     $list['limit'] = $this->limit;
     $list['limitstart'] = $this->limitstart;
     $list['total'] = $this->total;
     $list['limitfield'] = $this->getLimitBox();
     $list['pagescounter'] = $this->getPagesCounter();
     //override getPageLinks to introduce ajax pagination...
     $list['pageslinks'] = $this->getPagesLinks();
     $chromePath = JPATH_THEMES . '/' . $app->getTemplate() . '/html/pagination.php';
     if (file_exists($chromePath)) {
         include_once $chromePath;
         if (function_exists('pagination_list_footer')) {
             return pagination_list_footer($list);
         }
     }
     return $this->_list_footer($list);
 }
示例#28
0
        } elseif ($item->state == JOOMDOC_STATE_TRASHED) {
            echo $trashed;
        }
        echo '</td>';
    }
    echo '<td nowrap="nowrap">' . JoomDOCFileSystem::getFileSize(JoomDOCFileSystem::getFullPath($item->path)) . '</td>';
    echo '<td nowrap="nowrap">' . JoomDOCHelper::uploaded($item->upload, false) . '</td>';
    echo '<td nowrap="nowrap">' . $item->name . '</td>';
    echo '<td class="center" nowrap="nowrap">' . JoomDOCHelper::number($item->hits) . '</td>';
    echo '</tr>';
}
echo '</tbody>';
echo '<tfoot>';
echo '<tr>';
$pagination = new JPagination($this->filter->total, $this->filter->offset, $this->filter->limit);
echo '<td colspan="20">' . $pagination->getListFooter() . '</td>';
echo '</tr>';
echo '</tfoot>';
echo '</table>';
echo JHtml::_('form.token');
echo '<input type="hidden" name="task" value="" />';
echo '<input type="hidden" name="boxchecked" value="" />';
echo '<input type="hidden" name="filter_order" value="' . $this->filter->listOrder . '" />';
echo '<input type="hidden" name="filter_order_Dir" value="' . $this->filter->listDirn . '" />';
echo '</form>';
//css fix. if error messages container is before component code (see isis template), left .span2 have margin-left 15, because it is not first-child
//so move mesages container inside right span10
if (JOOMDOC_ISJ3) {
    echo '</div>';
    //end #joomdoc div
    echo '<script type="text/javascript">if ($("system-message-container")) $("system-message-container").inject($("joomdoc"), "top")</script>';
示例#29
0
 function insertHTML()
 {
     $article = $this->article;
     $model = $this->getModel();
     $mainframe = JFactory::getApplication();
     $doc =& JFactory::getDocument();
     if (JPATH_BASE != JPATH_ADMINISTRATOR) {
         $doc->addStyleSheet('components/com_ginclude/css/general.css');
         $doc->addStyleSheet('components/com_ginclude/css/component.css');
     }
     if (@$_REQUEST['part'] != '') {
         $part = $_REQUEST['part'];
     } else {
         $part = -1;
     }
     $articleParts = $model->getParts($article->id, $part);
     $result = '';
     $result .= '<div style="position:relative;"><h3>' . JText::_('ARTICLE') . ': ' . $article->title . '</h3>';
     $result .= JText::_('SECTION') . ': <strong>' . $article->section . '</strong> ' . JText::_('CATEGORY') . ': <strong>' . $article->categorie . '</strong> ' . JText::_('CREATED') . ': <strong>' . $article->cdate . '</strong>';
     $result .= '<div style="position:absolute;right:5px;top:10px;"><button onclick="location.href=\'index.php?option=com_ginclude&task=articles&tmpl=component\';">' . JText::_('SELECT_OTHER_ARTICLE') . '</button></div>';
     $result .= '</div>';
     if ($articleParts === false) {
         /*clanek neni rozdelen na casti => nabidneme ho ke vlozeni cely*/
         $result .= '<div><a href="javascript:parent.gInclude(\'' . $article->id . '\',\'-1\');">' . JText::_('INSERT_FULL_ARTICLE') . '</a></div>';
     } else {
         /*nacetli jsme jednotlive sekce, tak zobrazime vyber*/
         /*strankovani*/
         $limit = JRequest::getVar('limit', $mainframe->getCfg(list_limit));
         $limitstart = JRequest::getVar('limitstart', 0);
         $articles = $model->getArticles(JRequest::getInt('section', -1), JRequest::getInt('categorie', -1), JRequest::getString('filter', ''), JRequest::getCmd('filter_order', 'title'), JRequest::getCmd('filter_order_Dir', 'asc'), $limitstart, $limit);
         $total = 0;
         /**/
         $result .= '<form action="index.php" id="adminForm" name="adminForm">
         <input type="hidden" name="article" value="' . $article->id . '" />
         <input type="hidden" name="tmpl" value="component" />
         <input type="hidden" name="task" value="insert" />
         <input type="hidden" name="option" value="com_ginclude" />
         <table class="adminlist" cellspacing="1">';
         $result .= '<thead><tr><th style="text-align:left;">' . JText::_('ARTICLE_SECTION') . ': <select name="part" onchange="document.getElementById(\'adminForm\').submit();"><option value="-1">--' . JText::_('SELECT') . '--</option>';
         if (count($articleParts['main']) > 0) {
             foreach ($articleParts['main'] as $key => $value) {
                 $result .= '<option value="' . $key . '"';
                 if ($key == $part) {
                     $result .= ' selected="selected" ';
                 }
                 $result .= '>' . $value . '</option>';
             }
         }
         $result .= '</select>';
         if ($part != -1) {
             $result .= '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:parent.gInclude(\'' . $article->id . '\',\'' . $part . '\');" style="font-weight:normal;">' . JText::_('INSERT_SECTION_CONTENT') . '</a>&nbsp;';
         }
         $result .= '</th></tr></thead>';
         if ($part == -1) {
             /*neni vybrana zadna sekce clanku -> musime vypsat info pro uzivatele*/
             $result .= '<tbody><tr><td>' . JText::_('ARTICLE_SECTION_SELECT') . '</td></tr></tbody>';
         } elseif (count($articleParts['part']) > 0) {
             /*v dané sekci jsou vložitelné oblasti*/
             $result .= '<tbody>';
             $rowClass = 'row1';
             $pos = -1;
             $max = $limit + $limitstart;
             if (count($articleParts['part']) > 0) {
                 foreach ($articleParts['part'] as $key => $value) {
                     $pos++;
                     if ($pos >= $limitstart && $pos < $max) {
                         if ($rowClass == 'row0') {
                             $rowClass = 'row1';
                         } else {
                             $rowClass = 'row0';
                         }
                         $result .= '<tr class="' . $rowClass . '"><td><a href="javascript:parent.gInclude(\'' . $article->id . '\',\'' . $key . '\');">' . $value . '</a></td></tr>';
                     }
                 }
             }
             $total = $pos + 1;
             $result .= '</tbody>';
         } else {
             /*nejsou žádné konkrétní obsahy*/
             $result .= '<tbody><tr class="row0"><td><a href="javascript:parent.gInclude(\'' . $article->id . '\',\'' . $part . '\');">' . JText::_('INSERT_CONTENT') . '...</a></td></tr></tbody>';
         }
         jimport('joomla.html.pagination');
         if ($total > 1) {
             $pageNav = new JPagination($total, $limitstart, $limit);
             $result .= '<tfoot><tr><td>' . $pageNav->getListFooter() . '</td></tr></tfoot></table>';
         }
         $result .= '</table>';
         $result .= '</form>';
     }
     return $result;
 }
示例#30
0
 public function getListFooter()
 {
     $footer = parent::getListFooter();
     $search = array(JText::_('Start'), JText::_('Prev'), JText::_('Next'), JText::_('End'));
     foreach ($search as $i => $s) {
         $search[$i] = '>' . $s . '<';
     }
     $search[] = 'class="container"';
     $replace = array('>' . aecHTML::Icon('fast-backward') . '<', '>' . aecHTML::Icon('backward') . '<', '>' . aecHTML::Icon('forward') . '<', '>' . aecHTML::Icon('fast-forward') . '<', 'class="pagination-container"');
     return str_replace($search, $replace, $footer);
 }