本文整理汇总了PHP中JVersion类的典型用法代码示例。如果您正苦于以下问题:PHP JVersion类的具体用法?PHP JVersion怎么用?PHP JVersion使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JVersion类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: downloadPackage
/**
* Downloads a package
*
* @param string $url URL of file to download
* @param string $target Download target filename [optional]
*
* @return mixed Path to downloaded package or boolean false on failure
*
* @since 11.1
*/
public static function downloadPackage($url, $target = false)
{
$config = JFactory::getConfig();
// Capture PHP errors
$track_errors = ini_get('track_errors');
ini_set('track_errors', true);
// Set user agent
$version = new JVersion();
ini_set('user_agent', $version->getUserAgent('Installer'));
$http = JHttpFactory::getHttp();
$response = $http->get($url);
if (200 != $response->code) {
JLog::add(JText::_('JLIB_INSTALLER_ERROR_DOWNLOAD_SERVER_CONNECT'), JLog::WARNING, 'jerror');
return false;
}
if ($response->headers['wrapper_data']['Content-Disposition']) {
$contentfilename = explode("\"", $response->headers['wrapper_data']['Content-Disposition']);
$target = $contentfilename[1];
}
// Set the target path if not given
if (!$target) {
$target = $config->get('tmp_path') . '/' . self::getFilenameFromURL($url);
} else {
$target = $config->get('tmp_path') . '/' . basename($target);
}
// Write buffer to file
JFile::write($target, $response->body);
// Restore error tracking to what it was before
ini_set('track_errors', $track_errors);
// Bump the max execution time because not using built in php zip libs are slow
@set_time_limit(ini_get('max_execution_time'));
// Return the name of the downloaded package
return basename($target);
}
开发者ID:houzhenggang,项目名称:cobalt,代码行数:44,代码来源:helper.php
示例2: delete
public function delete()
{
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// Get items to remove from the request.
$cid = JFactory::getApplication()->input->get('cid', array(), 'array');
if (!is_array($cid) || count($cid) < 1) {
JLog::add(JText::_($this->text_prefix . '_NO_ITEM_SELECTED'), JLog::WARNING, 'jerror');
} else {
// Get the model.
$model = $this->getModel();
// Make sure the item ids are integers
jimport('joomla.utilities.arrayhelper');
JArrayHelper::toInteger($cid);
// Remove the items.
if ($model->delete($cid)) {
$this->setMessage(JText::plural($this->text_prefix . '_N_ITEMS_DELETED', count($cid)));
} else {
$this->setMessage($model->getError());
}
}
$version = new JVersion();
if ($version->isCompatible('3.0')) {
// Invoke the postDelete method to allow for the child class to access the model.
$this->postDeleteHook($model, $cid);
}
$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false));
}
开发者ID:AndreKoepke,项目名称:Einsatzkomponente,代码行数:28,代码来源:alarmierungsarten.php
示例3: getInput
/**
* Method to get the field input markup.
*
* @return string The field input markup.
* @since 1.6
*/
protected function getInput()
{
$html = '';
$minversion = $this->element['minversion'];
$downloadlink = $this->element['downloadlink'];
$version = new JVersion();
$jversion = explode('.', $version->getShortVersion());
$class = '';
$style = '';
if (intval($jversion[0]) > 2) {
$class = 'alert alert-warning';
} else {
$style = 'margin: 5px 0; padding: 8px 35px 8px 14px; border-radius: 4px; border: 1px solid #FBEED5; background-color: #FCF8E3; color: #C09853;';
}
if (!JFolder::exists(JPATH_ROOT . '/libraries/syw')) {
$html .= '<div class="' . $class . '" style="' . $style . '">';
$html .= ' <span>' . JText::_('SYW_MISSING_SYWLIBRARY') . '</span><br />';
$html .= ' <a href="' . $downloadlink . '" target="_blank">' . JText::_('SYW_DOWNLOAD_SYWLIBRARY') . '</a>';
$html .= '</div>';
} else {
jimport('syw.version');
if (!SYWVersion::isCompatible($minversion)) {
$html .= '<div class="' . $class . '" style="' . $style . '">';
$html .= ' <span>' . JText::_('SYW_NONCOMPATIBLE_SYWLIBRARY') . '</span><br />';
$html .= ' <span>' . JText::_('SYW_UPDATE_SYWLIBRARY') . JText::_('SYW_OR') . '</span>';
$html .= ' <a href="' . $downloadlink . '" target="_blank">' . strtolower(JText::_('SYW_DOWNLOAD_SYWLIBRARY')) . '</a>';
$html .= '</div>';
}
}
return $html;
}
开发者ID:esorone,项目名称:efcpw,代码行数:37,代码来源:sywlibtest.php
示例4: preflight
public function preflight($type, $parent)
{
if ($type == 'uninstall') {
return true;
}
try {
$source = $parent->getParent()->getPath('source');
$jversion = new JVersion();
if (!$jversion->isCompatible('2.5.5')) {
throw new Exception('Please upgrade to at least Joomla! 2.5.5 before continuing!');
}
if (!file_exists(JPATH_ADMINISTRATOR . '/components/com_rsform/helpers/rsform.php')) {
throw new Exception('Please install the RSForm! Pro component before continuing.');
}
if (!file_exists(JPATH_ADMINISTRATOR . '/components/com_rsform/helpers/version.php')) {
throw new Exception('Please upgrade RSForm! Pro to at least R45 before continuing!');
}
// Copy needed files
$this->copyFiles($source);
// Update? Run our SQL file
if ($type == 'update') {
$this->runSQL($source, 'install');
}
} catch (Exception $e) {
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');
return false;
}
return true;
}
开发者ID:knigherrant,项目名称:decopatio,代码行数:29,代码来源:script.php
示例5: display
public function display($tpl = null)
{
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->categories = Djc2Categories::getInstance();
$user = JFactory::getUser();
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
$this->ordering = array();
foreach ($this->items as &$item) {
if (!isset($this->ordering[$item->parent_id])) {
$this->ordering[$item->parent_id] = array();
}
$this->ordering[$item->parent_id][] = $item->id;
}
$this->addToolbar();
if (class_exists('JHtmlSidebar') && $user->authorise('core.admin')) {
$this->sidebar = JHtmlSidebar::render();
}
$version = new JVersion();
if (version_compare($version->getShortVersion(), '3.0.0', '<')) {
$tpl = 'legacy';
}
parent::display($tpl);
}
开发者ID:jputz12,项目名称:OneNow-Vshop,代码行数:29,代码来源:view.html.php
示例6: com_uninstall
function com_uninstall()
{
jimport('joomla.filesystem.file');
jimport('joomla.version');
$version = new JVersion();
if (version_compare($version->getShortVersion(), '1.6', '>=')) {
$db = JFactory::getDBO();
$db->setQuery("Delete From #__menu Where `link` Like 'index.php?option=com_breezingforms&act=%'");
$db->query();
$db->setQuery("Delete From #__menu Where `alias` Like 'BreezingForms' And `path` Like 'breezingforms'");
$db->query();
}
if (JFile::exists(JPATH_SITE . DS . 'media' . DS . 'breezingforms' . DS . 'facileforms.config.php')) {
JFile::delete(JPATH_SITE . DS . 'media' . DS . 'breezingforms' . DS . 'facileforms.config.php');
}
if (JFile::exists(JPATH_SITE . "/components/com_sh404sef/sef_ext/com_breezingforms.php")) {
JFile::delete(JPATH_SITE . "/components/com_sh404sef/sef_ext/com_breezingforms.php");
}
if (JFile::exists(JPATH_SITE . '/ff_secimage.php')) {
JFile::delete(JPATH_SITE . '/ff_secimage.php');
}
if (JFile::exists(JPATH_SITE . '/templates/system/ff_secimage.php')) {
JFile::delete(JPATH_SITE . '/templates/system/ff_secimage.php');
}
if (JFile::exists(JPATH_SITE . "/administrator/components/com_joomfish/contentelements/breezingforms_elements.xml")) {
JFile::delete(JPATH_SITE . "/administrator/components/com_joomfish/contentelements/breezingforms_elements.xml");
}
if (JFile::exists(JPATH_SITE . "/administrator/components/com_joomfish/contentelements/translationFformFilter.php")) {
JFile::delete(JPATH_SITE . "/administrator/components/com_joomfish/contentelements/translationFformFilter.php");
}
if (JFile::exists(JPATH_SITE . "/administrator/components/com_joomfish/contentelements/translationFformoptions_emptyFilter.php")) {
JFile::delete(JPATH_SITE . "/administrator/components/com_joomfish/contentelements/translationFformoptions_emptyFilter.php");
}
}
开发者ID:juancarlos26,项目名称:checkilistabap,代码行数:34,代码来源:uninstall.php
示例7: com_install
function com_install()
{
if (defined('_JEXEC') && class_exists('JApplication')) {
$config = JFactory::getConfig();
$config->setValue('config.live_site', substr_replace(JURI::root(), '', -1, 1));
$url = JURI::root() . 'administrator/index.php?option=com_jcomments&task=postinstall';
$version = new JVersion();
if (version_compare('1.6.0', $version->getShortVersion()) > 0) {
require_once dirname(__FILE__) . DS . 'install' . DS . 'helpers' . DS . 'language.php';
JCommentsInstallerLanguageHelper::convertLanguages15();
}
} else {
global $mainframe;
$componentPath = $mainframe->getCfg('absolute_path') . DS . 'components' . DS . 'com_jcomments';
require_once $componentPath . DS . 'libraries' . DS . 'joomlatune' . DS . 'filesystem.php';
require_once $componentPath . DS . 'jcomments.legacy.php';
require_once dirname(__FILE__) . DS . 'install' . DS . 'helpers' . DS . 'installer.php';
JCommentsInstallerHelper::extractJCommentsLibraryConvert();
if (is_file($componentPath . DS . 'libraries' . DS . 'convert' . DS . 'utf8.class.php')) {
require_once dirname(__FILE__) . DS . 'install' . DS . 'helpers' . DS . 'language.php';
JCommentsInstallerLanguageHelper::convertLanguages10();
}
$url = $mainframe->getCfg('live_site') . '/administrator/index2.php?option=com_jcomments&task=postinstall';
}
if (headers_sent()) {
echo '<script type="text/javascript">document.location.href="' . $url . '";</script>';
} else {
header('Location: ' . $url);
}
}
开发者ID:carmerin,项目名称:cesae-web,代码行数:30,代码来源:install.jcomments.php
示例8: display
/**
* Display the view
*
* @access public
*/
function display($tpl = null)
{
$app = JFactory::getApplication();
$this->state = $this->get('State');
$this->item = $this->get('Item');
$this->form = $this->get('Form');
$version = new JVersion();
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
JHTML::stylesheet('administrator/components/com_xmap/css/xmap.css');
// Convert dates from UTC
$offset = $app->getCfg('offset');
if (intval($this->item->created)) {
$this->item->created = JHtml::date($this->item->created, '%Y-%m-%d %H-%M-%S', $offset);
}
$this->_setToolbar();
if (version_compare($version->getShortVersion(), '3.0.0', '<')) {
$tpl = 'legacy';
}
parent::display($tpl);
JRequest::setVar('hidemainmenu', true);
}
开发者ID:panickylemon,项目名称:joomlastayn,代码行数:30,代码来源:view.html.php
示例9: preflight
function preflight($type, $parent)
{
$jversion = new JVersion();
// Installing component manifest file version
$this->release = $parent->get("manifest")->version;
// Manifest file minimum Joomla version
$this->minimum_joomla_release = $parent->get("manifest")->attributes()->version;
// Show the essential information at the install/update back-end
echo '<p>Installing component manifest file version = ' . $this->release;
echo '<br />Current manifest cache commponent version (if any) = ' . $this->getParam('version');
echo '<br />Installing component manifest file minimum Joomla version = ' . $this->minimum_joomla_release;
echo '<br />Current Joomla version = ' . $jversion->getShortVersion();
// abort if the current Joomla release is older
if (version_compare($jversion->getShortVersion(), $this->minimum_joomla_release, 'lt')) {
Jerror::raiseWarning(null, 'Cannot install com_improvemycity in a Joomla release prior to ' . $this->minimum_joomla_release);
return false;
}
// abort if the component being installed is not newer than the currently installed version
if ($type == 'update') {
$oldRelease = $this->getParam('version');
$rel = $oldRelease . ' to ' . $this->release;
if (version_compare($this->release, $oldRelease, 'lt')) {
Jerror::raiseWarning(null, 'Incorrect version sequence. Cannot upgrade ' . $rel);
return false;
}
} else {
$rel = $this->release;
}
//echo '<p>' . JText::_('COM_IMPROVEMYCITY_PREFLIGHT_' . $type . ' ' . $rel) . '</p>';
}
开发者ID:Ayner,项目名称:Improve-my-city,代码行数:30,代码来源:script.php
示例10: __construct
function __construct()
{
parent::__construct();
// Load the database and execute our sql file
$this->db = JFactory::getDBO();
// Get information of our plugin so we can pass it on to MDS Collivery for Logs
$sel_query = "SELECT * FROM `#__extensions` where type = 'plugin' and element = 'mds_shipping' and folder = 'vmshipment';";
$this->db->setQuery($sel_query);
$this->db->query();
$this->extension_id = $this->db->loadObjectList()[0]->extension_id;
$this->app_name = $this->db->loadObjectList()[0]->extension_id;
$this->app_info = json_decode($this->db->loadObjectList()[0]->manifest_cache);
// Get our login information
$config_query = "SELECT * FROM `#__mds_collivery_config` where id = 1;";
$this->db->setQuery($config_query);
$this->db->query();
$this->password = $this->db->loadObjectList()[0]->password;
$this->username = $this->db->loadObjectList()[0]->username;
$this->risk_cover = $this->db->loadObjectList()[0]->risk_cover;
$version = new JVersion();
require_once preg_replace('|com_installer|i', "", JPATH_COMPONENT_ADMINISTRATOR) . '/helpers/config.php';
$config = array('app_name' => $this->app_info->name, 'app_version' => $this->app_info->version, 'app_host' => "Joomla: " . $version->getShortVersion() . ' - Virtuemart: ' . VmConfig::getInstalledVersion(), 'app_url' => JURI::base(), 'user_email' => $this->username, 'user_password' => $this->password);
// Use the MDS API Files
require_once JPATH_PLUGINS . '/vmshipment/mds_shipping/Mds/Cache.php';
require_once JPATH_PLUGINS . '/vmshipment/mds_shipping/Mds/Collivery.php';
$this->collivery = new Mds\Collivery($config);
// Get some information from the API
$this->towns = $this->collivery->getTowns();
$this->services = $this->collivery->getServices();
$this->location_types = $this->collivery->getLocationTypes();
$this->suburbs = $this->collivery->getSuburbs(null);
}
开发者ID:Zash22,项目名称:Collivery-Virtuemart,代码行数:32,代码来源:view.json.php
示例11: preflight
function preflight($type, $parent)
{
$jversion = new JVersion();
// Installing component manifest file version
$this->release = $parent->get("manifest")->version;
// If fresh install, lang file can't be loaded yet so use the tmp dir one.
$lang = JFactory::getLanguage();
$lang->load('com_jckman', dirname(__FILE__));
$lang->load('com_jckman.sys', dirname(__FILE__));
// Manifest file minimum Joomla version
$this->minimum_joomla_release = $parent->get("manifest")->attributes()->version;
if (version_compare($jversion->getShortVersion(), $this->minimum_joomla_release, 'lt')) {
JError::raiseWarning(null, JText::sprintf('COM_JCKMAN_CUSTOM_INSTALL_NOT_JOOMLA_PRIOR', $this->minimum_joomla_release));
return false;
}
//Workaround I shouldn't have to do
$app = JFactory::getApplication();
$db = JFactory::getDBO();
$sql = $db->getQuery(true);
$sql->select('1')->from('#__extensions')->where('`name` = "com_jckman"');
if (!$db->setQuery($sql)->loadResult()) {
$sql = $db->getQuery(true);
$sql->delete('#__assets')->where('`title` like "%JCK%MAN%"');
$db->setQuery($sql)->query();
}
}
开发者ID:enjoy2000,项目名称:714water,代码行数:26,代码来源:install.php
示例12: display
function display($tpl = null)
{
if (JFactory::getUser()->get('guest')) {
$msg = JText::_("ORDER_PLEASE_LOGIN_BEFORE");
$redirectUrl = base64_encode("index.php?option=com_enmasse&view=orderList");
$version = new JVersion();
$joomla = $version->getShortVersion();
if (substr($joomla, 0, 3) >= '1.6') {
$link = JRoute::_("index.php?option=com_users&view=login&return=" . $redirectUrl, false);
} else {
$link = JRoute::_("index.php?option=com_user&view=login&return=" . $redirectUrl, false);
}
JFactory::getApplication()->redirect($link, $msg);
}
$orderList = JModel::getInstance('order', 'enmasseModel')->listForBuyer(JFactory::getUser()->id);
for ($count = 0; $count < count($orderList); $count++) {
$orderItemList = JModel::getInstance('orderItem', 'enmasseModel')->listByOrderId($orderList[$count]->id);
$orderList[$count]->orderItem = $orderItemList[0];
$orderList[$count]->display_id = EnmasseHelper::displayOrderDisplayId($orderList[$count]->id);
}
$this->assignRef('orderList', $orderList);
$this->_setPath('template', JPATH_SITE . DS . "components" . DS . "com_enmasse" . DS . "theme" . DS . EnmasseHelper::getThemeFromSetting() . DS . "tmpl" . DS);
$this->_layout = "order_list";
parent::display($tpl);
}
开发者ID:marsa1985,项目名称:kazabiz,代码行数:25,代码来源:view.html.php
示例13: getValidationPlugins
function getValidationPlugins()
{
jimport('joomla.version');
$db = JFactory::getDBO();
$version = new JVersion();
if (version_compare($version->getShortVersion(), '1.6', '>=')) {
$db->setQuery("Select `element` From #__extensions Where `folder` = 'contentbuilder_validation' And `enabled` = 1");
jimport('joomla.version');
$version = new JVersion();
if (version_compare($version->getShortVersion(), '3.0', '>=')) {
$res = $db->loadColumn();
} else {
$res = $db->loadResultArray();
}
return $res;
} else {
$db->setQuery("Select `element` From #__plugins Where `folder` = 'contentbuilder_validation' And `published` = 1");
jimport('joomla.version');
$version = new JVersion();
if (version_compare($version->getShortVersion(), '3.0', '>=')) {
$res = $db->loadColumn();
} else {
$res = $db->loadResultArray();
}
return $res;
}
return array();
}
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:28,代码来源:elementoptions.php
示例14: getJoomlaVersion
private function getJoomlaVersion()
{
$VERSION = new JVersion();
// Store in our object for switching configs
$this->version = $VERSION->getShortVersion();
return $VERSION->getShortVersion();
}
开发者ID:ranamimran,项目名称:persivia,代码行数:7,代码来源:bfSnapshot.php
示例15: load
public static function load()
{
if (self::$loaded) {
return;
}
self::$loaded = true;
include_once JPATH_ROOT . '/administrator/components/com_eventgallery/version.php';
$document = JFactory::getDocument();
//JHtml::_('behavior.framework', true);
JHtml::_('behavior.formvalidation');
$params = JComponentHelper::getParams('com_eventgallery');
$doDebug = $params->get('debug', 0) == 1;
$doManualDebug = JRequest::getString('debug', '') == 'true';
$CSSs = array();
$JSs = array();
if (version_compare(JVERSION, '3.0', 'gt')) {
JHtml::_('jquery.framework');
} else {
$JSs[] = 'common/js/jquery/jquery.min.js';
$JSs[] = 'common/js/jquery/jquery-migrate-1.2.1.min.js';
}
$JSs[] = 'common/js/jquery/namespace.js';
// load script and styles in debug mode or compressed
if ($doDebug || $doManualDebug) {
$CSSs[] = 'frontend/css/eventgallery.css';
$CSSs[] = 'frontend/css/colorbox.css';
$joomlaVersion = new JVersion();
if (!$joomlaVersion->isCompatible('3.0')) {
$CSSs[] = 'frontend/css/legacy.css';
}
$JSs = array_merge($JSs, array('frontend/js/EventgalleryTools.js', 'frontend/js/EventgalleryTouch.js', 'frontend/js/jquery.colorbox.js', 'frontend/js/jquery.colorbox.init.js', 'frontend/js/EventgallerySizeCalculator.js', 'frontend/js/EventgalleryImage.js', 'frontend/js/EventgalleryRow.js', 'frontend/js/EventgalleryImageList.js', 'frontend/js/EventgalleryEventsList.js', 'frontend/js/EventgalleryEventsTiles.js', 'frontend/js/EventgalleryGridCollection.js', 'frontend/js/EventgalleryTilesCollection.js', 'frontend/js/EventgalleryCart.js', 'frontend/js/EventgallerySocialShareButton.js', 'frontend/js/EventgalleryJSGallery2.js', 'frontend/js/EventgalleryLazyload.js', 'frontend/js/EventgalleryBehavior.js'));
} else {
$joomlaVersion = new JVersion();
if (!$joomlaVersion->isCompatible('3.0')) {
$CSSs[] = 'frontend/css/eg-l-compressed.css';
} else {
$CSSs[] = 'frontend/css/eg-compressed.css';
}
$JSs[] = 'frontend/js/eg-compressed.js';
}
foreach ($CSSs as $css) {
$script = JUri::root(true) . '/media/com_eventgallery/' . $css . '?v=' . EVENTGALLERY_VERSION;
$document->addStyleSheet($script);
}
foreach ($JSs as $js) {
$script = JUri::root(true) . '/media/com_eventgallery/' . $js . '?v=' . EVENTGALLERY_VERSION;
$document->addScript($script);
}
/*
* Let's add a global configuration object for the color box slideshow.
*/
$slideshowConfiguration = array();
$slideshowConfiguration['slideshow'] = $params->get('use_lightbox_slideshow', 0) == 1 ? true : false;
$slideshowConfiguration['slideshowAuto'] = $params->get('use_lightbox_slideshow_autoplay', 0) == 1 ? true : false;
$slideshowConfiguration['slideshowSpeed'] = $params->get('lightbox_slideshow_speed', 3000);
$slideshowConfiguration['slideshowStart'] = JText::_('COM_EVENTGALLERY_LIGHTBOX_SLIDESHOW_START');
$slideshowConfiguration['slideshowStop'] = JText::_('COM_EVENTGALLERY_LIGHTBOX_SLIDESHOW_STOP');
$slideshowConfiguration['slideshowRightClickProtection'] = $params->get('lightbox_prevent_right_click', 0) == 1 ? true : false;
$document->addScriptDeclaration("EventGallerySlideShowConfiguration=" . json_encode($slideshowConfiguration) . ";");
}
开发者ID:sansandeep143,项目名称:av,代码行数:60,代码来源:medialoader.php
示例16: getInput
/**
* Method to get the field input markup.
*
* @return string The field input markup.
* @since 1.6
*/
protected function getInput()
{
$lang = JFactory::getLanguage();
$lang->load('lib_syw.sys', JPATH_SITE);
$version = new JVersion();
$jversion = explode('.', $version->getShortVersion());
$extensions = get_loaded_extensions();
$html = '';
if (!in_array('intl', $extensions)) {
if (intval($jversion[0]) > 2) {
// Joomla! 3+
$html .= '<div class="alert alert-error">';
} else {
$html .= '<div style="clear: both; margin: 5px 0; padding: 8px 35px 8px 14px; border-radius: 4px; border: 1px solid #EED3D7; background-color: #F2DEDE; color: #B94A48;">';
}
$html .= '<span>';
$html .= JText::_('LIB_SYW_INTLTEST_NOTLOADED');
$html .= '</span>';
$html .= '</div>';
return $html;
} else {
if (intval($jversion[0]) > 2) {
// Joomla! 3+
$html .= '<div class="alert alert-success">';
} else {
$html .= '<div style="clear: both; margin: 5px 0; padding: 8px 35px 8px 14px; border-radius: 4px; border: 1px solid #D6E9C6; background-color: #DFF0D8; color: #468847;">';
}
$html .= '<span>';
$html .= JText::_('LIB_SYW_INTLTEST_LOADED');
$html .= '</span>';
$html .= '</div>';
}
return $html;
}
开发者ID:esorone,项目名称:efcpw,代码行数:40,代码来源:intltest.php
示例17: onGetIcons
public function onGetIcons($context)
{
@(include_once JPATH_ADMINISTRATOR . '/components/com_jce/models/model.php');
// check for class to prevent fatal errors
if (!class_exists('WFModel')) {
return;
}
if ($context != $this->params->get('context', 'mod_quickicon') || WFModel::authorize('browser') === false) {
return;
}
$document = JFactory::getDocument();
$language = JFactory::getLanguage();
$language->load('com_jce', JPATH_ADMINISTRATOR);
$width = $this->params->get('width', 800);
$height = $this->params->get('height', 600);
$filter = $this->params->get('filter', '');
JHtml::_('behavior.modal');
$document->addScriptDeclaration("\n\t\twindow.addEvent('domready', function() {\n\t\t\tSqueezeBox.assign(\$\$('#plg_quickicon_jcefilebrowser a'), {\n\t\t\t\thandler: 'iframe', size: {x: " . $width . ", y: " . $height . "}\n\t\t\t});\n\t\t});");
require_once JPATH_ADMINISTRATOR . '/components/com_jce/helpers/browser.php';
$version = new JVersion();
$icon = $version->isCompatible('3.0') ? 'pictures' : 'header/icon-48-media.png';
$link = WFBrowserHelper::getBrowserLink('', $filter);
if ($link) {
return array(array('link' => $link, 'image' => $icon, 'icon' => 'pictures', 'access' => array('jce.browser', 'com_jce'), 'text' => JText::_('WF_QUICKICON_BROWSER'), 'id' => 'plg_quickicon_jcefilebrowser'));
}
return array();
}
开发者ID:lyrasoft,项目名称:lyrasoft.github.io,代码行数:27,代码来源:jcefilebrowser.php
示例18: load
public static function load()
{
if (self::$loaded) {
return;
}
self::$loaded = true;
include_once JPATH_ROOT . '/administrator/components/com_eventgallery/version.php';
$document = JFactory::getDocument();
JHtml::_('behavior.formvalidation');
$CSSs = array();
$JSs = array();
if (version_compare(JVERSION, '3.0', 'gt')) {
JHtml::_('jquery.framework');
} else {
$JSs[] = 'common/js/jquery/jquery.min.js';
$JSs[] = 'common/js/jquery/jquery-migrate-1.2.1.min.js';
}
$JSs[] = 'common/js/jquery/namespace.js';
$CSSs[] = 'backend/css/eventgallery.css';
$joomlaVersion = new JVersion();
if (!$joomlaVersion->isCompatible('3.0')) {
$CSSs[] = 'backend/css/legacy.css';
}
$JSs = array_merge($JSs, array());
foreach ($CSSs as $css) {
$script = JURI::root() . 'media/com_eventgallery/' . $css . '?v=' . EVENTGALLERY_VERSION;
$document->addStyleSheet($script);
}
foreach ($JSs as $js) {
$script = JURI::root() . 'media/com_eventgallery/' . $js . '?v=' . EVENTGALLERY_VERSION;
$document->addScript($script);
}
}
开发者ID:sansandeep143,项目名称:av,代码行数:33,代码来源:backendmedialoader.php
示例19: display
function display($tpl = null)
{
$this->days = $this->get('Days');
$this->countDays = $this->get('CountDays');
$this->state = $this->get('State');
jimport('joomla.html.pagination');
$limit = JRequest::getVar('limit', '25', '', 'int');
$limitstart = JRequest::getVar('limitstart', '0', '', 'int');
$pagination = new JPagination($this->countDays, $limitstart, $limit);
$this->pagination = $pagination;
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
$this->addToolbar();
if (class_exists('JHtmlSidebar')) {
$this->sidebar = JHtmlSidebar::render();
}
$version = new JVersion();
if (version_compare($version->getShortVersion(), '3.0.0', '<')) {
$tpl = 'legacy';
}
parent::display($tpl);
}
开发者ID:politik86,项目名称:test2,代码行数:25,代码来源:view.html.php
示例20: getInput
protected function getInput()
{
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('TIME_TO_SEC(TIMEDIFF(ADDDATE(`lastattempt`,INTERVAL `penalty` MINUTE),NOW())) AS timeleft,ip,firstattempt,lastattempt,attempts,penalty')->from('#__plg_system_adminexile')->where('penalty > 0')->order('lastattempt DESC');
$db->setQuery($query);
$blocked = $db->loadObjectList();
if(!count($blocked)) return '';
$version = new JVersion;
$shortversion = explode('.',$version->getShortVersion());
$return=array();
$deletetext = '';
if($shortversion[0] == 2) {
$deletetext = JText::_('JACTION_DELETE');
}
$return[]='<table class="table table-condensed table-striped bruteforce"><tr><th>IP</th><th>'.JText::_('PLG_SYS_ADMINEXILE_FIRST_ATTEMPT').'</th><th>'.JText::_('PLG_SYS_ADMINEXILE_LAST_ATTEMPT').'</th><th>'.JText::_('PLG_SYS_ADMINEXILE_ATTEMPTS').'</th><th>'.JText::_('PLG_SYS_ADMINEXILE_PENALTY').'</th><td></td></tr>';
foreach($blocked as $match) {
if($match->timeleft <= 0) {
$query = $db->getQuery(true);
$query->delete('#__plg_system_adminexile')->where('ip = '.$db->quote($match->ip));
$db->setQuery($query);
$db->query();
} else {
$buttons = '<button class="btn btn-mini removeblock hasTip" data-block="'.htmlentities(json_encode(array('ip'=>$match->ip,'firstattempt'=>$match->firstattempt))).'" data-toggle="tooltip" title="'.JText::_('JACTION_DELETE').'"><i class="icon-trash"></i>'.$deletetext.'</button>';
$return[]='<td>'.$match->ip.'</td><td>'.$match->firstattempt.'</td><td>'.$match->lastattempt.'</td><td>'.$match->attempts.'</td><td>'.$match->penalty.'</td><td>'.$buttons.'</td></tr>';
}
}
$return[]='</table>';
return implode("\n",$return);
}
开发者ID:networksoft,项目名称:seekerplus2.com,代码行数:30,代码来源:blocklist.php
注:本文中的JVersion类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论