/** * run when the table loads its data(non-PHPdoc) * @see components/com_fabrik/models/FabrikModelTablePlugin#onLoadData($params, $oRequest) */ function onLoadData($params, &$model) { if (jRequest::getVar('format') != 'raw') { return; } if (JRequest::getInt('Itemid') == 57) { $this->getCalendarList($model); } else { $this->getCalendarDays($model); } $this->logRequest($model); }
<span style="font-size:35px; color:#65071B; font-weight:bold; font-family:'Times New Roman', Times, serif;"><?php echo $this->userdata['yours_name']; ?> </span> <p style="color:#014D87; font-size:16px; margin:7px 0 10px 0;"><?php echo $this->userdata['slogan']; ?> </p> </div> </td> </tr> <tr> <td height="300" align="center" valign="top"><table width="660" height="280" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="480" valign="top"> <?php if (jRequest::getVar('view') == 'home') { ?> <div id="banner"> <?php foreach ($this->userdata['homeimg'] as $img) { ?> <img src="<?php echo $img; ?> " alt="Banner" width="400px" height="250px" /> <?php } ?>
$tab2->endPane(); ?> </td> </tr> </table> <table class="adminlist"> <tr> <td colspan="2"> <?php $ps_stock->addCssJs(); $helperFields = $ps_stock->getHelper('fields'); $scanitemactions_param = array(); $scanitemactions_param['soa'] = jRequest::getVar('soa', 'sbor'); $actions = $helperFields->getField('scanitemactions', $order_id, $scanitemactions_param); if ($order_status != 'X') { echo $actions; } ?> </td> </tr> </table> <div id="orderitemstable_cont" order_id='<?php echo $order_id; ?> '> <table class="adminlist" id='orderitemstable'> <tr>
function legacytoggle() { if (defined('_JLEGACY')) { $mode = 0; } else { $mode = 1; } $db =& JFactory::getDBO(); $db->setQuery("update #__plugins set published={$mode} where element='legacy'"); $db->query(); $task = jRequest::getVar('redirect', 'display'); $this->setRedirect('index.php?option=com_updater&task=' . $task, 'Legacy Mode Enabled.', 'message'); return; }
/** * Order category group * * order is saved for all viewed records, this mean old function was obselete * @author Patrick Kohl/Studio42 * @param array $cats categories to order * @return bool */ public function saveorder($cids, $order) { $category_id = JRequest::getInt('filter_category_id'); $search = jRequest::getVar('search'); $orderDir = jRequest::getWord('filter_order_Dir') == 'ASC' ? 'ASC' : 'DESC'; // impossible case if (empty($cids[0])) { return 0; } // get old orders(including all items from same parent to get the right INDEX in array) $q = 'SELECT * FROM `#__virtuemart_category_categories` WHERE category_parent_id in (SELECT category_parent_id FROM `#__virtuemart_category_categories` WHERE category_child_id = ' . (int) $cids[0] . ') ORDER BY `ordering` ASC'; $this->_db->setQuery($q); $categories = $this->_db->loadObjectList(); $ordered = 0; $msg = ''; // set new order array(); $newOrders = array(); foreach ($cids as $key => $cid) { $newOrders[$cid] = $key; } $toUpdate = array(); // list of category to update $when = ''; // check ordered categories from DB foreach ($categories as $oldOrder => $category) { $ordering = $oldOrder; // set the theorical ordering from this level //test if we have a new ordering if (isset($newOrders[$category->category_child_id])) { if (!isset($start)) { $start = $ordering; if ($orderDir === 'DESC') { $start += count($cids); } // add counted from request to start for DESC order } // set the new order from request $tmpOrder = $newOrders[$category->category_child_id]; $ordering = $start; if ($orderDir === 'ASC') { $ordering = $ordering + $tmpOrder; } else { $ordering = $ordering - $tmpOrder; } } //only apply for new orderings if ($category->ordering === $ordering) { continue; } $when .= ' WHEN ' . $category->category_child_id . ' THEN "' . $ordering . '" '; $toUpdate[] = $category->category_child_id; $msg .= $ordering . ' ' . $category->category_child_id . ', '; $ordered++; } if ($ordered) { $in = implode(",", $toUpdate); // this update all, in one sql connection $this->_db->setQuery('UPDATE `#__virtuemart_category_categories` SET ordering = CASE category_child_id ' . $when . ' END WHERE category_child_id IN (' . $in . ')'); if (!$this->_db->execute()) { vmError($this->_db->getErrorMsg()); return FALSE; } } // echo json_encode($newOrders); return $ordered . ' ' . $msg; }