本文整理汇总了PHP中Komento::getConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Komento::getConfig方法的具体用法?PHP Komento::getConfig怎么用?PHP Komento::getConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Komento
的用法示例。
在下文中一共展示了Komento::getConfig方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getColumnsState
function getColumnsState()
{
$columns = array('comment', 'published', 'link', 'edit', 'component', 'article', 'date', 'author', 'email', 'homepage', 'ip', 'latitude', 'longitude', 'address', 'id');
$columnsConfig = Komento::getConfig('com_komento_pending_columns', false);
$html = $this->renderColumnsConfiguration($columns, $columnsConfig);
return $html;
}
示例3: bootstrap
/**
* This renders the necessary bootstrap data into the html headers.
*/
public function bootstrap()
{
static $isRendered = false;
$doc = JFactory::getDocument();
if( !$isRendered && $doc->getType() == 'html' )
{
// @task: Include dependencies from foundry.
require_once( JPATH_ROOT . DIRECTORY_SEPARATOR . 'media' . DIRECTORY_SEPARATOR . 'foundry' . DIRECTORY_SEPARATOR . '3.1' . DIRECTORY_SEPARATOR . 'joomla' . DIRECTORY_SEPARATOR . 'configuration.php' );
$config = Komento::getConfig();
$environment = JRequest::getVar( 'komento_environment' , $config->get( 'komento_environment' ) );
$folder = 'scripts';
// @task: Let's see if we should load the dev scripts.
if( $environment == 'development' )
{
$folder = 'scripts_';
}
$doc->addScript( rtrim( JURI::root() , '/' ) . '/media/com_komento/' . $folder . '/abstract.js' );
$isRendered = true;
}
return $isRendered;
}
示例4: upload
public function upload( $fileItem, $fileName = '', $storagePath = '', $published = 1 )
{
// $fileItem['name'] = filename
// $fileItem['type'] = mime
// $fileItem['tmp_name'] = temporary source
// $fileItem['size'] = size
if( empty( $fileItem ) )
{
return false;
}
// store record first
$uploadtable = Komento::getTable( 'uploads' );
$now = Komento::getDate()->toMySQL();
$uploadtable->created = $now;
$profile = Komento::getProfile();
$uploadtable->created_by = $profile->id;
$uploadtable->published = $published;
$uploadtable->mime = $fileItem['type'];
$uploadtable->size = $fileItem['size'];
if( $fileName == '' )
{
$fileName = $fileItem['name'];
}
$uploadtable->filename = $fileName;
if( $storagePath == '' )
{
$config = Komento::getConfig();
$storagePath = $config->get( 'upload_path' );
}
$uploadtable->path = $storagePath;
if( !$uploadtable->upload() )
{
return false;
}
$source = $fileItem['tmp_name'];
$destination = $uploadtable->getFilePath();
jimport( 'joomla.filesystem.file' );
if( !JFile::copy( $source , $destination ) )
{
$uploadtable->rollback();
return false;
}
return $uploadtable->id;
}
示例5: 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);
}
}
}
}
示例6: getNoun
public static function getNoun($var, $count, $includeCount = false)
{
static $zeroIsPlural;
if (!isset($zeroIsPlural)) {
$config = Komento::getConfig();
$zeroIsPlural = $config->get('layout_zero_as_plural');
}
$count = (int) $count;
$var = $count === 1 || $count === -1 || $count === 0 && !$zeroIsPlural ? $var . '_SINGULAR' : $var . '_PLURAL';
return $includeCount ? JText::sprintf($var, $count) : JText::_($var);
}
示例7: getInstance
/**
* Get the captcha class
*/
public function getInstance()
{
if (is_null(self::$instance))
{
$config = Komento::getConfig();
$class = '';
if( $config->get( 'antispam_captcha_enable' ) == 1 )
{
if( $config->get( 'antispam_captcha_type') == 0)
{
$class = 'captcha';
}
else
{
if( $config->get( 'antispam_captcha_type') == 1 && $config->get('antispam_recaptcha_public_key') && $config->get('antispam_recaptcha_private_key') )
{
$class = 'recaptcha';
}
}
}
if( empty($class) )
{
self::$instance = false;
return false;
}
$file = KOMENTO_CLASSES . DIRECTORY_SEPARATOR . 'captcha' . DIRECTORY_SEPARATOR . strtolower($class) . '.php';
if( !JFile::exists($file) )
{
self::$instance = false;
return false;
}
require_once( $file );
$class = 'Komento' . ucfirst( strtolower($class) );
if ( !class_exists($class) )
{
return false;
}
self::$instance = new $class();
}
return self::$instance;
}
示例8: getEmbedHTML
public function getEmbedHTML( $url )
{
$code = $this->getCode( $url );
$config = Komento::getConfig();
$width = $config->get( 'bbcode_video_width' );
$height = $config->get( 'bbcode_video_height' );
if( $code )
{
return '<embed src="http://media.mtvnservices.com/mgid:uma:video:mtv.com:' . $code . '" width="' . $width . '" height="' . $height . '" type="application/x-shockwave-flash" flashVars="configParams=id%3D' . $code . '%26vid%3D' . $code . '%26uri%3Dmgid%3Auma%3Avideo%3Amtv.com%3A' . $code . '" allowFullScreen="true" allowScriptAccess="always" base="."></embed>';
}
return false;
}
示例9: getEmbedHTML
public function getEmbedHTML( $url )
{
$code = $this->getCode( $url );
$config = Komento::getConfig();
$width = $config->get( 'bbcode_video_width' );
$height = $config->get( 'bbcode_video_height' );
if( $code )
{
return '<embed flashVars="playerVars=showStats=yes|autoPlay=no" src="http://www.metacafe.com/fplayer/' . $code . '/easyblog.swf" width="' . $width . '" height="' . $height . '" wmode="transparent" allowFullScreen="true" allowScriptAccess="always" name="Metacafe_' . $code . '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>';
}
return false;
}
示例10: getEmbedHTML
public function getEmbedHTML( $url )
{
$code = $this->getCode( $url );
$config = Komento::getConfig();
$width = $config->get( 'bbcode_video_width' );
$height = $config->get( 'bbcode_video_height' );
if( $code )
{
return '<object width="' . $width . '" height="' . $height . '"><param name="movie" value="http://www.liveleak.com/e/' . $code . '"></param><param name="wmode" value="transparent"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.liveleak.com/e/' . $code . '" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always" width="' . $width . '" height="' . $height . '"></embed></object>';
}
return false;
}
示例11: getEmbedHTML
public function getEmbedHTML( $url )
{
$code = $this->getCode( $url );
$config = Komento::getConfig();
$width = $config->get( 'bbcode_video_width' );
$height = $config->get( 'bbcode_video_height' );
if( $code )
{
return '<iframe src="http://player.vimeo.com/video/' . $code . '" width="' . $width . '" height="' . $height . '" frameborder="0"></iframe>';
}
return false;
}
示例12: getEmbedHTML
public function getEmbedHTML( $url )
{
$code = $this->getCode( $url );
$config = Komento::getConfig();
$width = $config->get( 'bbcode_video_width' );
$height = $config->get( 'bbcode_video_height' );
if( $code )
{
return '<script src="http://ext.nicovideo.jp/thumb_watch/' . $code . '?w=' . $width . '&h=' . $height . '&n=1" type="text/javascript"></script><noscript>Javascript is required to load the player</noscript>';
}
return false;
}
示例13: getEmbedHTML
public function getEmbedHTML( $url )
{
$code = $this->getCode( $url );
$config = Komento::getConfig();
$width = $config->get( 'bbcode_video_width' );
$height = $config->get( 'bbcode_video_height' );
if( $code )
{
return '<script src="http://flash.revver.com/player/1.0/player.js?mediaId:' . $code . ';width:' . $width . ';height:' . $height . ';" type="text/javascript"></script>';
}
return false;
}
示例14: getEmbedHTML
public function getEmbedHTML( $url )
{
$code = $this->getCode( $url );
$config = Komento::getConfig();
$width = $config->get( 'bbcode_video_width' );
$height = $config->get( 'bbcode_video_height' );
if( $code )
{
return '<embed id=VideoPlayback src=http://video.google.com/googleplayer.swf?docid=' . $code . '&hl=en&fs=true style=width:' . $width . 'px;height:' . $height . 'px allowFullScreen=true allowScriptAccess=always type=application/x-shockwave-flash> </embed>';
}
return false;
}
示例15: getHTML
public function getHTML()
{
$template = Komento::getTheme();
$config = Komento::getConfig();
$publicKey = $config->get('antispam_recaptcha_public_key');
$language = $config->get('antispam_recaptcha_lang', 'en');
$theme = $config->get('antispam_recaptcha_theme', 'clean');
$server = $config->get('antispam_recaptcha_ssl') ? self::RECAPTCHA_API_SECURE_SERVER : self::RECAPTCHA_API_SERVER;
$template->set('server', $server);
$template->set('publicKey', $publicKey);
$template->set('language', $language);
$template->set('theme', $theme);
// Use AJAX method to prevent operation aborted problems with IE
return $template->fetch('comment/recaptcha.php');
}