本文整理汇总了PHP中Komento::komentoVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP Komento::komentoVersion方法的具体用法?PHP Komento::komentoVersion怎么用?PHP Komento::komentoVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Komento
的用法示例。
在下文中一共展示了Komento::komentoVersion方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($config = array())
{
$document = JFactory::getDocument();
//load dialog stylesheet in backend
KomentoDocumentHelper::loadHeaders();
$config = Komento::getConfig();
$konfig = Komento::getKonfig();
$toolbar = JToolbar::getInstance('toolbar');
$toolbar->addButtonPath(KOMENTO_ADMIN_ROOT . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'images');
if ($document->getType() == 'html') {
require_once KOMENTO_CLASSES . DIRECTORY_SEPARATOR . 'configuration.php';
$configuration = KomentoConfiguration::getInstance();
$configuration->attach();
}
$version = str_ireplace('.', '', Komento::komentoVersion());
$document->addScript(rtrim(JURI::root(), '/') . '/administrator/components/com_komento/assets/js/admin.js?' . $version);
$document->addStyleSheet(rtrim(JURI::root(), '/') . '/administrator/components/com_komento/assets/css/reset.css?' . $version);
$document->addStyleSheet(rtrim(JURI::root(), '/') . '/components/com_komento/assets/css/common.css?' . $version);
$document->addStyleSheet(rtrim(JURI::root(), '/') . '/administrator/components/com_komento/assets/css/style.css?' . $version);
// For the sake of loading the core.js in Joomla 1.6 (1.6.2 onwards)
if (Komento::joomlaVersion() >= '1.6') {
JHTML::_('behavior.framework');
}
parent::__construct($config);
}
示例2: load
/**
* Function to add js file, js script block and css file
* to HEAD section
*/
public static function load($list, $type = 'js', $location = 'themes')
{
$mainframe = JFactory::getApplication();
$document = JFactory::getDocument();
$config = Komento::getConfig();
$kApp = Komento::loadApplication();
// Always load mootools first so it will not conflict.
// JHTML::_('behavior.mootools');
$files = explode(',', $list);
$dir = JURI::root() . 'components/com_komento/assets';
$pathdir = KOMENTO_ASSETS;
$theme = $config->get('layout_theme');
$version = str_ireplace('.', '', Komento::komentoVersion());
if ($location != 'assets') {
$dir = JURI::root() . 'components/com_komento/themes/' . $theme;
$pathdir = KOMENTO_THEMES . DIRECTORY_SEPARATOR . $theme;
}
foreach ($files as $file) {
if ($type == 'js') {
$file .= '.js?' . $version;
} elseif ($type == 'css') {
$file .= '.css';
}
$path = '';
if ($location == 'themes') {
$checkOverride = JPATH_ROOT . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . $mainframe->getTemplate() . DIRECTORY_SEPARATOR . 'html' . DIRECTORY_SEPARATOR . 'com_komento' . DIRECTORY_SEPARATOR . $type . DIRECTORY_SEPARATOR . $file;
$checkComponent = $kApp->getComponentThemePath() . DIRECTORY_SEPARATOR . $type . DIRECTORY_SEPARATOR . $file;
$checkSelected = KOMENTO_THEMES . DIRECTORY_SEPARATOR . $theme . DIRECTORY_SEPARATOR . $type . DIRECTORY_SEPARATOR . $file;
$checkDefault = KOMENTO_THEMES . DIRECTORY_SEPARATOR . 'kuro' . DIRECTORY_SEPARATOR . $type . DIRECTORY_SEPARATOR . $file;
$overridePath = JURI::root() . 'templates/' . $mainframe->getTemplate() . '/html/com_komento/' . $type . '/' . $file;
$componentPath = $kApp->getComponentThemeURI() . '/' . $type . '/' . $file;
$selectedPath = $dir . '/' . $type . '/' . $file;
$defaultPath = JURI::root() . 'components/com_komento/themes/kuro/' . $type . '/' . $file;
// 1. Template overrides
if (JFile::exists($checkOverride)) {
$path = $overridePath;
$pathdir = $checkOverride;
} elseif (JFile::exists($checkSelected)) {
$path = $selectedPath;
$pathdir = $checkSelected;
} else {
$path = $defaultPath;
$path = $checkDefault;
}
} else {
$path = $dir . '/' . $type . '/' . $file;
$pathdir = $pathdir . DIRECTORY_SEPARATOR . $type . DIRECTORY_SEPARATOR . $file;
}
if ($type == 'js') {
$document->addScript($path);
} elseif ($type == 'css') {
if (JFile::exists($pathdir)) {
$document->addStylesheet($path);
}
}
}
}
示例3: getVersion
public function getVersion()
{
$ajax = Komento::getAjax();
$local = Komento::komentoVersion();
$remote = Komento::getHelper('Version')->getVersion();
$html = '<span class="version_outdated">' . JText::sprintf('COM_KOMENTO_VERSION_OUTDATED', $local) . '</span>';
if ((string) $local >= (string) $remote) {
$html = '<span class="version_latest">' . JText::sprintf('COM_KOMENTO_VERSION_LATEST', $local) . '</span>';
}
$ajax->success($html);
$ajax->send();
}
示例4: getVersion
public function getVersion()
{
$ajax = Komento::getAjax();
$local = Komento::komentoVersion();
$remote = Komento::getHelper('Version')->getVersion();
// Test build only since build will always be incremented regardless of version
$localVersion = explode('.', $local);
$localBuild = $localVersion[2];
$remoteVersion = explode('.', $remote);
$build = $remoteVersion[2];
$html = '<span class="version_outdated">' . JText::sprintf('COM_KOMENTO_VERSION_OUTDATED', $local) . '</span>';
if ($localBuild >= $build) {
$html = '<span class="version_latest">' . JText::sprintf('COM_KOMENTO_VERSION_LATEST', $local) . '</span>';
}
$ajax->success($html);
$ajax->send();
}