public function getPublish(&$row, $type, $ajaxTask) { $version = new Jversion(); $currentV = $version->getHelpVersion(); $class = 'jgrid'; $alt = $row->{$type} ? JText::_('COM_COMMUNITY_PUBLISHED') : JText::_('COM_COMMUNITY_UNPUBLISH'); $state = $row->{$type} == 1 ? 'publish' : 'unpublish'; $span = '<span class="state ' . $state . '"><span class="text">' . $alt . '</span></span></a>'; if ($currentV >= '0.30') { $class = $row->{$type} == 1 ? 'disabled jgrid' : ''; $span = '<i class="icon-' . $state . '"></i>'; } $href = '<a class="' . $class . '" href="javascript:void(0);" onclick="azcommunity.togglePublish(\'' . $ajaxTask . '\',\'' . $row->id . '\',\'' . $type . '\');">'; $href .= $span; return $href; }
function azrulGetJoomlaVersion() { static $version; if (!isset($version)) { $jversion = new Jversion(); $helpVersion = $jversion->getHelpVersion(); $version = null; if ($helpVersion == '.16') { $version = '1.6'; } if ($helpVersion == '.15') { $version = '1.5'; } } return $version; }