Example #1
0
 /**
  * Checks in the current item and displays the previous/next one in the list
  * @return unknown_type
  */
 function jump()
 {
     $model = $this->getModel($this->get('suffix'));
     $row = $model->getTable();
     $row->load($model->getId());
     if (isset($row->checked_out) && !JTable::isCheckedOut(JFactory::getUser()->id, $row->checked_out)) {
         $row->checkin();
     }
     $task = JRequest::getVar("task");
     $redirect = "index.php?option=com_tienda&view=products";
     Tienda::load("TiendaHelperProduct", 'helpers.product');
     $surrounding = TiendaHelperProduct::getSurrounding($model->getId());
     switch ($task) {
         case "prev":
             if (!empty($surrounding['prev'])) {
                 $redirect .= "&task=view&id=" . $surrounding['prev'];
             }
             break;
         case "next":
             if (!empty($surrounding['next'])) {
                 $redirect .= "&task=view&id=" . $surrounding['next'];
             }
             break;
     }
     $redirect = JRoute::_($redirect, false);
     $this->setRedirect($redirect, $this->message, $this->messagetype);
 }
Example #2
0
 function is_checkout($checked_out)
 {
     if ($this->user && JTable::isCheckedOut($this->user->get('id'), $checked_out)) {
         return true;
     }
     return false;
 }
Example #3
0
 function prepare(&$products)
 {
     // Get user
     $user = JFactory::getUser();
     // Get null date
     $db = JFactory::getDBO();
     $nullDate = $db->getNullDate();
     // Get trash state
     $mainframe = JFactory::getApplication();
     $option = JRequest::getCmd('option');
     $view = JRequest::getCmd('view');
     $trash = $mainframe->getUserStateFromRequest("{$option}.{$view}.trash", 'trash', -1, 'int');
     // Require Virtuemart classes for price display
     require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'config.php';
     require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'currencydisplay.php';
     $currency = CurrencyDisplay::getInstance();
     // Cast the input to array
     if (!is_array($products)) {
         $rows = array($products);
     } else {
         $rows = $products;
     }
     // Prepare the products
     foreach ($rows as $key => $product) {
         $product->parity = $key % 2;
         $product->key = $key + 1;
         $product->checkout = JHTML::_('grid.checkedout', $product, $key);
         $product->price = $currency->priceDisplay($product->price, (int) $product->currency, true);
         $product->featuredToggler = K2martHTMLHelper::stateToggler($product, $key, 'featured', array('K2MART_FEATURED', 'K2MART_NOT_FEATURED'), array('K2MART_REMOVE_FEATURED_FLAG', 'K2MART_FLAG_AS_FEATURED'));
         $product->publishedToggler = K2martHTMLHelper::stateToggler($product, $key, 'published', array('K2MART_PUBLISHED', 'K2MART_UNPUBLISHED'), array('K2MART_UNPUBLISH', 'K2MART_PUBLISH'));
         if (JTable::isCheckedOut($user->get('id'), $product->checked_out) || $trash == 1) {
             $product->link = false;
             $product->featuredToggler = strip_tags($product->featuredToggler, '<img>');
             $product->publishedToggler = strip_tags($product->publishedToggler, '<img>');
         } else {
             $product->link = JRoute::_('index.php?option=com_k2&view=item&cid=' . $product->id);
         }
         $product->categoryLink = JRoute::_('index.php?option=com_k2&view=category&cid=' . $product->catid);
         if (JFile::exists(JPATH_SITE . DS . 'media' . DS . 'k2' . DS . 'items' . DS . 'cache' . DS . md5("Image" . $product->id) . '_XL.jpg')) {
             $product->image = JURI::root(true) . '/media/k2/items/cache/' . md5("Image" . $product->id) . '_XL.jpg';
         } else {
             $product->image = false;
         }
         $product->created = JHTML::_('date', $product->created);
         $product->modified = $product->modified == $nullDate ? JText::_('K2MART_NEVER') : JHTML::_('date', $product->modified);
     }
 }
Example #4
0
    function getModulesTable($id)
    {
        JHTML::_('behavior.modal');
        $user =& JFactory::getUser();
        $modules = $this->getAdvancedModules($id);
        if (!count($modules)) {
            return '<p style="text-align:center;">' . JText::_('AMM_NO_ACTIVE_MODULES') . '</p>';
        }
        $table = '
			<table class="adminlist" cellspacing="1">
				<thead>
					<tr>
						<th>' . JText::_('Module Name') . '</th>
						<th>' . JText::_('Position') . '</th>
						<th>' . JText::_('Type') . '</th>
						<th>' . JText::_('Access') . '</th>
						<th>' . JText::_('ID') . '</th>
					</tr>
				</thead>
				<tbody>';
        foreach ($modules as $module) {
            $access = JHTML::_('grid.access', $module, NULL, 1);
            if (JTable::isCheckedOut($user->get('id'), $module->checked_out)) {
                $title = $module->title;
            } else {
                $link = JRoute::_('index.php?option=com_advancedmodules&client=0&task=edit&tmpl=component&cid[]=' . $module->id);
                $title = '
					<span class="editlinktip hasTip" title="' . JText::_('AMM_EDIT_MODULE') . '::' . $module->title . '">
						<a href="' . $link . '" class="modal" rel="{handler: \'iframe\', size: {x:window.getSize().scrollSize.x-100, y: window.getSize().size.y-100}}">' . $module->title . '</a>
					</span>';
            }
            $table .= '
					<tr>
						<td>' . $title . '</td>
						<td>' . $module->position . '</td>
						<td>' . $module->module . '</td>
						<td>' . $access . '</td>
						<td>' . $module->id . '</td>
					</tr>';
        }
        $table .= '
				</tbody>
			</table>';
        return $table;
    }
Example #5
0
 public static function checkedOut(&$row, $i, $identifier = 'id')
 {
     $user =& JFactory::getUser();
     $userid = $user->get('id');
     $result = false;
     if (is_a($row, 'JTable')) {
         $result = $row->isCheckedOut($userid);
     } else {
         $result = JTable::isCheckedOut($userid, $row->checked_out);
     }
     $checked = '';
     if ($result) {
         $checked = JHTMLGrid::_checkedOut($row);
     } else {
         $checked = JHTML::_('grid.id', $i, $row->{$identifier});
     }
     return $checked;
 }
Example #6
0
 /**
  * @function checkedOutRadio
  * abstract a little edited default function, just display radio buttons instead checkboxes
  */
 function checkedOutRadio(&$row, $i, $identifier = 'id')
 {
     $user =& JFactory::getUser();
     $userid = $user->get('id');
     $result = false;
     if (is_a($row, 'JTable')) {
         $result = $row->isCheckedOut($userid);
     } else {
         $result = JTable::isCheckedOut($userid, $row->checked_out);
     }
     $checked = '';
     if ($result) {
         $checked = JHTMLGrid::_checkedOut($row);
     } else {
         echo $this->idRadio($i, $row->name);
     }
     return $checked;
 }
Example #7
0
    echo "row{$k}";
    ?>
">
		<td align="right">
			<?php 
    echo $this->pagination->getRowOffset($i);
    ?>
		</td>
		<td>
			<?php 
    echo $checked;
    ?>
		</td>
		<td>
			<?php 
    if (JTable::isCheckedOut($this->user->get('id'), $row->checked_out) || !$row->editable) {
        echo $row->title;
    } else {
        ?>
				<span class="editlinktip hasTip" title="<?php 
        echo JText::_('Edit Plugin');
        ?>
::<?php 
        echo $row->title;
        ?>
">
				<a href="<?php 
        echo $link;
        ?>
">
					<?php 
    /**
     * @param array An array of data objects
     * @param object A page navigation object
     * @param string The option
     */
    function showTemplates(&$rows, &$lists, &$page, $option, &$client)
    {
        global $mainframe;
        $limitstart = JRequest::getVar('limitstart', '0', '', 'int');
        $user =& JFactory::getUser();
        if (isset($row->authorUrl) && $row->authorUrl != '') {
            $row->authorUrl = str_replace('http://', '', $row->authorUrl);
        }
        JHTML::_('behavior.tooltip');
        ?>
		<form action="index.php" method="post" name="adminForm">

			<table class="adminlist">
			<thead>
				<tr>
					<th width="5" class="title">
						<?php 
        echo JText::_('Num');
        ?>
					</th>
					<th class="title" colspan="2">
						<?php 
        echo JText::_('Template Name');
        ?>
					</th>
					<?php 
        if ($client->id == 1) {
            ?>
						<th width="5%">
							<?php 
            echo JText::_('Default');
            ?>
						</th>
						<?php 
        } else {
            ?>
						<th width="5%">
							<?php 
            echo JText::_('Default');
            ?>
						</th>
						<th width="5%">
							<?php 
            echo JText::_('Assigned');
            ?>
						</th>
						<?php 
        }
        ?>
					<th width="10%" align="center">
						<?php 
        echo JText::_('Version');
        ?>
					</th>
					<th width="15%" class="title">
						<?php 
        echo JText::_('Date');
        ?>
					</th>
					<th width="25%"  class="title">
						<?php 
        echo JText::_('Author');
        ?>
					</th>
				</tr>
			</thead>
			<tfoot>
				<tr>
					<td colspan="8">
						<?php 
        echo $page->getListFooter();
        ?>
					</td>
				</tr>
			</tfoot>
			<tbody>
			<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $author_info = @$row->authorEmail . '<br />' . @$row->authorUrl;
            ?>
				<tr class="<?php 
            echo 'row' . $k;
            ?>
">
					<td>
						<?php 
            echo $page->getRowOffset($i);
            ?>
					</td>
					<td width="5">
					<?php 
            if (JTable::isCheckedOut($user->get('id'), $row->checked_out)) {
                ?>
							&nbsp;
							<?php 
            } else {
                ?>
							<input type="radio" id="cb<?php 
                echo $i;
                ?>
" name="cid[]" value="<?php 
                echo $row->directory;
                ?>
" onclick="isChecked(this.checked);" />
							<?php 
            }
            ?>
					</td>
					<td><?php 
            $img_path = ($client->id == 1 ? JURI::root() . 'administrator' : $mainframe->getSiteURL()) . '/templates/' . $row->directory . '/template_thumbnail.png';
            ?>
						<span class="editlinktip hasTip" title="<?php 
            echo $row->name;
            ?>
::
<img border=&quot;1&quot; src=&quot;<?php 
            echo $img_path;
            ?>
&quot; name=&quot;imagelib&quot; alt=&quot;<?php 
            echo JText::_('No preview available');
            ?>
&quot; width=&quot;206&quot; height=&quot;145&quot; />"><a href="index.php?option=com_templates&amp;task=edit&amp;cid[]=<?php 
            echo $row->directory;
            ?>
&amp;client=<?php 
            echo $client->id;
            ?>
">
							<?php 
            echo $row->name;
            ?>
</a></span>
					</td>
					<?php 
            if ($client->id == 1) {
                ?>
						<td align="center">
							<?php 
                if ($row->published == 1) {
                    ?>
							<img src="templates/khepri/images/menu/icon-16-default.png" alt="<?php 
                    echo JText::_('Published');
                    ?>
" />
								<?php 
                } else {
                    ?>
								&nbsp;
								<?php 
                }
                ?>
						</td>
						<?php 
            } else {
                ?>
						<td align="center">
							<?php 
                if ($row->published == 1) {
                    ?>
								<img src="templates/khepri/images/menu/icon-16-default.png" alt="<?php 
                    echo JText::_('Default');
                    ?>
" />
								<?php 
                } else {
                    ?>
								&nbsp;
								<?php 
                }
                ?>
						</td>
						<td align="center">
							<?php 
                if ($row->assigned == 1) {
                    ?>
								<img src="images/tick.png" alt="<?php 
                    echo JText::_('Assigned');
                    ?>
" />
								<?php 
                } else {
                    ?>
								&nbsp;
								<?php 
                }
                ?>
						</td>
						<?php 
            }
            ?>
					<td align="center">
						<?php 
            echo $row->version;
            ?>
					</td>
					<td>
						<?php 
            echo $row->creationdate;
            ?>
					</td>
					<td>
						<span class="editlinktip hasTip" title="<?php 
            echo JText::_('Author Information');
            ?>
::<?php 
            echo $author_info;
            ?>
">
							<?php 
            echo @$row->author != '' ? $row->author : '&nbsp;';
            ?>
						</span>
					</td>
				</tr>
				<?php 
        }
        ?>
			</tbody>
			</table>

	<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
	<input type="hidden" name="client" value="<?php 
        echo $client->id;
        ?>
" />
	<input type="hidden" name="task" value="" />
	<input type="hidden" name="boxchecked" value="0" />
	<?php 
        echo JHTML::_('form.token');
        ?>
	</form>
	<?php 
    }
    $checked = JHTML::_('grid.checkedout', $row, $i);
    ?>
					<tr class="<?php 
    echo "row{$k}";
    ?>
">
						<td class="center"><?php 
    echo $this->pagination->getRowOffset($i);
    ?>
</td>
						<td class="center"><?php 
    echo $checked;
    ?>
</td>
						<?php 
    if (JTable::isCheckedOut($this->user->get('id'), $row->checked_out)) {
        $inputappend = ' disabled="disabled"';
        ?>
<td class="center">&nbsp;</td><?php 
    } else {
        $inputappend = '';
        ?>
							<td class="center">
								<a href="<?php 
        echo $link;
        ?>
">
									<?php 
        $imageTitle = JText::_('COM_JOOMLEAGUE_ADMIN_COUNTRIES_EDIT_DETAILS');
        echo JHTML::_('image', 'administrator/components/com_joomleague/assets/images/edit.png', $imageTitle, 'title= "' . $imageTitle . '"');
        ?>
Example #10
0
function showAdministration($option)
{
    $kunena_app = JFactory::getApplication();
    $kunena_db = JFactory::getDBO();
    $kunena_acl = JFactory::getACL();
    $filter_order = $kunena_app->getUserStateFromRequest($option . 'filter_order', 'filter_order', 'ordering', 'cmd');
    $filter_order_Dir = $kunena_app->getUserStateFromRequest($option . 'filter_order_Dir', 'filter_order_Dir', 'asc', 'word');
    if ($filter_order_Dir != 'asc') {
        $filter_order_Dir = 'desc';
    }
    $limit = $kunena_app->getUserStateFromRequest("global.list.limit", 'limit', $kunena_app->getCfg('list_limit'), 'int');
    $limitstart = $kunena_app->getUserStateFromRequest("{$option}.limitstart", 'limitstart', 0, 'int');
    $levellimit = $kunena_app->getUserStateFromRequest("{$option}.limit", 'levellimit', 10, 'int');
    $search = $kunena_app->getUserStateFromRequest($option . 'search', 'search', '', 'string');
    $search = JString::strtolower($search);
    $order = '';
    if ($filter_order == 'ordering') {
        $order = ' ORDER BY a.ordering ' . $filter_order_Dir;
    } else {
        if ($filter_order == 'name') {
            $order = ' ORDER BY a.name ' . $filter_order_Dir;
        } else {
            if ($filter_order == 'id') {
                $order = ' ORDER BY a.id ' . $filter_order_Dir;
            }
        }
    }
    $where = '';
    if ($search) {
        $where .= ' WHERE LOWER( a.name ) LIKE ' . $kunena_db->Quote('%' . $kunena_db->getEscaped($search, true) . '%', false) . ' OR LOWER( a.id ) LIKE ' . $kunena_db->Quote('%' . $kunena_db->getEscaped($search, true) . '%', false);
    }
    if (KUNENA_JOOMLA_COMPAT == '1.5') {
        // Joomla 1.5
        $query = "SELECT a.*, a.parent>0 AS category, u.name AS editor, g.name AS groupname, g.id AS group_id, h.name AS admingroup, v.name AS viewlevel\n\t\t\tFROM #__kunena_categories AS a\n\t\t\tLEFT JOIN #__users AS u ON u.id = a.checked_out\n\t\t\tLEFT JOIN #__core_acl_aro_groups AS g ON a.accesstype='none' AND  g.id = a.pub_access\n\t\t\tLEFT JOIN #__core_acl_aro_groups AS h ON a.accesstype='none' AND  h.id = a.admin_access\n\t\t\tLEFT JOIN #__groups AS v ON a.accesstype='joomla.level' AND v.id = a.access\n\t\t\t" . $where . $order;
    } else {
        // Joomla 1.6
        $query = "SELECT a.*, a.parent>0 AS category, u.name AS editor, g.title AS groupname, h.title AS admingroup, v.title AS viewlevel\n\t\t\tFROM #__kunena_categories AS a\n\t\t\tLEFT JOIN #__users AS u ON u.id = a.checked_out\n\t\t\tLEFT JOIN #__usergroups AS g ON a.accesstype='none' AND g.id = a.pub_access\n\t\t\tLEFT JOIN #__usergroups AS h ON a.accesstype='none' AND  h.id = a.admin_access\n\t\t\tLEFT JOIN #__viewlevels AS v ON a.accesstype='joomla.level' AND v.id = a.access\n\t\t\t" . $where . $order;
    }
    $kunena_db->setQuery($query);
    $rows = $kunena_db->loadObjectList('id');
    KunenaError::checkDatabaseError();
    // establish the hierarchy of the categories
    $children = array(0 => array());
    // first pass - collect children
    foreach ($rows as $v) {
        $list = array();
        $vv = $v;
        while ($vv->parent > 0 && isset($rows[$vv->parent]) && !in_array($vv->parent, $list)) {
            $list[] = $vv->id;
            $vv = $rows[$vv->parent];
        }
        if ($vv->parent) {
            $v->parent = -1;
            if (empty($search)) {
                $v->published = 0;
            }
            if (empty($search)) {
                $v->name = JText::_('COM_KUNENA_CATEGORY_ORPHAN') . ' : ' . $v->name;
            }
        }
        if ($v->accesstype == 'joomla.level') {
            if (KUNENA_JOOMLA_COMPAT == '1.5') {
                $v->accessname = JText::_('COM_KUNENA_INTEGRATION_JOOMLA_LEVEL') . ': ' . ($v->viewlevel ? JText::_($v->viewlevel) : JText::_('COM_KUNENA_NOBODY'));
            } else {
                $v->accessname = JText::_('COM_KUNENA_INTEGRATION_JOOMLA_LEVEL') . ': ' . ($v->viewlevel ? $v->viewlevel : JText::_('COM_KUNENA_NOBODY'));
            }
        } elseif ($v->accesstype != 'none') {
            $v->accessname = JText::_('COM_KUNENA_INTEGRATION_' . strtoupper(preg_replace('/[^\\w\\d]+/', '_', $v->accesstype))) . ': ' . $v->access;
        } elseif (KUNENA_JOOMLA_COMPAT == '1.5') {
            // Joomla 1.5
            if ($v->pub_access == 0) {
                $v->accessname = JText::_('COM_KUNENA_PUBLIC');
            } else {
                if ($v->pub_access == -1) {
                    $v->accessname = JText::_('COM_KUNENA_ALLREGISTERED');
                } else {
                    if ($v->pub_access == 1 || !$v->groupname) {
                        $v->accessname = JText::_('COM_KUNENA_NOBODY');
                    } else {
                        $v->accessname = JText::sprintf($v->pub_recurse ? 'COM_KUNENA_A_GROUP_X_PLUS' : 'COM_KUNENA_A_GROUP_X_ONLY', JText::_($v->groupname));
                    }
                }
            }
            if ($v->pub_access > 0 && $v->admingroup && $v->pub_access != $v->admin_access) {
                $v->accessname .= ' / ' . JText::sprintf($v->admin_recurse ? 'COM_KUNENA_A_GROUP_X_PLUS' : 'COM_KUNENA_A_GROUP_X_ONLY', JText::_($v->admingroup));
            }
        } else {
            // Joomla 1.6+
            $v->accessname = JText::sprintf($v->pub_recurse ? 'COM_KUNENA_A_GROUP_X_PLUS' : 'COM_KUNENA_A_GROUP_X_ONLY', $v->groupname ? JText::_($v->groupname) : JText::_('COM_KUNENA_NOBODY'));
            if ($v->admingroup && $v->pub_access != $v->admin_access) {
                $v->accessname .= ' / ' . JText::sprintf($v->admin_recurse ? 'COM_KUNENA_A_GROUP_X_PLUS' : 'COM_KUNENA_A_GROUP_X_ONLY', JText::_($v->admingroup));
            }
        }
        if ($v->checked_out && !JTable::isCheckedOut(0, intval($v->checked_out))) {
            $v->checked_out = 0;
            $v->editor = '';
        }
        $children[$v->parent][] = $v;
        $v->location = count($children[$v->parent]) - 1;
    }
    if (isset($children[-1])) {
        $children[0] = array_merge($children[-1], $children[0]);
        if (empty($search)) {
            $kunena_app->enqueueMessage(JText::_('COM_KUNENA_CATEGORY_ORPHAN_DESC'), 'notice');
        }
    }
    // second pass - get an indent list of the items
    $list = fbTreeRecurse(0, '', array(), $children, max(0, $levellimit - 1));
    $total = count($list);
    if ($limitstart >= $total) {
        $limitstart = 0;
    }
    jimport('joomla.html.pagination');
    $pageNav = new JPagination($total, $limitstart, $limit);
    $levellist = JHTML::_('select.integerList', 1, 20, 1, 'levellimit', 'size="1" onchange="document.adminForm.submit();"', $levellimit);
    // slice out elements based on limits
    $list = array_slice($list, $pageNav->limitstart, $pageNav->limit);
    /**
     *@end
     */
    // table ordering
    $lists['order_Dir'] = $filter_order_Dir;
    $lists['order'] = $filter_order;
    $lists['search'] = $search;
    html_Kunena::showAdministration($list, $children, $pageNav, $option, $lists);
}
    function showNewsFeeds(&$rows, &$lists, &$pageNav, $option)
    {
        global $mainframe;
        $user =& JFactory::getUser();
        //Ordering allowed ?
        $ordering = $lists['order'] == 'a.ordering';
        JHTML::_('behavior.tooltip');
        ?>
		<form action="index.php?option=com_newsfeeds" method="post" name="adminForm">

		<table>
		<tr>
			<td align="left" width="100%">
				<?php 
        echo JText::_('Filter');
        ?>
:
				<input type="text" name="search" id="search" value="<?php 
        echo $lists['search'];
        ?>
" class="text_area" onchange="document.adminForm.submit();" />
				<button onclick="this.form.submit();"><?php 
        echo JText::_('Go');
        ?>
</button>
				<button onclick="document.getElementById('search').value='';this.form.getElementById('filter_catid').value='0';this.form.getElementById('filter_state').value='';this.form.submit();"><?php 
        echo JText::_('Reset');
        ?>
</button>
			</td>
			<td nowrap="nowrap">
				<?php 
        echo $lists['catid'];
        echo $lists['state'];
        ?>
			</td>
		</tr>
		</table>

			<table class="adminlist">
			<thead>
				<tr>
					<th width="10">
						<?php 
        echo JText::_('NUM');
        ?>
					</th>
					<th width="10">
						<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
					</th>
					<th class="title">
						<?php 
        echo JHTML::_('grid.sort', 'News Feed', 'a.name', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="5%">
						<?php 
        echo JHTML::_('grid.sort', 'Published', 'a.published', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="8%" nowrap="nowrap">
						<?php 
        echo JHTML::_('grid.sort', 'Order', 'a.ordering', @$lists['order_Dir'], @$lists['order']);
        ?>
						<?php 
        echo JHTML::_('grid.order', $rows);
        ?>
					</th>
					<th class="title" width="10%">
						<?php 
        echo JHTML::_('grid.sort', 'Category', 'catname', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="5%" nowrap="nowrap">
						<?php 
        echo JHTML::_('grid.sort', 'Num Articles', 'a.numarticles', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="5%">
						<?php 
        echo JHTML::_('grid.sort', 'Cache time', 'a.cache_time', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="1%" nowrap="nowrap">
						<?php 
        echo JHTML::_('grid.sort', 'ID', 'a.id', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
				</tr>
			</thead>
			<tfoot>
				<tr>
					<td colspan="10">
						<?php 
        echo $pageNav->getListFooter();
        ?>
					</td>
				</tr>
			</tfoot>
			<tbody>
			<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $link = JRoute::_('index.php?option=com_newsfeeds&task=edit&cid[]=' . $row->id);
            $checked = JHTML::_('grid.checkedout', $row, $i);
            $published = JHTML::_('grid.published', $row, $i);
            $row->cat_link = JRoute::_('index.php?option=com_categories&section=com_newsfeeds&task=edit&cid[]=' . $row->catid);
            ?>
				<tr class="<?php 
            echo 'row' . $k;
            ?>
">
					<td align="center">
						<?php 
            echo $pageNav->getRowOffset($i);
            ?>
					</td>
					<td>
						<?php 
            echo $checked;
            ?>
					</td>
					<td>
						<?php 
            if (JTable::isCheckedOut($user->get('id'), $row->checked_out)) {
                echo $row->name;
            } else {
                ?>
								<span class="editlinktip hasTip" title="<?php 
                echo JText::_('Edit Newsfeed');
                ?>
::<?php 
                echo $row->name;
                ?>
">
							<a href="<?php 
                echo $link;
                ?>
">
								<?php 
                echo $row->name;
                ?>
</a></span>
							<?php 
            }
            ?>
					</td>
					<td align="center">
						<?php 
            echo $published;
            ?>
					</td>
					<td class="order">
						<span><?php 
            echo $pageNav->orderUpIcon($i, $row->catid == @$rows[$i - 1]->catid, 'orderup', 'Move Up', $ordering);
            ?>
</span>
						<span><?php 
            echo $pageNav->orderDownIcon($i, $n, $row->catid == @$rows[$i + 1]->catid, 'orderdown', 'Move Down', $ordering);
            ?>
</span>
						<?php 
            $disabled = $ordering ? '' : 'disabled="disabled"';
            ?>
						<input type="text" name="order[]" size="5" value="<?php 
            echo $row->ordering;
            ?>
" <?php 
            echo $disabled;
            ?>
 class="text_area" style="text-align: center" />
					</td>
					<td>
						<a href="<?php 
            echo $row->cat_link;
            ?>
" title="<?php 
            echo JText::_('Edit Category');
            ?>
">
							<?php 
            echo $row->catname;
            ?>
</a>
					</td>
					<td align="center">
						<?php 
            echo $row->numarticles;
            ?>
					</td>
					<td align="center">
						<?php 
            echo $row->cache_time;
            ?>
					</td>
					<td align="center">
						<?php 
            echo $row->id;
            ?>
					</td>
				</tr>
				<?php 
            $k = 1 - $k;
        }
        ?>
			</tbody>
			</table>

			<table class="adminform">
			<tr>
				<td>
					<table align="center">
					<?php 
        $visible = 0;
        // check to hide certain paths if not super admin
        if ($user->get('gid') == 25) {
            $visible = 1;
        }
        HTML_newsfeeds::writableCell(JPATH_SITE . DS . 'cache', 0, '<strong>' . JText::_('Cache Directory') . '</strong> ', $visible);
        ?>
					</table>
				</td>
			</tr>
			</table>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="filter_order" value="<?php 
        echo $lists['order'];
        ?>
" />
		<input type="hidden" name="filter_order_Dir" value="<?php 
        echo $lists['order_Dir'];
        ?>
" />
		<?php 
        echo JHTML::_('form.token');
        ?>
		</form>
		<?php 
    }
Example #12
0
    function clients(&$rows, &$pageNav, &$lists)
    {
        BannersViewClients::setClientsToolbar();
        $user =& JFactory::getUser();
        JHTML::_('behavior.tooltip');
        ?>
		<form action="index.php" method="post" name="adminForm">

			<table>
			<tr>
				<td align="left" width="100%">
					<?php 
        echo JText::_('Filter');
        ?>
:
					<input type="text" name="search" id="search" value="<?php 
        echo $lists['search'];
        ?>
" class="text_area" onchange="document.adminForm.submit();" />
					<button onclick="this.form.submit();"><?php 
        echo JText::_('Go');
        ?>
</button>
					<button onclick="document.getElementById('search').value='';this.form.submit();"><?php 
        echo JText::_('Reset');
        ?>
</button>
				</td>
				<td nowrap="nowrap">
				</td>
			</tr>
			</table>

			<table class="adminlist">
			<thead>
			<tr>
				<th width="20">
					<?php 
        echo JText::_('Num');
        ?>
				</th>
				<th width="20">
					<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
				</th>
				<th nowrap="nowrap" class="title">
					<?php 
        echo JHTML::_('grid.sort', 'Client Name', 'a.name', @$lists['order_Dir'], @$lists['order']);
        ?>
				</th>
				<th nowrap="nowrap" class="title" width="35%">
					<?php 
        echo JHTML::_('grid.sort', 'Contact', 'a.contact', @$lists['order_Dir'], @$lists['order']);
        ?>
				</th>
				<th align="center" nowrap="nowrap" width="5%">
					<?php 
        echo JHTML::_('grid.sort', 'No. of Active Banners', 'bid', @$lists['order_Dir'], @$lists['order']);
        ?>
				</th>
				<th width="1%" nowrap="nowrap">
					<?php 
        echo JHTML::_('grid.sort', 'ID', 'a.cid', @$lists['order_Dir'], @$lists['order']);
        ?>
				</th>
			</tr>
			</thead>
			<tfoot>
			<tr>
				<td colspan="6">
					<?php 
        echo $pageNav->getListFooter();
        ?>
				</td>
			</tr>
			</tfoot>
			<tbody>
			<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $row->id = $row->cid;
            $link = JRoute::_('index.php?option=com_banners&c=client&task=edit&cid[]=' . $row->id);
            $checked = JHTML::_('grid.checkedout', $row, $i);
            ?>
				<tr class="<?php 
            echo "row{$k}";
            ?>
">
					<td align="center">
						<?php 
            echo $pageNav->getRowOffset($i);
            ?>
					</td>
					<td>
						<?php 
            echo $checked;
            ?>
					</td>
					<td>
						<?php 
            if (JTable::isCheckedOut($user->get('id'), $row->checked_out)) {
                echo $row->name;
            } else {
                ?>
								<span class="editlinktip hasTip" title="<?php 
                echo JText::_('Edit');
                ?>
::<?php 
                echo $row->name;
                ?>
">
							<a href="<?php 
                echo $link;
                ?>
">
								<?php 
                echo $row->name;
                ?>
</a>
								</span>
							<?php 
            }
            ?>
					</td>
					<td>
						<?php 
            echo $row->contact;
            ?>
					</td>
					<td align="center">
						<?php 
            echo $row->nbanners;
            ?>
					</td>
					<td align="center">
						<?php 
            echo $row->cid;
            ?>
					</td>
				</tr>
				<?php 
            $k = 1 - $k;
        }
        ?>
			</tbody>
			</table>

		<input type="hidden" name="c" value="client" />
		<input type="hidden" name="option" value="com_banners" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="filter_order" value="<?php 
        echo $lists['order'];
        ?>
" />
		<input type="hidden" name="filter_order_Dir" value="<?php 
        echo $lists['order_Dir'];
        ?>
" />
		<?php 
        echo JHTML::_('form.token');
        ?>
		</form>
		<?php 
    }
Example #13
0
    function ligen(&$rows, &$lists, &$pageNav, &$option)
    {
        global $mainframe;
        CLMViewLigen::setLigenToolbar();
        $user =& JFactory::getUser();
        // Konfigurationsparameter auslesen
        $config =& JComponentHelper::getParams('com_clm');
        $val = $config->get('menue', 1);
        //Ordering allowed ?
        $ordering = $lists['order'] == 'a.ordering';
        JHTML::_('behavior.tooltip');
        ?>
	<form action="index.php?option=com_clm&section=ligen" method="post" name="adminForm">
	<table>
	<tr>
	<td align="left" width="100%">
	<?php 
        echo JText::_('Filter');
        ?>
:
	<input type="text" name="search" id="search" value="<?php 
        echo $lists['search'];
        ?>
" class="text_area" onchange="document.adminForm.submit();" />
	<button onclick="this.form.submit();"><?php 
        echo JText::_('Go');
        ?>
</button>
	<button onclick="document.getElementById('search').value='';this.form.getElementById('filter_catid').value='0';this.form.getElementById('filter_state').value='';this.form.submit();"><?php 
        echo JText::_('Reset');
        ?>
</button>
	</td>
	<td nowrap="nowrap">
	<?php 
        // eigenes Dropdown Menue
        echo "&nbsp;&nbsp;&nbsp;" . $lists['sid'];
        echo "&nbsp;&nbsp;&nbsp;" . $lists['state'];
        ?>
	</td>
	</tr>
	</table>

	<table class="adminlist">
		<thead>
		<tr>
		<th width="10">
			<?php 
        echo JText::_('NUM');
        ?>
		</th>
		<th width="10">
			<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" />		</th>
		<th class="title">
			<?php 
        echo JHTML::_('grid.sort', JText::_('LEAGUE_OVERVIEW_LEAGUE'), 'a.name', @$lists['order_Dir'], @$lists['order']);
        ?>
		</th>
		<th width="9%">
			<?php 
        echo JHTML::_('grid.sort', JText::_('LEAGUE_OVERVIEW_SEASON'), 'c.name', @$lists['order_Dir'], @$lists['order']);
        ?>
		</th>
		<th width="9%">
			<?php 
        echo JHTML::_('grid.sort', JText::_('LEAGUE_OVERVIEW_ROUNDS'), 'a.runden', @$lists['order_Dir'], @$lists['order']);
        ?>
<br />(<?php 
        echo JText::_('LEAGUE_OVERVIEW_DG');
        ?>
)</th>
		<th width="9%">
			<?php 
        echo JHTML::_('grid.sort', JText::_('LEAGUE_OVERVIEW_TEAMS'), 'a.teil', @$lists['order_Dir'], @$lists['order']);
        ?>
		</th>
		<th width="5%">
			<?php 
        echo JHTML::_('grid.sort', JText::_('LEAGUE_OVERVIEW_STAMM'), 'a.stamm', @$lists['order_Dir'], @$lists['order']);
        ?>
		</th>
		<th width="5%">
			<?php 
        echo JHTML::_('grid.sort', JText::_('LEAGUE_OVERVIEW_ERSATZ'), 'a.ersatz', @$lists['order_Dir'], @$lists['order']);
        ?>
		</th>
		<th width="3%">
			<?php 
        echo JHTML::_('grid.sort', JText::_('LEAGUE_OVERVIEW_SL'), 'a.sl', @$lists['order_Dir'], @$lists['order']);
        ?>
		</th>
		<th width="4%">
			<?php 
        echo JHTML::_('grid.sort', JText::_('LEAGUE_OVERVIEW_MAIL'), 'a.mail', @$lists['order_Dir'], @$lists['order']);
        ?>
		</th>
		<th width="4%">
			<?php 
        echo JHTML::_('grid.sort', JText::_('LEAGUE_OVERVIEW_HINT'), 'a.bemerkungen', @$lists['order_Dir'], @$lists['order']);
        ?>
		</th>

		<th width="6%">
		<?php 
        echo JHTML::_('grid.sort', 'Published', 'a.published', @$lists['order_Dir'], @$lists['order']);
        ?>
		</th>
<?php 
        if (CLM_usertype === 'admin') {
            ?>
		<th width="8%" nowrap="nowrap">
			<?php 
            echo JHTML::_('grid.sort', 'Order', 'a.ordering', @$lists['order_Dir'], @$lists['order']);
            ?>
			<?php 
            echo JHTML::_('grid.order', $rows);
            ?>
		</th>
<?php 
        }
        ?>
		<th width="1%" nowrap="nowrap">
			<?php 
        echo JHTML::_('grid.sort', 'ID', 'a.id', @$lists['order_Dir'], @$lists['order']);
        ?>
		</th>
		</tr>
		</thead>

		<tfoot>
		<tr>
		<td colspan="16">
			<?php 
        echo $pageNav->getListFooter();
        ?>
		</td>
		</tr>
		</tfoot>

		<tbody>
		<?php 
        $k = 0;
        if ($val == 1) {
            $menu = 'index.php?option=com_clm&section=runden&liga=';
        } else {
            $menu = 'index.php?option=com_clm&section=ligen&task=edit&cid[]=';
        }
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $link = JRoute::_($menu . $row->id);
            $checked = JHTML::_('grid.checkedout', $row, $i);
            $published = JHTML::_('grid.published', $row, $i);
            ?>
			<tr class="<?php 
            echo 'row' . $k;
            ?>
">
			<td align="center">
				<?php 
            echo $pageNav->getRowOffset($i);
            ?>
			</td>
			<td>
				<?php 
            echo $checked;
            ?>
            </td>
			<td>
				<?php 
            if (JTable::isCheckedOut($user->get('id'), $row->checked_out)) {
                echo $row->name;
            } else {
                $ligenedit = 'index.php?option=com_clm&section=ligen&task=edit&cid[]=' . $row->id;
                ?>
				<span class="editlinktip hasTip" title="<?php 
                echo JText::_('LEAGUE_OVERVIEW_TIP');
                ?>
::<?php 
                echo $row->name;
                ?>
">
					<a href="<?php 
                echo $ligenedit;
                ?>
">
						<?php 
                echo $row->name;
                ?>
					</a>
				<?php 
            }
            ?>
				</span>
				<?php 
            //}
            ?>
			
            </td>
			<td align="center"><?php 
            echo $row->saison;
            ?>
</td>
			<td align="center">
            <a href="<?php 
            echo $link;
            ?>
">
				<?php 
            if ($row->durchgang > 1) {
                echo $row->durchgang . "&nbsp;x&nbsp;";
            }
            echo $row->runden . "&nbsp;" . JText::_('SWT_RUNDEN');
            ?>
            </a><?php 
            if ($row->rnd == '0') {
                ?>
<br /><?php 
                echo '(' . JText::_('LEAGUE_OVERVIEW_NOTCREATED') . ')';
            }
            ?>
            </td>
			<td align="center"><?php 
            echo $row->teil;
            ?>
</td>
	 	 	<td align="center"><?php 
            echo $row->stamm;
            ?>
</td>
			<td align="center"><?php 
            echo $row->ersatz;
            ?>
</td>
			<td align="center"><?php 
            echo $row->sl;
            ?>
</td>
			<td align="center">
				<?php 
            if ($row->mail == '1') {
                ?>
<img width="16" height="16" src="images/apply_f2.png" /> <?php 
            } else {
                ?>
<img width="16" height="16" src="images/cancel_f2.png" /> <?php 
            }
            ?>
			</td>
			<td align="center">
				<?php 
            if ($row->bemerkungen != '') {
                ?>
<img width="16" height="16" src="images/apply_f2.png" /> <?php 
            } else {
                ?>
<img width="16" height="16" src="images/cancel_f2.png" /> <?php 
            }
            ?>
			</td>

			<td align="center">
				<?php 
            echo $published;
            ?>
			</td>
<?php 
            if (CLM_usertype === 'admin') {
                ?>
	<td class="order">
	<span><?php 
                echo $pageNav->orderUpIcon($i, $row->liga == @$rows[$i - 1]->liga, 'orderup()', 'Move Up', $ordering);
                ?>
</span>
	<span><?php 
                echo $pageNav->orderDownIcon($i, $n, $row->liga == @$rows[$i + 1]->liga, 'orderdown()', 'Move Down', $ordering);
                ?>
</span>
	<?php 
                $disabled = $ordering ? '' : 'disabled="disabled"';
                ?>
	<input type="text" name="order[]" size="5" value="<?php 
                echo $row->ordering;
                ?>
" <?php 
                echo $disabled;
                ?>
 class="text_area" style="text-align: center" />					</td>
<?php 
            }
            ?>
					<td align="center">
						<?php 
            echo $row->id;
            ?>
					</td>
				</tr>
				<?php 
            $k = 1 - $k;
        }
        ?>
			</tbody>
			</table>



    <input type="hidden" name="option" value="com_clm" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="filter_order" value="<?php 
        echo $lists['order'];
        ?>
" />
		<input type="hidden" name="filter_order_Dir" value="<?php 
        echo $lists['order_Dir'];
        ?>
" />

		<?php 
        echo JHTML::_('form.token');
        ?>
		</form>
		<?php 
    }
Example #14
0
    echo $i % 2;
    ?>
">
				<td>
					<?php 
    echo $this->pagination->getRowOffset($i);
    ?>
				</td>
				<td>
					<?php 
    echo JHtml::_('grid.checkedout', $item, $i);
    ?>
				</td>
				<td>
					<?php 
    if (JTable::isCheckedOut($userId, $item->checked_out)) {
        ?>
						<?php 
        echo $item->name;
        ?>
					<?php 
    } else {
        ?>
						<a href="<?php 
        echo JRoute::_('index.php?option=com_contact&task=contact.edit&cid[]=' . (int) $item->id);
        ?>
">
							<?php 
        echo $this->escape($item->name);
        ?>
</a>
    function showPages(&$rows, &$pageNav, $option, &$lists)
    {
        $user =& JFactory::getUser();
        $ordering = $lists['order'] == 'm.book_id' || $lists['order'] == 'b.title';
        JHTML::_('behavior.tooltip');
        ?>
		<form action="index.php?option=com_flippingbook" method="post" name="adminForm">
			<table width="100%">
				<tr>
					<td align="left">
						<?php 
        echo JText::_('Filter (File, Link URL, Zoom file)');
        ?>
:
						<input type="text" name="search" id="search" value="<?php 
        echo $lists['search'];
        ?>
" class="text_area" onchange="document.adminForm.submit();" />
						<button onclick="this.form.submit();"><?php 
        echo JText::_('Go');
        ?>
</button>
						<button onclick="document.getElementById('search').value='';this.form.submit();"><?php 
        echo JText::_('Reset');
        ?>
</button></td>
					<td align="center" nowrap="nowrap">
						<?php 
        echo JText::_('Book Filter');
        ?>
:<?php 
        echo $lists['book'];
        ?>
</td>
					<td align="right" nowrap="nowrap"><?php 
        echo JText::_('State Filter');
        ?>
:
						<?php 
        echo $lists['state'];
        ?>
</td>
				</tr>
			</table>
		<div id="tablecell">
			<table class="adminlist">
				<thead>
					<tr>
						<th width="5" nowrap="nowrap"><?php 
        echo JText::_('NUM');
        ?>
</th>
						<th width="20" nowrap="nowrap"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" /></th>
						<th width="1%" nowrap="NOWRAP"><?php 
        echo JHTML::_('grid.sort', 'ID', 'm.id', @$lists['order_Dir'], @$lists['order'], 'page_manager');
        ?>
</th>
						<th nowrap="nowrap" class="title"><?php 
        echo JHTML::_('grid.sort', 'File', 'm.file', @$lists['order_Dir'], @$lists['order'], 'page_manager');
        ?>
</th>
						<th align="center" nowrap="nowrap"><?php 
        echo JHTML::_('grid.sort', 'Book ID', 'm.book_id', @$lists['order_Dir'], @$lists['order'], 'page_manager');
        ?>
</th>
						<th align="center" nowrap="nowrap"><?php 
        echo JHTML::_('grid.sort', 'Book Title', 'b.title', @$lists['order_Dir'], @$lists['order'], 'page_manager');
        ?>
</th>
						<th align="center" nowrap="nowrap"><?php 
        echo JHTML::_('grid.sort', 'Published', 'm.published', @$lists['order_Dir'], @$lists['order'], 'page_manager');
        ?>
</th>
						<th align="center" nowrap="nowrap"><?php 
        echo JHTML::_('grid.sort', 'Link URL', 'm.link_url', @$lists['order_Dir'], @$lists['order'], 'page_manager');
        ?>
</th>
						<th align="center" nowrap="nowrap"><?php 
        echo JHTML::_('grid.sort', 'Zoom file', 'm.zoom_url', @$lists['order_Dir'], @$lists['order'], 'page_manager');
        ?>
</th>
						<th colspan="3" nowrap="NOWRAP"><?php 
        echo JHTML::_('grid.sort', 'Ordering', 'm.ordering', @$lists['order_Dir'], @$lists['order'], 'page_manager');
        echo JHTML::_('grid.order', $rows, 'filesave.png', 'savepageorder');
        ?>
</th>
					</tr>
				</thead>
				<tfoot>
					<tr>
						<td colspan="13">
							<?php 
        echo $pageNav->getListFooter();
        ?>
					</td>
					</tr>
				</tfoot>
				<tbody>
			<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $link = 'index.php?option=com_flippingbook&task=edit_page&cid[]=' . $row->id;
            $checked = JHTML::_('grid.checkedout', $row, $i);
            $published = JHTML::_('grid.published', $row, $i);
            ?>
				<tr class="<?php 
            echo "row{$k}";
            ?>
">
					<td><?php 
            echo $pageNav->getRowOffset($i);
            ?>
</td>
					<td><?php 
            echo $checked;
            ?>
</td>
					<td align="center"><?php 
            echo $row->id;
            ?>
</td>
					<td><?php 
            if (JTable::isCheckedOut($user->get('id'), $row->checked_out)) {
                echo $row->title;
            } else {
                ?>
						<a href="<?php 
                echo JRoute::_($link);
                ?>
" title="<?php 
                echo JText::_('Edit Page');
                ?>
"><?php 
                echo $row->file;
                ?>
</a>
					<?php 
            }
            ?>
</td>
					<td width="1%" align="center"><?php 
            echo $row->book_id;
            ?>
</td>
					<td align="left"><?php 
            echo $row->title;
            ?>
</td>
					<td align="center"><?php 
            echo $published;
            ?>
</td>
					<td align="center"><?php 
            echo $row->link_url;
            ?>
</td>
					<td><?php 
            echo $row->zoom_url;
            ?>
</td>
					<td width="1%" align="center"><?php 
            echo $pageNav->orderUpIcon($i, $row->book_id == @$rows[$i - 1]->book_id, 'orderup_page', 'Move Up', $ordering);
            ?>
</td>
					<td width="1%" align="center"><?php 
            echo $pageNav->orderDownIcon($i, $n, $row->book_id == @$rows[$i + 1]->book_id, 'orderdown_page', 'Move Down', $ordering);
            ?>
</td>
					<td width="1%" align="center" nowrap="nowrap"><?php 
            $disabled = $ordering ? '' : 'disabled="disabled"';
            ?>
<input type="text" name="order[]" size="5" value="<?php 
            echo $row->ordering;
            ?>
" <?php 
            echo $disabled;
            ?>
 class="text_area" style="text-align: center" /></td>
				</tr>
				<?php 
            $k = 1 - $k;
        }
        ?>
			</tbody>
			</table>
		</div>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="page_manager" />
		<input type="hidden" name="section" value="page_manager" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="filter_order" value="<?php 
        echo $lists['order'];
        ?>
" />
		<input type="hidden" name="filter_order_Dir" value="" />
		</form>
		<?php 
    }
Example #16
0
    /**
     * Writes a list of the articles
     * @param array An array of content objects
     */
    function showList(&$rows, $page, $option, $lists)
    {
        jimport('joomla.utilities.date');
        $limitstart = JRequest::getVar('limitstart', '0', '', 'int');
        $user =& JFactory::getUser();
        $db =& JFactory::getDBO();
        $nullDate = $db->getNullDate();
        $config =& JFactory::getConfig();
        $now = new JDate();
        //Ordering allowed ?
        $ordering = $lists['order'] == 'fpordering';
        JHTML::_('behavior.tooltip');
        ?>
		<form action="index.php?option=com_frontpage" method="post" name="adminForm">

			<table>
				<tr>
					<td width="100%" class="filter">
						<?php 
        echo JText::_('Filter');
        ?>
:
						<input type="text" name="search" id="search" value="<?php 
        echo $lists['search'];
        ?>
" class="text_area" onchange="document.adminForm.submit();" />
						<button onclick="this.form.submit();"><?php 
        echo JText::_('Go');
        ?>
</button>
						<button onclick="document.getElementById('search').value=''; this.form.getElementById('filter_sectionid').value='-1'; this.form.getElementById('catid').value='0'; this.form.getElementById('filter_authorid').value='0'; this.form.getElementById('filter_state').value=''; this.form.submit();"><?php 
        echo JText::_('Reset');
        ?>
</button>
					</td>
					<td nowrap="nowrap">
						<?php 
        echo $lists['sectionid'];
        echo $lists['catid'];
        echo $lists['authorid'];
        echo $lists['state'];
        ?>
					</td>
				</tr>
			</table>

			<table class="adminlist">
			<thead>
				<tr>
					<th width="5">
						<?php 
        echo JText::_('Num');
        ?>
					</th>
					<th width="20">
						<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
					</th>
					<th class="title">
						<?php 
        echo JHTML::_('grid.sort', 'Title', 'c.title', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="10%" nowrap="nowrap">
						<?php 
        echo JHTML::_('grid.sort', 'Published', 'c.state', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="80" nowrap="nowrap">
						<?php 
        echo JHTML::_('grid.sort', 'Order', 'fpordering', @$lists['order_Dir'], @$lists['order']);
        ?>
		 			</th>
					<th width="1%">
						<?php 
        echo JHTML::_('grid.order', $rows);
        ?>
					</th>
					<th width="8%" nowrap="nowrap">
						<?php 
        echo JHTML::_('grid.sort', 'Access', 'groupname', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="2%" class="title" align="center" nowrap="nowrap">
						<?php 
        echo JHTML::_('grid.sort', 'ID', 'c.id', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="10%" class="title">
						<?php 
        echo JHTML::_('grid.sort', 'Section', 'sect_name', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="10%" class="title">
						<?php 
        echo JHTML::_('grid.sort', 'Category', 'cc.name', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="10%" class="title">
						<?php 
        echo JHTML::_('grid.sort', 'Author', 'author', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
				</tr>
			</thead>
			<tfoot>
			<tr>
				<td colspan="13">
					<?php 
        echo $page->getListFooter();
        ?>
				</td>
			</tr>
			</tfoot>
			<tbody>
			<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $link = JRoute::_('index.php?option=com_content&task=edit&cid[]=' . $row->id);
            $publish_up = new JDate($row->publish_up);
            $publish_down = new JDate($row->publish_down);
            $publish_up->setOffset($config->getValue('config.offset'));
            $publish_down->setOffset($config->getValue('config.offset'));
            if ($now->toUnix() <= $publish_up->toUnix() && $row->state == 1) {
                $img = 'publish_y.png';
                $alt = JText::_('Published');
            } else {
                if (($now->toUnix() <= $publish_down->toUnix() || $row->publish_down == $nullDate) && $row->state == 1) {
                    $img = 'publish_g.png';
                    $alt = JText::_('Published');
                } else {
                    if ($now->toUnix() > $publish_down->toUnix() && $row->state == 1) {
                        $img = 'publish_r.png';
                        $alt = JText::_('Expired');
                    } else {
                        if ($row->state == 0) {
                            $img = 'publish_x.png';
                            $alt = JText::_('Unpublished');
                        } else {
                            if ($row->state == -1) {
                                $img = 'disabled.png';
                                $alt = JText::_('Archived');
                            }
                        }
                    }
                }
            }
            $times = '';
            if (isset($row->publish_up)) {
                if ($row->publish_up == $nullDate) {
                    $times .= JText::_('Start: Always');
                } else {
                    $times .= JText::_('Start') . ": " . $publish_up->toFormat();
                }
            }
            if (isset($row->publish_down)) {
                if ($row->publish_down == $nullDate) {
                    $times .= "<br />" . JText::_('Finish: No Expiry');
                } else {
                    $times .= "<br />" . JText::_('Finish') . ": " . $publish_down->toFormat();
                }
            }
            $access = JHTML::_('grid.access', $row, $i);
            $checked = JHTML::_('grid.checkedout', $row, $i);
            if ($user->authorize('com_users', 'manage')) {
                if ($row->created_by_alias) {
                    $author = $row->created_by_alias;
                } else {
                    $linkA = JRoute::_('index.php?option=com_users&task=edit&cid[]=' . $row->created_by);
                    $author = '<span class="editlinktip hasTip" title="' . JText::_('Edit User') . '::' . $row->author . '">' . '<a href="' . $linkA . '">' . $row->author . '</a><span>';
                }
            } else {
                if ($row->created_by_alias) {
                    $author = $row->created_by_alias;
                } else {
                    $author = $row->author;
                }
            }
            // section handling
            if ($row->sectionid) {
                $row->sect_link = JRoute::_('index.php?option=com_sections&task=edit&cid[]=' . $row->sectionid);
                $title_sec = JText::_('Edit Section');
            }
            // category handling
            if ($row->catid) {
                $row->cat_link = JRoute::_('index.php?option=com_categories&task=edit&cid[]=' . $row->catid);
                $title_cat = JText::_('Edit Category');
            }
            ?>
				<tr class="<?php 
            echo "row{$k}";
            ?>
">
					<td>
						<?php 
            echo $page->getRowOffset($i);
            ?>
					</td>
					<td>
						<?php 
            echo $checked;
            ?>
					</td>
					<td>
						<?php 
            if (JTable::isCheckedOut($user->get('id'), $row->checked_out)) {
                echo $row->title;
            } else {
                ?>
							<span class="editlinktip hasTip" title="<?php 
                echo JText::_('Edit Content');
                ?>
::<?php 
                echo $row->name;
                ?>
">
							<a href="<?php 
                echo $link;
                ?>
">
								<?php 
                echo $row->title;
                ?>
</a></span>
							<?php 
            }
            ?>
					</td>
					<?php 
            if ($times) {
                ?>
						<td align="center">
							<span class="editlinktip hasTip" title="<?php 
                echo JText::_('Publish Information');
                ?>
::<?php 
                echo $times;
                ?>
">
							<a href="javascript:void(0);" onclick="return listItemTask('cb<?php 
                echo $i;
                ?>
','<?php 
                echo $row->state ? 'unpublish' : 'publish';
                ?>
')">
								<img src="images/<?php 
                echo $img;
                ?>
" width="16" height="16" border="0" alt="<?php 
                echo $alt;
                ?>
" /></a></span>
						</td>
						<?php 
            }
            ?>
					<td class="order" colspan="2">
						<span><?php 
            echo $page->orderUpIcon($i, true, 'orderup', 'Move Up', $ordering);
            ?>
</span>
						<span><?php 
            echo $page->orderDownIcon($i, $n, true, 'orderdown', 'Move Down', $ordering);
            ?>
</span>
						<?php 
            $disabled = $ordering ? '' : 'disabled="disabled"';
            ?>
						<input type="text" name="order[]" size="5" value="<?php 
            echo $row->fpordering;
            ?>
" <?php 
            echo $disabled;
            ?>
 class="text_area" style="text-align: center" />
					</td>
					<td align="center">
						<?php 
            echo $access;
            ?>
					</td>
					<td align="center">
						<?php 
            echo $row->id;
            ?>
					</td>
					<td>
						<?php 
            if ($row->sectionid) {
                ?>
						<span class="editlinktip hasTip" title="<?php 
                echo $title_sec;
                ?>
::<?php 
                echo $row->sect_name;
                ?>
">
							<a href="<?php 
                echo $row->sect_link;
                ?>
">
								<?php 
                echo $row->sect_name;
                ?>
</a></span>
						<?php 
            }
            ?>
					</td>
					<td>
						<?php 
            if ($row->catid) {
                ?>
						<span class="editlinktip hasTip" title="<?php 
                echo $title_cat;
                ?>
::<?php 
                echo $row->name;
                ?>
">
							<a href="<?php 
                echo $row->cat_link;
                ?>
" title="<?php 
                echo $title_cat;
                ?>
">
								<?php 
                echo $row->name;
                ?>
</a></span>
						<?php 
            }
            ?>
					</td>
					<td>
						<?php 
            echo $author;
            ?>
					</td>
				</tr>
				<?php 
            $k = 1 - $k;
        }
        ?>
			</tbody>
			</table>
			<?php 
        JHTML::_('content.legend');
        ?>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="filter_order" value="<?php 
        echo $lists['order'];
        ?>
" />
		<input type="hidden" name="filter_order_Dir" value="<?php 
        echo $lists['order_Dir'];
        ?>
" />
		<?php 
        echo JHTML::_('form.token');
        ?>
		</form>
		<?php 
    }
Example #17
0
    function vereine(&$rows, &$lists, &$pageNav, $option)
    {
        global $mainframe;
        CLMViewVereine::setVereineToolbar();
        $user =& JFactory::getUser();
        // Ordering allowed ?
        $ordering = $lists['order'] == 'a.ordering';
        JHTML::_('behavior.tooltip');
        ?>
		<form action="index.php?option=com_clm&section=vereine" method="post" name="adminForm">

		<table>
		<tr>
			<td align="left" width="100%">
				<?php 
        echo JText::_('Filter');
        ?>
:
		<input type="text" name="search" id="search" value="<?php 
        echo $lists['search'];
        ?>
" class="text_area" onchange="document.adminForm.submit();" />
		<button onclick="this.form.submit();"><?php 
        echo JText::_('GO');
        ?>
</button>
		<button onclick="document.getElementById('search').value='';this.form.getElementById('filter_catid').value='0';this.form.getElementById('filter_state').value='';this.form.submit();"><?php 
        echo JText::_('Reset');
        ?>
</button>
			</td>
			<td nowrap="nowrap">
				<?php 
        // eigenes Dropdown Menue
        echo "&nbsp;&nbsp;&nbsp;" . $lists['sid'];
        echo "&nbsp;&nbsp;&nbsp;" . $lists['state'];
        ?>
			</td>
		</tr>
		</table>

			<table class="adminlist">
			<thead>
				<tr>
					<th width="10">
						<?php 
        echo JText::_('NUM');
        ?>
					</th>
					<th width="10">
						<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
					</th>
					<th class="title">
						<?php 
        echo JHTML::_('grid.sort', 'VEREIN', 'a.name', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="11%">
						<?php 
        echo JHTML::_('grid.sort', 'VEREIN_ZPS', 'a.zps', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="22%">
						<?php 
        echo JHTML::_('grid.sort', 'VEREIN_HOMEPAGE', 'a.homepage', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="11%">
						<?php 
        echo JHTML::_('grid.sort', 'SAISON', 'c.name', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="6%">
						<?php 
        echo JHTML::_('grid.sort', 'PUBLISHED', 'a.published', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="8%" nowrap="nowrap">
						<?php 
        echo JHTML::_('grid.sort', 'ORDER', 'a.ordering', @$lists['order_Dir'], @$lists['order']);
        ?>
						<?php 
        echo JHTML::_('grid.order', $rows);
        ?>
					</th>
					<th width="1%" nowrap="nowrap">
						<?php 
        echo JHTML::_('grid.sort', 'ID', 'a.id', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
				</tr>
			</thead>
			<tfoot>
				<tr>
					<td colspan="12">
						<?php 
        echo $pageNav->getListFooter();
        ?>
					</td>
				</tr>
			</tfoot>
			<tbody>
			<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $link = JRoute::_('index.php?option=com_clm&section=vereine&task=edit&cid[]=' . $row->id);
            $checked = JHTML::_('grid.checkedout', $row, $i);
            $published = JHTML::_('grid.published', $row, $i);
            ?>
				<tr class="<?php 
            echo 'row' . $k;
            ?>
">


					<td align="center">
						<?php 
            echo $pageNav->getRowOffset($i);
            ?>
					</td>

					<td>
						<?php 
            echo $checked;
            ?>
					</td>

					<td>
						<?php 
            if (JTable::isCheckedOut($user->get('id'), $row->checked_out)) {
                echo $row->name;
            } else {
                ?>
								<span class="editlinktip hasTip" title="<?php 
                echo JText::_('VEREIN_EDIT');
                ?>
::<?php 
                echo $row->name . $row->man_nr;
                ?>
">
							<a href="<?php 
                echo $link;
                ?>
">
								<?php 
                echo $row->name;
                ?>
</a></span>
							<?php 
            }
            ?>
					</td>

					<td align="center">
						<?php 
            echo $row->zps;
            ?>
					</td>
					<td align="center">
						<a href="<?php 
            echo $row->homepage;
            ?>
" target="_blank"><?php 
            echo $row->homepage;
            ?>
</a>
					</td>
                    
					<td align="center">
						<?php 
            echo $row->saison;
            ?>
					</td>
                    
					<td align="center">
						<?php 
            echo $published;
            ?>
					</td>



	<td class="order">
	<?php 
            $disabled = $ordering ? '' : 'disabled="disabled"';
            ?>
	<input type="text" name="order[]" size="5" value="<?php 
            echo $row->ordering;
            ?>
" <?php 
            echo $disabled;
            ?>
 class="text_area" style="text-align: center" />
					</td>

					<td align="center">
						<?php 
            echo $row->id;
            ?>
					</td>
				</tr>
				<?php 
            $k = 1 - $k;
        }
        ?>
			</tbody>
			</table>
		<input type="hidden" name="option" value="com_clm" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="filter_order" value="<?php 
        echo $lists['order'];
        ?>
" />
		<input type="hidden" name="filter_order_Dir" value="<?php 
        echo $lists['order_Dir'];
        ?>
" />
		<?php 
        echo JHTML::_('form.token');
        ?>
		</form>
		<?php 
    }
Example #18
0
    function showContacts(&$rows, &$pageNav, $option, &$lists)
    {
        $user =& JFactory::getUser();
        //Ordering allowed ?
        $ordering = $lists['order'] == 'cd.ordering';
        JHTML::_('behavior.tooltip');
        ?>
		<form action="index.php?option=com_contact" method="post" name="adminForm">

		<table>
		<tr>
			<td align="left" width="100%">
				<?php 
        echo JText::_('Filter');
        ?>
:
				<input type="text" name="search" id="search" value="<?php 
        echo htmlspecialchars($lists['search']);
        ?>
" class="text_area" onchange="document.adminForm.submit();" />
				<button onclick="this.form.submit();"><?php 
        echo JText::_('Go');
        ?>
</button>
				<button onclick="document.getElementById('search').value='';this.form.getElementById('filter_catid').value='0';this.form.getElementById('filter_state').value='';this.form.submit();"><?php 
        echo JText::_('Reset');
        ?>
</button>
			</td>
			<td nowrap="nowrap">
				<?php 
        echo $lists['catid'];
        echo $lists['state'];
        ?>
			</td>
		</tr>
		</table>

			<table class="adminlist">
			<thead>
				<tr>
					<th width="10">
						<?php 
        echo JText::_('Num');
        ?>
					</th>
					<th width="10" class="title">
						<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
					</th>
					<th class="title">
						<?php 
        echo JHTML::_('grid.sort', 'Name', 'cd.name', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="5%" class="title" nowrap="nowrap">
						<?php 
        echo JHTML::_('grid.sort', 'Published', 'cd.published', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th nowrap="nowrap" width="8%">
						<?php 
        echo JHTML::_('grid.sort', 'Order by', 'cd.ordering', @$lists['order_Dir'], @$lists['order']);
        ?>
						<?php 
        if ($ordering) {
            echo JHTML::_('grid.order', $rows);
        }
        ?>
					</th>
					<th width="8%" nowrap="nowrap">
						<?php 
        echo JHTML::_('grid.sort', 'Access', 'cd.access', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="10%" class="title">
						<?php 
        echo JHTML::_('grid.sort', 'Category', 'category', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th class="title" nowrap="nowrap" width="10%">
						<?php 
        echo JHTML::_('grid.sort', 'Linked to User', 'user', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="1%" nowrap="nowrap">
						<?php 
        echo JHTML::_('grid.sort', 'ID', 'cd.id', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
				</tr>
			</thead>
			<tfoot>
				<tr>
					<td colspan="11">
						<?php 
        echo $pageNav->getListFooter();
        ?>
					</td>
				</tr>
			</tfoot>
			<tbody>
			<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row = $rows[$i];
            $link = JRoute::_('index.php?option=com_contact&task=edit&cid[]=' . $row->id);
            $checked = JHTML::_('grid.checkedout', $row, $i);
            $access = JHTML::_('grid.access', $row, $i);
            $published = JHTML::_('grid.published', $row, $i);
            $row->cat_link = JRoute::_('index.php?option=com_categories&section=com_contact_details&task=edit&type=other&cid[]=' . $row->catid);
            $row->user_link = JRoute::_('index.php?option=com_users&task=editA&cid[]=' . $row->user_id);
            ?>
				<tr class="<?php 
            echo "row{$k}";
            ?>
">
					<td>
						<?php 
            echo $pageNav->getRowOffset($i);
            ?>
					</td>
					<td>
						<?php 
            echo $checked;
            ?>
					</td>
					<td>
					<?php 
            if (JTable::isCheckedOut($user->get('id'), $row->checked_out)) {
                echo htmlspecialchars($row->name);
            } else {
                ?>
						<span class="editlinktip hasTip" title="<?php 
                echo JText::_('Edit Contact');
                ?>
::<?php 
                echo htmlspecialchars($row->name);
                ?>
">
						<a href="<?php 
                echo $link;
                ?>
">
							<?php 
                echo htmlspecialchars($row->name);
                ?>
</a> </span>
						<?php 
            }
            ?>
					</td>
					<td align="center">
						<?php 
            echo $published;
            ?>
					</td>
					<td class="order">
						<span><?php 
            echo $pageNav->orderUpIcon($i, $row->catid == @$rows[$i - 1]->catid, 'orderup', 'Move Up', $ordering);
            ?>
</span>
						<span><?php 
            echo $pageNav->orderDownIcon($i, $n, $row->catid == @$rows[$i + 1]->catid, 'orderdown', 'Move Down', $ordering);
            ?>
</span>
						<?php 
            $disabled = $ordering ? '' : 'disabled="disabled"';
            ?>
						<input type="text" name="order[]" size="5" value="<?php 
            echo $row->ordering;
            ?>
" <?php 
            echo $disabled;
            ?>
 class="text_area" style="text-align: center" />
					</td>
					<td align="center">
						<?php 
            echo $access;
            ?>
					</td>
					<td>
						<a href="<?php 
            echo $row->cat_link;
            ?>
" title="<?php 
            echo JText::_('Edit Category');
            ?>
">
							<?php 
            echo $row->category;
            ?>
</a>
					</td>
					<td>
						<a href="<?php 
            echo $row->user_link;
            ?>
" title="<?php 
            echo JText::_('Edit User');
            ?>
">
							<?php 
            echo $row->user;
            ?>
</a>
					</td>
					<td align="center">
						<?php 
            echo $row->id;
            ?>
					</td>
				</tr>
				<?php 
            $k = 1 - $k;
        }
        ?>
			</tbody>
			</table>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="filter_order" value="<?php 
        echo $lists['order'];
        ?>
" />
		<input type="hidden" name="filter_order_Dir" value="<?php 
        echo $lists['order_Dir'];
        ?>
" />
		<?php 
        echo JHTML::_('form.token');
        ?>
		</form>
		<?php 
    }
Example #19
0
/**
* Compiles information to add or edit a category
* @param string The name of the category section
* @param integer The unique id of the category to edit (0 if new)
* @param string The name of the current user
*/
function editCategory($edit)
{
    global $mainframe;
    // Initialize variables
    $db =& JFactory::getDBO();
    $user =& JFactory::getUser();
    $uid = $user->get('id');
    $type = JRequest::getCmd('type');
    $redirect = JRequest::getCmd('section', 'com_content');
    $section = JRequest::getCmd('section', 'com_content');
    $cid = JRequest::getVar('cid', array(0), '', 'array');
    JArrayHelper::toInteger($cid, array(0));
    // check for existance of any sections
    $query = 'SELECT COUNT( id )' . ' FROM #__sections' . ' WHERE scope = "content"';
    $db->setQuery($query);
    $sections = $db->loadResult();
    if (!$sections && $type != 'other' && $section != 'com_weblinks' && $section != 'com_newsfeeds' && $section != 'com_contact_details' && $section != 'com_banner') {
        $mainframe->redirect('index.php?option=com_categories&section=' . $section, JText::_('WARNSECTION', true));
    }
    $row =& JTable::getInstance('category');
    // load the row from the db table
    if ($edit) {
        $row->load($cid[0]);
    }
    // fail if checked out not by 'me'
    if (JTable::isCheckedOut($user->get('id'), $row->checked_out)) {
        $msg = JText::sprintf('DESCBEINGEDITTED', JText::_('The category'), $row->title);
        $mainframe->redirect('index.php?option=com_categories&section=' . $row->section, $msg);
    }
    if ($edit) {
        $row->checkout($user->get('id'));
    } else {
        $row->published = 1;
    }
    // make order list
    $order = array();
    $query = 'SELECT COUNT(*)' . ' FROM #__categories' . ' WHERE section = ' . $db->Quote($row->section);
    $db->setQuery($query);
    $max = intval($db->loadResult()) + 1;
    for ($i = 1; $i < $max; $i++) {
        $order[] = JHTML::_('select.option', $i);
    }
    // build the html select list for sections
    if ($section == 'com_content') {
        if (!$row->section && JRequest::getInt('sectionid')) {
            $row->section = JRequest::getInt('sectionid');
        }
        $query = 'SELECT s.id AS value, s.title AS text' . ' FROM #__sections AS s' . ' ORDER BY s.ordering';
        $db->setQuery($query);
        $sections = $db->loadObjectList();
        $lists['section'] = JHTML::_('select.genericlist', $sections, 'section', 'class="inputbox" size="1"', 'value', 'text', $row->section);
    } else {
        if ($type == 'other') {
            $section_name = JText::_('N/A');
        } else {
            $temp =& JTable::getInstance('section');
            $temp->load($row->section);
            $section_name = $temp->name;
        }
        if (!$section_name) {
            $section_name = JText::_('N/A');
        }
        $row->section = $section;
        $lists['section'] = '<input type="hidden" name="section" value="' . $row->section . '" />' . $section_name;
    }
    // build the html select list for ordering
    $query = 'SELECT ordering AS value, title AS text' . ' FROM #__categories' . ' WHERE section = ' . $db->Quote($row->section) . ' ORDER BY ordering';
    if ($edit) {
        $lists['ordering'] = JHTML::_('list.specificordering', $row, $cid[0], $query);
    } else {
        $lists['ordering'] = JHTML::_('list.specificordering', $row, '', $query);
    }
    // build the select list for the image positions
    $active = $row->image_position ? $row->image_position : 'left';
    $lists['image_position'] = JHTML::_('list.positions', 'image_position', $active, NULL, 0, 0);
    // Imagelist
    $lists['image'] = JHTML::_('list.images', 'image', $row->image);
    // build the html select list for the group access
    $lists['access'] = JHTML::_('list.accesslevel', $row);
    // build the html radio buttons for published
    $published = $row->id ? $row->published : 1;
    $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $published);
    categories_html::edit($row, $lists, $redirect);
}
Example #20
0
			<td colspan="50">
				<?php 
echo $this->pagination->getListFooter();
?>
			</td>
		</tr>
	</tfoot>
	<tbody>
	<?php 
$k = 0;
for ($i = 0, $n = count($this->items); $i < $n; $i++) {
    $item =& $this->items[$i];
    $url = JRoute::_("index.php?option={$option}&amp;task=edit&amp;cid[]={$item->id}");
    $checked = JHTML::_('grid.checkedout', $item, $i);
    $published = JHTML::_('grid.published', $item, $i);
    $isCheckedOut = JTable::isCheckedOut($this->user->get('id'), $item->checked_out);
    $thumbnail = JHTML::_('arcna.thumbnail', $item->image, 120, 120);
    ?>
		<tr class="<?php 
    echo "row{$k}";
    ?>
">
			<td>
				<?php 
    echo $this->pagination->getRowOffset($i);
    ?>
			</td>
			<td>
				<?php 
    echo $checked;
    ?>
 /**
  * Compiles information to add or edit the record
  *
  * @param database A database connector object
  * @param integer The unique id of the record to edit (0 if new)
  * @param integer The id of the content section
  */
 function editContent($edit)
 {
     global $mainframe;
     // Initialize variables
     $db =& JFactory::getDBO();
     $user =& JFactory::getUser();
     $cid = JRequest::getVar('cid', array(0), '', 'array');
     JArrayHelper::toInteger($cid, array(0));
     $id = JRequest::getVar('id', $cid[0], '', 'int');
     $option = JRequest::getCmd('option');
     $nullDate = $db->getNullDate();
     $contentSection = '';
     $sectionid = 0;
     // Create and load the content table row
     $row =& JTable::getInstance('content');
     if ($edit) {
         $row->load($id);
     }
     if ($id) {
         $sectionid = $row->sectionid;
         if ($row->state < 0) {
             $mainframe->redirect('index.php?option=com_content', JText::_('You cannot edit an archived item'));
         }
     }
     // A sectionid of zero means grab from all sections
     if ($sectionid == 0) {
         $where = ' WHERE section NOT LIKE "%com_%"';
     } else {
         // Grab from the specific section
         $where = ' WHERE section = ' . $db->Quote($sectionid);
     }
     /*
      * If the item is checked out we cannot edit it... unless it was checked
      * out by the current user.
      */
     if (JTable::isCheckedOut($user->get('id'), $row->checked_out)) {
         $msg = JText::sprintf('DESCBEINGEDITTED', JText::_('The item'), $row->title);
         $mainframe->redirect('index.php?option=com_content', $msg);
     }
     if ($id) {
         $row->checkout($user->get('id'));
         if (trim($row->images)) {
             $row->images = explode("\n", $row->images);
         } else {
             $row->images = array();
         }
         $query = 'SELECT name' . ' FROM #__users' . ' WHERE id = ' . (int) $row->created_by;
         $db->setQuery($query);
         $row->creator = $db->loadResult();
         // test to reduce unneeded query
         if ($row->created_by == $row->modified_by) {
             $row->modifier = $row->creator;
         } else {
             $query = 'SELECT name' . ' FROM #__users' . ' WHERE id = ' . (int) $row->modified_by;
             $db->setQuery($query);
             $row->modifier = $db->loadResult();
         }
         $query = 'SELECT COUNT(content_id)' . ' FROM #__content_frontpage' . ' WHERE content_id = ' . (int) $row->id;
         $db->setQuery($query);
         $row->frontpage = $db->loadResult();
         if (!$row->frontpage) {
             $row->frontpage = 0;
         }
     } else {
         if (!$sectionid && JRequest::getInt('filter_sectionid')) {
             $sectionid = JRequest::getInt('filter_sectionid');
         }
         if (JRequest::getInt('catid')) {
             $row->catid = JRequest::getInt('catid');
             $category =& JTable::getInstance('category');
             $category->load($row->catid);
             $sectionid = $category->section;
         } else {
             $row->catid = NULL;
         }
         $createdate =& JFactory::getDate();
         $row->sectionid = $sectionid;
         $row->version = 0;
         $row->state = 1;
         $row->ordering = 0;
         $row->images = array();
         $row->publish_up = $createdate->toUnix();
         $row->publish_down = JText::_('Never');
         $row->creator = '';
         $row->created = $createdate->toUnix();
         $row->modified = $nullDate;
         $row->modifier = '';
         $row->frontpage = 0;
     }
     $javascript = "onchange=\"changeDynaList( 'catid', sectioncategories, document.adminForm.sectionid.options[document.adminForm.sectionid.selectedIndex].value, 0, 0);\"";
     $query = 'SELECT s.id, s.title' . ' FROM #__sections AS s' . ' ORDER BY s.ordering';
     $db->setQuery($query);
     $sections[] = JHTML::_('select.option', '-1', '- ' . JText::_('Select Section') . ' -', 'id', 'title');
     $sections[] = JHTML::_('select.option', '0', JText::_('Uncategorized'), 'id', 'title');
     $sections = array_merge($sections, $db->loadObjectList());
     $lists['sectionid'] = JHTML::_('select.genericlist', $sections, 'sectionid', 'class="inputbox" size="1" ' . $javascript, 'id', 'title', intval($row->sectionid));
     foreach ($sections as $section) {
         $section_list[] = (int) $section->id;
         // get the type name - which is a special category
         if ($row->sectionid) {
             if ($section->id == $row->sectionid) {
                 $contentSection = $section->title;
             }
         } else {
             if ($section->id == $sectionid) {
                 $contentSection = $section->title;
             }
         }
     }
     $sectioncategories = array();
     $sectioncategories[-1] = array();
     $sectioncategories[-1][] = JHTML::_('select.option', '-1', JText::_('Select Category'), 'id', 'title');
     $section_list = implode('\', \'', $section_list);
     $query = 'SELECT id, title, section' . ' FROM #__categories' . ' WHERE section IN ( \'' . $section_list . '\' )' . ' ORDER BY ordering';
     $db->setQuery($query);
     $cat_list = $db->loadObjectList();
     // Uncategorized category mapped to uncategorized section
     $uncat = new stdClass();
     $uncat->id = 0;
     $uncat->title = JText::_('Uncategorized');
     $uncat->section = 0;
     $cat_list[] = $uncat;
     foreach ($sections as $section) {
         $sectioncategories[$section->id] = array();
         $rows2 = array();
         foreach ($cat_list as $cat) {
             if ($cat->section == $section->id) {
                 $rows2[] = $cat;
             }
         }
         foreach ($rows2 as $row2) {
             $sectioncategories[$section->id][] = JHTML::_('select.option', $row2->id, $row2->title, 'id', 'title');
         }
     }
     $sectioncategories['-1'][] = JHTML::_('select.option', '-1', JText::_('Select Category'), 'id', 'title');
     $categories = array();
     foreach ($cat_list as $cat) {
         if ($cat->section == $row->sectionid) {
             $categories[] = $cat;
         }
     }
     $categories[] = JHTML::_('select.option', '-1', JText::_('Select Category'), 'id', 'title');
     $lists['catid'] = JHTML::_('select.genericlist', $categories, 'catid', 'class="inputbox" size="1"', 'id', 'title', intval($row->catid));
     // build the html select list for ordering
     $query = 'SELECT ordering AS value, title AS text' . ' FROM #__content' . ' WHERE catid = ' . (int) $row->catid . ' AND state >= 0' . ' ORDER BY ordering';
     if ($edit) {
         $lists['ordering'] = JHTML::_('list.specificordering', $row, $id, $query, 1);
     } else {
         $lists['ordering'] = JHTML::_('list.specificordering', $row, '', $query, 1);
     }
     // build the html radio buttons for frontpage
     $lists['frontpage'] = JHTML::_('select.booleanlist', 'frontpage', '', $row->frontpage);
     // build the html radio buttons for published
     $lists['state'] = JHTML::_('select.booleanlist', 'state', '', $row->state);
     /*
      * We need to unify the introtext and fulltext fields and have the
      * fields separated by the {readmore} tag, so lets do that now.
      */
     if (JString::strlen($row->fulltext) > 1) {
         $row->text = $row->introtext . "<hr id=\"system-readmore\" />" . $row->fulltext;
     } else {
         $row->text = $row->introtext;
     }
     // Create the form
     $form = new JParameter('', JPATH_COMPONENT . DS . 'models' . DS . 'article.xml');
     // Details Group
     $active = intval($row->created_by) ? intval($row->created_by) : $user->get('id');
     $form->set('created_by', $active);
     $form->set('access', $row->access);
     $form->set('created_by_alias', $row->created_by_alias);
     $form->set('created', JHTML::_('date', $row->created, '%Y-%m-%d %H:%M:%S'));
     $form->set('publish_up', JHTML::_('date', $row->publish_up, '%Y-%m-%d %H:%M:%S'));
     if (JHTML::_('date', $row->publish_down, '%Y') <= 1969 || $row->publish_down == $db->getNullDate()) {
         $form->set('publish_down', JText::_('Never'));
     } else {
         $form->set('publish_down', JHTML::_('date', $row->publish_down, '%Y-%m-%d %H:%M:%S'));
     }
     // Advanced Group
     $form->loadINI($row->attribs);
     // Metadata Group
     $form->set('description', $row->metadesc);
     $form->set('keywords', $row->metakey);
     $form->loadINI($row->metadata);
     ContentView::editContent($row, $contentSection, $lists, $sectioncategories, $option, $form);
 }
Example #22
0
 public static function checkedOut($row, $i, $identifier = 'id')
 {
     $user = KFactory::get('lib.joomla.user');
     $userid = $user->get('id');
     $result = false;
     if (is_a($row, 'JTable')) {
         $result = $row->isCheckedOut($userid);
     } else {
         $result = JTable::isCheckedOut($userid, $row->checked_out);
     }
     $checked = '';
     if ($result) {
         $checked = KViewHelperGrid::_checkedOut($row);
     } else {
         $checked = KViewHelper::_('grid.id', $i, $row->{$identifier});
     }
     return $checked;
 }
Example #23
0
    function showMolecules(&$rows, &$pageNav, $option, &$lists)
    {
        $user =& JFactory::getUser();
        //var_dump($rows);
        //Ordering allowed ?
        $ordering = $lists['order'] == 'cd.ordering';
        JHTML::_('behavior.tooltip');
        ?>
        <form action="index.php?option=com_chem" method="post" name="adminForm">

            <table>
                <tr>
                    <td align="left" width="100%">
                        <?php 
        echo JText::_('Filter');
        ?>
:
                        <input type="text" name="search" id="search" value="<?php 
        echo htmlspecialchars($lists['search']);
        ?>
" class="text_area" onchange="document.adminForm.submit();" />
                        <button onclick="this.form.submit();"><?php 
        echo JText::_('Go');
        ?>
</button>
<!--                        <button onclick="document.getElementById('search').value='';this.form.getElementById('filter_catid').value='0';this.form.getElementById('filter_state').value='';this.form.submit();">--><?php 
        //echo JText::_( 'Reset' );
        ?>
<!--</button>-->
                        <button onclick="document.getElementById('search').value='';this.form.submit();"><?php 
        echo JText::_('Reset');
        ?>
</button>
                    </td>
                    <td nowrap="nowrap">
                        <?php 
        //                        echo $lists['catid'];
        //                        echo $lists['state'];
        ?>
                    </td>
                </tr>
            </table>

            <table class="adminlist">
                <thead>
                <tr>
                    <th width="10" rowspan="2">
                        <?php 
        echo JText::_('Num');
        ?>
                    </th>

                    <th width="10" class="title" rowspan="2">
                        <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
                    </th>

                    <th width="1%" nowrap="nowrap" rowspan="2">
                        <?php 
        echo JHTML::_('grid.sort', 'ID', 'ch.id', @$lists['order_Dir'], @$lists['order']);
        ?>
                    </th>

                    <th rowspan="2">
                        <?php 
        echo JHTML::_('grid.sort', 'Catalog number', 'ch.cat_namber', @$lists['order_Dir'], @$lists['order']);
        ?>
                    </th>

                    <th class="title" rowspan="2">
                        <?php 
        echo JHTML::_('grid.sort', 'Molecular Weight', 'ch.mol_weigh', @$lists['order_Dir'], @$lists['order']);
        ?>
                    </th>

                    <th class="title" nowrap="nowrap" rowspan="2">
                        <?php 
        echo JHTML::_('grid.sort', 'Available from stock', 'ch.mass', @$lists['order_Dir'], @$lists['order']);
        ?>
                    </th>

                    <th colspan="12">Price</th>
                </tr>
                <tr>
                    <th>
                        <?php 
        echo JTEXT::_('1 mg');
        ?>
                    </th>
                    <th>
                        <?php 
        echo JTEXT::_('2 mg');
        ?>
                    </th>
                    <th>
                        <?php 
        echo JTEXT::_('3 mg');
        ?>
                    </th>
                    <th>
                        <?php 
        echo JTEXT::_('4 mg');
        ?>
                    </th>
                    <th>
                        <?php 
        echo JTEXT::_('5 mg');
        ?>
                    </th>
                    <th>
                        <?php 
        echo JTEXT::_('10 mg');
        ?>
                    </th>
                    <th>
                        <?php 
        echo JTEXT::_('15 mg');
        ?>
                    </th>
                    <th>
                        <?php 
        echo JTEXT::_('20 mg');
        ?>
                    </th>
                    <th>
                        <?php 
        echo JTEXT::_('25 mg');
        ?>
                    </th>
                    <th>
                        <?php 
        echo JTEXT::_('5 mmol');
        ?>
                    </th>
                    <th>
                        <?php 
        echo JTEXT::_('10 mmol');
        ?>
                    </th>
                    <th>
                        <?php 
        echo JTEXT::_('20 mmol');
        ?>
                    </th>

                </tr>
                </thead>
                <tfoot>
                <tr>
                    <td colspan="18">
                        <?php 
        echo $pageNav->getListFooter();
        ?>
                    </td>
                </tr>
                </tfoot>
                <tbody>
                <?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row = $rows[$i];
            $link = JRoute::_('index.php?option=com_chem&task=edit&cid[]=' . $row->id);
            $checked = JHTML::_('grid.checkedout', $row, $i);
            $access = JHTML::_('grid.access', $row, $i);
            $published = JHTML::_('grid.published', $row, $i);
            //                    $row->cat_link 	= JRoute::_( 'index.php?option=com_categories&section=com_contact_details&task=edit&type=other&cid[]='. $row->catid );
            //                    $row->user_link	= JRoute::_( 'index.php?option=com_users&task=editA&cid[]='. $row->user_id );
            ?>
                    <tr class="<?php 
            echo "row{$k}";
            ?>
">
                        <td>
                            <?php 
            echo $pageNav->getRowOffset($i);
            ?>
                        </td>

                        <td>
                            <?php 
            echo $checked;
            ?>
                        </td>

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


                        <td align="center">
                            <?php 
            if (JTable::isCheckedOut($user->get('id'), $row->checked_out)) {
                echo htmlspecialchars($row->cat_namber);
            } else {
                ?>
                                <span class="editlinktip hasTip" title="<?php 
                echo JText::_('Edit Element');
                ?>
::<?php 
                echo htmlspecialchars($row->cat_namber);
                ?>
">
						<a href="<?php 
                echo $link;
                ?>
">
                            <?php 
                echo htmlspecialchars($row->cat_namber);
                ?>
</a> </span>
                            <?php 
            }
            ?>
                        </td>

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

            <input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
            <input type="hidden" name="task" value="" />
            <input type="hidden" name="boxchecked" value="0" />
            <input type="hidden" name="filter_order" value="<?php 
        echo $lists['order'];
        ?>
" />
            <input type="hidden" name="filter_order_Dir" value="<?php 
        echo $lists['order_Dir'];
        ?>
" />
            <?php 
        echo JHTML::_('form.token');
        ?>
        </form>
    <?php 
    }
Example #24
0
    function banners(&$rows, &$pageNav, &$lists)
    {
        BannersViewBanner::setBannersToolbar();
        $user =& JFactory::getUser();
        $ordering = $lists['order'] == 'b.ordering';
        JHTML::_('behavior.tooltip');
        ?>
		<form action="index.php?option=com_banners" method="post" name="adminForm">
		<table>
		<tr>
			<td align="left" width="100%">
				<?php 
        echo JText::_('Filter');
        ?>
:
				<input type="text" name="search" id="search" value="<?php 
        echo $lists['search'];
        ?>
" class="text_area" onchange="document.adminForm.submit();" />
				<button onclick="this.form.submit();"><?php 
        echo JText::_('Go');
        ?>
</button>
				<button onclick="document.getElementById('search').value='';this.form.getElementById('filter_catid').value='0';this.form.getElementById('filter_state').value='';this.form.submit();"><?php 
        echo JText::_('Filter Reset');
        ?>
</button>
			</td>
			<td nowrap="nowrap">
				<?php 
        echo $lists['catid'];
        echo $lists['state'];
        ?>
			</td>
		</tr>
		</table>

			<table class="adminlist">
			<thead>
				<tr>
					<th width="20">
						<?php 
        echo JText::_('Num');
        ?>
					</th>
					<th width="20">
						<input type="checkbox" name="toggle" value=""  onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
					</th>
					<th nowrap="nowrap" class="title">
						<?php 
        echo JHTML::_('grid.sort', 'Name', 'b.name', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="10%" nowrap="nowrap">
						<?php 
        echo JHTML::_('grid.sort', 'Client', 'c.name', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="10%" nowrap="nowrap">
						<?php 
        echo JHTML::_('grid.sort', 'Category', 'cc.title', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="5%" nowrap="nowrap">
						<?php 
        echo JHTML::_('grid.sort', 'Published', 'b.showBanner', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="8%" nowrap="nowrap">
						<?php 
        echo JHTML::_('grid.sort', 'Order', 'b.ordering', @$lists['order_Dir'], @$lists['order']);
        ?>
						<?php 
        if ($ordering) {
            echo JHTML::_('grid.order', $rows);
        }
        ?>
					</th>
					<th width="5%" nowrap="nowrap">
						<?php 
        echo JHTML::_('grid.sort', 'Sticky', 'b.Sticky', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="5%" nowrap="nowrap">
						<?php 
        echo JHTML::_('grid.sort', 'Impressions', 'b.impmade', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="80">
						<?php 
        echo JHTML::_('grid.sort', 'Clicks', 'b.clicks', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="5%" nowrap="nowrap">
						<?php 
        echo JText::_('Tags');
        ?>
					</th>
					<th width="1%" nowrap="nowrap">
						<?php 
        echo JHTML::_('grid.sort', 'ID', 'b.bid', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
				</tr>
			</thead>
			<tfoot>
				<tr>
					<td colspan="13">
						<?php 
        echo $pageNav->getListFooter();
        ?>
					</td>
				</tr>
			</tfoot>
			<tbody>
			<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $row->id = $row->bid;
            $link = JRoute::_('index.php?option=com_banners&task=edit&cid[]=' . $row->id);
            if ($row->imptotal <= 0) {
                $row->imptotal = JText::_('unlimited');
            }
            if ($row->impmade != 0) {
                $percentClicks = 100 * $row->clicks / $row->impmade;
            } else {
                $percentClicks = 0;
            }
            $row->published = $row->showBanner;
            $published = JHTML::_('grid.published', $row, $i);
            $checked = JHTML::_('grid.checkedout', $row, $i);
            ?>
				<tr class="<?php 
            echo "row{$k}";
            ?>
">
					<td align="center">
						<?php 
            echo $pageNav->getRowOffset($i);
            ?>
					</td>
					<td align="center">
						<?php 
            echo $checked;
            ?>
					</td>
					<td>
					<span class="editlinktip hasTip" title="<?php 
            echo JText::_('Edit');
            ?>
::<?php 
            echo $row->name;
            ?>
">
						<?php 
            if (JTable::isCheckedOut($user->get('id'), $row->checked_out)) {
                echo $row->name;
            } else {
                ?>

							<a href="<?php 
                echo $link;
                ?>
">
								<?php 
                echo $row->name;
                ?>
</a>
							<?php 
            }
            ?>
						</span>
					</td>
					<td align="center">
						<?php 
            echo $row->client_name;
            ?>
					</td>
					<td align="center">
						<?php 
            echo $row->category_name;
            ?>
					</td>
					<td align="center">
						<?php 
            echo $published;
            ?>
					</td>
					<td class="order">
                    	<?php 
            $disabled = $ordering ? '' : 'disabled="disabled"';
            ?>
						<input type="text" name="order[]" size="5" value="<?php 
            echo $row->ordering;
            ?>
" <?php 
            echo $disabled;
            ?>
 class="text_area" style="text-align: center" />
					</td>
					<td align="center">
						<?php 
            echo $row->sticky ? JText::_('Yes') : JText::_('No');
            ?>
					</td>
					<td align="center">
						<?php 
            echo $row->impmade . ' ' . JText::_('of') . ' ' . $row->imptotal;
            ?>
					</td>
					<td align="center">
						<?php 
            echo $row->clicks;
            ?>
 -
						<?php 
            echo sprintf('%.2f%%', $percentClicks);
            ?>
					</td>
					<td>
						<?php 
            echo $row->tags;
            ?>
					</td>
					<td align="center">
						<?php 
            echo $row->id;
            ?>
					</td>
				</tr>
				<?php 
            $k = 1 - $k;
        }
        ?>
			</tbody>
			</table>

		<input type="hidden" name="c" value="banner" />
		<input type="hidden" name="option" value="com_banners" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="filter_order" value="<?php 
        echo $lists['order'];
        ?>
" />
		<input type="hidden" name="filter_order_Dir" value="<?php 
        echo $lists['order_Dir'];
        ?>
" />
		<?php 
        echo JHTML::_('form.token');
        ?>
		</form>
		<?php 
    }
Example #25
0
 public static function checkedOut($row, $i, $identifier = 'id')
 {
     $userid = JFactory::getUser()->get('id');
     $result = false;
     if ($row instanceof JTable) {
         $result = $row->isCheckedOut($userid);
     } else {
         $result = JTable::isCheckedOut($userid, $row->checked_out);
     }
     $checked = '';
     if ($result) {
         $checked = self::_checkedOut($row);
     } else {
         if ($identifier == 'id') {
             $checked = self::id($i, $row->{$identifier});
         } else {
             $checked = self::id($i, $row->{$identifier}, $result, $identifier);
         }
     }
     return $checked;
 }
    /**
     * Writes a list of the categories for a section
     * @param array An array of category objects
     * @param string The name of the category section
     */
    function show(&$rows, $scope, $myid, &$page, $option, &$lists)
    {
        $limitstart = JRequest::getVar('limitstart', '0', '', 'int');
        $user =& JFactory::getUser();
        //Ordering allowed ?
        $ordering = $lists['order'] == 's.ordering';
        JHTML::_('behavior.tooltip');
        ?>
		<form action="index.php?option=com_sections&amp;scope=<?php 
        echo $scope;
        ?>
" method="post" name="adminForm">

		<table>
		<tr>
			<td align="left" width="100%">
				<?php 
        echo JText::_('Filter');
        ?>
:
				<input type="text" name="search" id="search" value="<?php 
        echo htmlspecialchars($lists['search']);
        ?>
" class="text_area" onchange="document.adminForm.submit();" />
				<button onclick="this.form.submit();"><?php 
        echo JText::_('Go');
        ?>
</button>
				<button onclick="document.getElementById('search').value='';this.form.submit();"><?php 
        echo JText::_('Reset');
        ?>
</button>
			</td>
			<td nowrap="nowrap">
				<?php 
        echo $lists['state'];
        ?>
			</td>
		</tr>
		</table>

		<table class="adminlist">
		<thead>
			<tr>
				<th width="10">
					<?php 
        echo JText::_('NUM');
        ?>
				</th>
				<th width="10">
					<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
				</th>
				<th class="title">
					<?php 
        echo JHTML::_('grid.sort', 'Title', 's.title', @$lists['order_Dir'], @$lists['order']);
        ?>
				</th>
				<th width="5%">
					<?php 
        echo JHTML::_('grid.sort', 'Published', 's.published', @$lists['order_Dir'], @$lists['order']);
        ?>
				</th>
				<th width="8%" nowrap="nowrap">
					<?php 
        echo JHTML::_('grid.sort', 'Order', 's.ordering', @$lists['order_Dir'], @$lists['order']);
        ?>
					<?php 
        if ($ordering) {
            echo JHTML::_('grid.order', $rows);
        }
        ?>
				</th>
				
				<th width="5%" nowrap="nowrap">
					<?php 
        echo JText::_('Type');
        ?>
				</th>
                <th width="1%" nowrap="nowrap">
					<?php 
        echo JHTML::_('grid.sort', 'ID', 's.id', @$lists['order_Dir'], @$lists['order']);
        ?>
				</th>
			</tr>
		</thead>
		<tfoot>
			<tr>
				<td colspan="13">
					<?php 
        echo $page->getListFooter();
        ?>
				</td>
			</tr>
		</tfoot>
		<tbody>
		<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $link = 'index.php?option=com_sections&scope=content&task=edit&cid[]=' . $row->id;
            $access = JHTML::_('grid.access', $row, $i);
            $checked = JHTML::_('grid.checkedout', $row, $i);
            $published = JHTML::_('grid.published', $row, $i);
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
				<td align="center">
					<?php 
            echo $page->getRowOffset($i);
            ?>
				</td>
				<td>
					<?php 
            echo $checked;
            ?>
				</td>
				<td>
					<span class="editlinktip hasTip" title="<?php 
            echo JText::_('Title');
            ?>
::<?php 
            echo htmlspecialchars($row->title);
            ?>
">
					<?php 
            if (JTable::isCheckedOut($user->get('id'), $row->checked_out)) {
                echo htmlspecialchars($row->title);
            } else {
                ?>
						<a href="<?php 
                echo JRoute::_($link);
                ?>
">
							<?php 
                echo htmlspecialchars($row->title);
                ?>
</a>
						<?php 
            }
            ?>
</span>
				</td>
				<td align="center">
					<?php 
            echo $published;
            ?>
				</td>
				<td class="order">
					<span><?php 
            echo $page->orderUpIcon($i, true, 'orderup', 'Move Up', $ordering);
            ?>
</span>
					<span><?php 
            echo $page->orderDownIcon($i, $n, true, 'orderdown', 'Move Down', $ordering);
            ?>
</span>
					<?php 
            $disabled = $ordering ? '' : 'disabled="disabled"';
            ?>
					<input type="text" name="order[]" size="5" value="<?php 
            echo $row->ordering;
            ?>
" <?php 
            echo $disabled;
            ?>
 class="text_area" style="text-align: center" />
				</td>
				<td align="center">
                
              <input type="hidden" id="status<?php 
            echo $row->id;
            ?>
" value="<?php 
            echo $row->status;
            ?>
">
			  <?php 
            if ($row->status == "SY") {
                echo "Default";
            }
            ?>
					
				</td>
                
				<td align="center">
					<?php 
            echo $row->id;
            ?>
				</td>
				<?php 
            $k = 1 - $k;
            ?>
			</tr>
			<?php 
        }
        ?>
		</tbody>
		</table>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="scope" value="<?php 
        echo $scope;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="chosen" value="" />
		<input type="hidden" name="act" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="filter_order" value="<?php 
        echo $lists['order'];
        ?>
" />
		<input type="hidden" name="filter_order_Dir" value="<?php 
        echo $lists['order_Dir'];
        ?>
" />
		<?php 
        echo JHTML::_('form.token');
        ?>
		</form>
         
        
         <script language="javascript" type="text/javascript">
		 
		 function getAllIdsChecked() {
			 var cids = document.getElementsByName('cid[]');
			 var l = cids.length;
			 for (var d =0 ; d < l ;d++)  {
				 if (cids[d].checked == true) {
					var a = document.getElementById("status"+cids[d].value).value;
					if (a == "SY") {
						alert("It is a default section so cant delete");
						return false;
					}
				 }
			 }
			 return true;
		 }
		 
		function submitbutton(pressbutton) {
			if (pressbutton == "remove") {
				if (getAllIdsChecked()) {
					submitform( pressbutton );
				}
			} else {
				submitform( pressbutton );
			}
			
		}
		</script>
        <?php 
    }
Example #27
0
    /**
     * Writes a list of the defined modules
     * @param array An array of category objects
     */
    function view(&$rows, &$client, &$page, &$lists)
    {
        $user =& JFactory::getUser();
        //Ordering allowed ?
        $ordering = $lists['order'] == 'm.position';
        JHTML::_('behavior.tooltip');
        ?>
		<form action="index.php?option=com_modules" method="post" name="adminForm">

			<table>
			<tr>
				<td align="left" width="100%">
					<?php 
        echo JText::_('Filter');
        ?>
:
					<input type="text" name="search" id="search" value="<?php 
        echo $lists['search'];
        ?>
" class="text_area" onchange="document.adminForm.submit();" />
					<button onclick="this.form.submit();"><?php 
        echo JText::_('Go');
        ?>
</button>
					<button onclick="document.getElementById('search').value='';this.form.submit();"><?php 
        echo JText::_('Reset');
        ?>
</button>
				</td>
				<td nowrap="nowrap">
					<?php 
        echo $lists['assigned'];
        echo $lists['position'];
        echo $lists['type'];
        echo $lists['state'];
        ?>
				</td>
			</tr>
			</table>

			<table class="adminlist" cellspacing="1">
			<thead>
			<tr>
				<th width="20">
					<?php 
        echo JText::_('NUM');
        ?>
				</th>
				<th width="20">
					<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
				</th>
				<th class="title">
					<?php 
        echo JHTML::_('grid.sort', 'Module Name', 'm.title', @$lists['order_Dir'], @$lists['order']);
        ?>
				</th>
				<th nowrap="nowrap" width="7%">
					<?php 
        echo JHTML::_('grid.sort', 'Published', 'm.published', @$lists['order_Dir'], @$lists['order']);
        ?>
				</th>
				<th width="80" nowrap="nowrap">
					<?php 
        echo JHTML::_('grid.sort', 'Order', 'm.position', @$lists['order_Dir'], @$lists['order']);
        ?>
				</th>
				<th width="1%">
					<?php 
        echo JHTML::_('grid.order', $rows);
        ?>
				</th>
				<?php 
        if ($client->id == 0) {
            ?>
					<th nowrap="nowrap" width="7%">
						<?php 
            echo JHTML::_('grid.sort', 'Access', 'groupname', @$lists['order_Dir'], @$lists['order']);
            ?>
					</th>
					<?php 
        }
        ?>
				<th nowrap="nowrap" width="7%">
					<?php 
        echo JHTML::_('grid.sort', 'Position', 'm.position', @$lists['order_Dir'], @$lists['order']);
        ?>
				</th>
				<th nowrap="nowrap" width="5%">
					<?php 
        echo JHTML::_('grid.sort', 'Pages', 'pages', @$lists['order_Dir'], @$lists['order']);
        ?>
				</th>
				<th nowrap="nowrap" width="10%"  class="title">
					<?php 
        echo JHTML::_('grid.sort', 'Type', 'm.module', @$lists['order_Dir'], @$lists['order']);
        ?>
				</th>
				<th nowrap="nowrap" width="1%">
					<?php 
        echo JHTML::_('grid.sort', 'ID', 'm.id', @$lists['order_Dir'], @$lists['order']);
        ?>
				</th>
			</tr>
			</thead>
			<tfoot>
			<tr>
				<td colspan="12">
					<?php 
        echo $page->getListFooter();
        ?>
				</td>
			</tr>
			</tfoot>
			<tbody>
			<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $link = JRoute::_('index.php?option=com_modules&client=' . $client->id . '&task=edit&cid[]=' . $row->id);
            $access = JHTML::_('grid.access', $row, $i);
            $checked = JHTML::_('grid.checkedout', $row, $i);
            $published = JHTML::_('grid.published', $row, $i);
            ?>
				<tr class="<?php 
            echo "row{$k}";
            ?>
">
					<td align="right">
						<?php 
            echo $page->getRowOffset($i);
            ?>
					</td>
					<td width="20">
						<?php 
            echo $checked;
            ?>
					</td>
					<td>
					<?php 
            if (JTable::isCheckedOut($user->get('id'), $row->checked_out)) {
                echo $row->title;
            } else {
                ?>
						<span class="editlinktip hasTip" title="<?php 
                echo JText::_('Edit Module');
                ?>
::<?php 
                echo $row->title;
                ?>
">
						<a href="<?php 
                echo $link;
                ?>
">
							<?php 
                echo $row->title;
                ?>
</a>
						</span>
						<?php 
            }
            ?>
					</td>
					<td align="center">
						<?php 
            echo $published;
            ?>
					</td>
					<td class="order" colspan="2">
						<span><?php 
            echo $page->orderUpIcon($i, $row->position == @$rows[$i - 1]->position, 'orderup', 'Move Up', $ordering);
            ?>
</span>
						<span><?php 
            echo $page->orderDownIcon($i, $n, $row->position == @$rows[$i + 1]->position, 'orderdown', 'Move Down', $ordering);
            ?>
</span>
						<?php 
            $disabled = $ordering ? '' : 'disabled="disabled"';
            ?>
						<input type="text" name="order[]" size="5" value="<?php 
            echo $row->ordering;
            ?>
" <?php 
            echo $disabled;
            ?>
 class="text_area" style="text-align: center" />
					</td>
					<?php 
            if ($client->id == 0) {
                ?>
						<td align="center">
							<?php 
                echo $access;
                ?>
						</td>
						<?php 
            }
            ?>
					<td align="center">
						<?php 
            echo $row->position;
            ?>
					</td>
					<td align="center">
						<?php 
            if (is_null($row->pages)) {
                echo JText::_('None');
            } else {
                if ($row->pages > 0) {
                    echo JText::_('Varies');
                } else {
                    echo JText::_('All');
                }
            }
            ?>
					</td>
					<td>
						<?php 
            echo $row->module ? $row->module : JText::_('User');
            ?>
					</td>
					<td>
						<?php 
            echo $row->id;
            ?>
					</td>
				</tr>
				<?php 
            $k = 1 - $k;
        }
        ?>
			</tbody>
			</table>

		<input type="hidden" name="option" value="com_modules" />
		<input type="hidden" name="client" value="<?php 
        echo $client->id;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="filter_order" value="<?php 
        echo $lists['order'];
        ?>
" />
		<input type="hidden" name="filter_order_Dir" value="<?php 
        echo $lists['order_Dir'];
        ?>
" />
		<?php 
        echo JHTML::_('form.token');
        ?>
		</form>
		<?php 
    }
 /**
  * Test the isCheckedOut method when it is not checked out.
  *
  * @return  void
  *
  * @since   12.3
  */
 public function testIsCheckedOutFalse()
 {
     $this->object->load(array('id1' => 25, 'id2' => 50));
     $this->assertFalse($this->object->isCheckedOut());
 }
Example #29
0
    /**
     * Writes a list of the categories for a section
     * @param array An array of category objects
     * @param string The name of the category section
     */
    function show(&$rows, $scope, $myid, &$page, $option, &$lists)
    {
        $limitstart = JRequest::getVar('limitstart', '0', '', 'int');
        $user =& JFactory::getUser();
        //Ordering allowed ?
        $ordering = $lists['order'] == 's.ordering';
        JHTML::_('behavior.tooltip');
        ?>
		<form action="index.php?option=com_sections&amp;scope=<?php 
        echo $scope;
        ?>
" method="post" name="adminForm">

		<table>
		<tr>
			<td align="left" width="100%">
				<?php 
        echo JText::_('Filter');
        ?>
:
				<input type="text" name="search" id="search" value="<?php 
        echo $lists['search'];
        ?>
" class="text_area" onchange="document.adminForm.submit();" />
				<button onclick="this.form.submit();"><?php 
        echo JText::_('Go');
        ?>
</button>
				<button onclick="document.getElementById('search').value='';this.form.submit();"><?php 
        echo JText::_('Reset');
        ?>
</button>
			</td>
			<td nowrap="nowrap">
				<?php 
        echo $lists['state'];
        ?>
			</td>
		</tr>
		</table>

		<table class="adminlist">
		<thead>
			<tr>
				<th width="10">
					<?php 
        echo JText::_('NUM');
        ?>
				</th>
				<th width="10">
					<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
				</th>
				<th class="title">
					<?php 
        echo JHTML::_('grid.sort', 'Title', 's.title', @$lists['order_Dir'], @$lists['order']);
        ?>
				</th>
				<th width="5%">
					<?php 
        echo JHTML::_('grid.sort', 'Published', 's.published', @$lists['order_Dir'], @$lists['order']);
        ?>
				</th>
				<th width="8%" nowrap="nowrap">
					<?php 
        echo JHTML::_('grid.sort', 'Order', 's.ordering', @$lists['order_Dir'], @$lists['order']);
        ?>
					<?php 
        echo JHTML::_('grid.order', $rows);
        ?>
				</th>
				<th width="10%">
					<?php 
        echo JHTML::_('grid.sort', 'Access', 'groupname', @$lists['order_Dir'], @$lists['order']);
        ?>
				</th>
				<th width="5%" nowrap="nowrap">
					<?php 
        echo JText::_('Num Categories');
        ?>
				</th>
				<th width="5%" nowrap="nowrap">
					<?php 
        echo JText::_('Num Active');
        ?>
				</th>
				<th width="5%" nowrap="nowrap">
					<?php 
        echo JText::_('Num Trash');
        ?>
				</th>
				<th width="1%" nowrap="nowrap">
					<?php 
        echo JHTML::_('grid.sort', 'ID', 's.id', @$lists['order_Dir'], @$lists['order']);
        ?>
				</th>
			</tr>
		</thead>
		<tfoot>
			<tr>
				<td colspan="13">
					<?php 
        echo $page->getListFooter();
        ?>
				</td>
			</tr>
		</tfoot>
		<tbody>
		<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $link = 'index.php?option=com_sections&scope=content&task=edit&cid[]=' . $row->id;
            $access = JHTML::_('grid.access', $row, $i);
            $checked = JHTML::_('grid.checkedout', $row, $i);
            $published = JHTML::_('grid.published', $row, $i);
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
				<td align="center">
					<?php 
            echo $page->getRowOffset($i);
            ?>
				</td>
				<td>
					<?php 
            echo $checked;
            ?>
				</td>
				<td>
					<span class="editlinktip hasTip" title="<?php 
            echo JText::_('Title');
            ?>
::<?php 
            echo $row->title;
            ?>
">
					<?php 
            if (JTable::isCheckedOut($user->get('id'), $row->checked_out)) {
                echo $row->title;
            } else {
                ?>
						<a href="<?php 
                echo JRoute::_($link);
                ?>
">
							<?php 
                echo $row->title;
                ?>
</a>
						<?php 
            }
            ?>
</span>
				</td>
				<td align="center">
					<?php 
            echo $published;
            ?>
				</td>
				<td class="order">
					<span><?php 
            echo $page->orderUpIcon($i, true, 'orderup', 'Move Up', $ordering);
            ?>
</span>
					<span><?php 
            echo $page->orderDownIcon($i, $n, true, 'orderdown', 'Move Down', $ordering);
            ?>
</span>
					<?php 
            $disabled = $ordering ? '' : 'disabled="disabled"';
            ?>
					<input type="text" name="order[]" size="5" value="<?php 
            echo $row->ordering;
            ?>
" <?php 
            echo $disabled;
            ?>
 class="text_area" style="text-align: center" />
				</td>
				<td align="center">
					<?php 
            echo $access;
            ?>
				</td>
				<td align="center">
					<?php 
            echo $row->categories;
            ?>
				</td>
				<td align="center">
					<?php 
            echo $row->active;
            ?>
				</td>
				<td align="center">
					<?php 
            echo $row->trash;
            ?>
				</td>
				<td align="center">
					<?php 
            echo $row->id;
            ?>
				</td>
				<?php 
            $k = 1 - $k;
            ?>
			</tr>
			<?php 
        }
        ?>
		</tbody>
		</table>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="scope" value="<?php 
        echo $scope;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="chosen" value="" />
		<input type="hidden" name="act" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="filter_order" value="<?php 
        echo $lists['order'];
        ?>
" />
		<input type="hidden" name="filter_order_Dir" value="<?php 
        echo $lists['order_Dir'];
        ?>
" />
		<?php 
        echo JHTML::_('form.token');
        ?>
		</form>
		<?php 
    }
Example #30
0
 /**
  * Checks in the current item and displays the previous/next one in the list
  * Should be called from a public function in your controller.
  *
  * It is the responsibility of each child controller to check the validity of the request using
  * (j1.6+) JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
  * or
  * (j1.5) JRequest::checkToken() or die( 'Invalid Token' );
  *
  * @return boolean
  */
 protected function doJump()
 {
     $input = JFactory::getApplication()->input;
     $task = $input->getString('task');
     $model = $this->getModel($this->get('suffix'));
     $id = $model->getId();
     $row = $model->getTable();
     $row->load($id);
     if (isset($row->checked_out) && !JTable::isCheckedOut(JFactory::getUser()->id, $row->checked_out)) {
         $row->checkin();
     }
     $redirect = "index.php?option=" . $this->get('com') . "&view=" . $this->get('suffix');
     $model->emptyState();
     $this->_setModelState();
     $surrounding = $model->getSurrounding($id);
     switch ($task) {
         case "prev":
             if (!empty($surrounding['prev'])) {
                 $redirect .= "&task=view&id=" . $surrounding['prev'];
             }
             break;
         case "next":
             if (!empty($surrounding['next'])) {
                 $redirect .= "&task=view&id=" . $surrounding['next'];
             }
             break;
     }
     $redirect = JRoute::_($redirect, false);
     $this->setRedirect($redirect, $this->message, $this->messagetype);
 }