本文整理汇总了PHP中KunenaFactory::getTemplate方法的典型用法代码示例。如果您正苦于以下问题:PHP KunenaFactory::getTemplate方法的具体用法?PHP KunenaFactory::getTemplate怎么用?PHP KunenaFactory::getTemplate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KunenaFactory
的用法示例。
在下文中一共展示了KunenaFactory::getTemplate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: before
/**
* Prepare menu display.
*
* @return bool
*/
protected function before()
{
parent::before();
$this->basemenu = $basemenu = KunenaRoute::getMenu();
if (!$basemenu)
{
return false;
}
$parameters = new JRegistry;
$template = KunenaFactory::getTemplate();
$parameters->set('showAllChildren', $template->params->get('menu_showall', 0));
$parameters->set('menutype', $basemenu->menutype);
$parameters->set('startLevel', $basemenu->level + 1);
$parameters->set('endLevel', $basemenu->level + $template->params->get('menu_levels', 1));
$this->list = KunenaMenuHelper::getList($parameters);
$this->menu = $this->app->getMenu();
$this->active = $this->menu->getActive();
$this->active_id = isset($this->active) ? $this->active->id : $this->menu->getDefault()->id;
$this->path = isset($this->active) ? $this->active->tree : array();
$this->showAll = $parameters->get('showAllChildren');
$this->class_sfx = htmlspecialchars($parameters->get('pageclass_sfx'), ENT_COMPAT, 'UTF-8');
return true;
}
示例2: _getURL
/**
* @param $user
* @param $sizex
* @param $sizey
*
* @return string
*/
protected function _getURL($user, $sizex, $sizey)
{
$user = KunenaFactory::getUser($user);
$avatar = $user->avatar;
$config = KunenaFactory::getConfig();
$path = KPATH_MEDIA . "/avatars";
$origPath = "{$path}/{$avatar}";
if (!is_file($origPath)) {
// If avatar does not exist use default image.
if ($sizex <= 90) {
$avatar = 's_nophoto.jpg';
} else {
$avatar = 'nophoto.jpg';
}
// Search from the template.
$template = KunenaFactory::getTemplate();
$origPath = JPATH_SITE . '/' . $template->getAvatarPath($avatar);
$avatar = $template->name . '/' . $avatar;
}
$dir = dirname($avatar);
$file = basename($avatar);
if ($sizex == $sizey) {
$resized = "resized/size{$sizex}/{$dir}";
} else {
$resized = "resized/size{$sizex}x{$sizey}/{$dir}";
}
// TODO: make timestamp configurable?
$timestamp = '';
if (!is_file("{$path}/{$resized}/{$file}")) {
KunenaImageHelper::version($origPath, "{$path}/{$resized}", $file, $sizex, $sizey, intval($config->avatarquality), KunenaImage::SCALE_INSIDE, intval($config->avatarcrop));
$timestamp = '?' . round(microtime(true));
}
return KURL_MEDIA . "avatars/{$resized}/{$file}{$timestamp}";
}
示例3: getRankspaths
public function getRankspaths()
{
$template = KunenaFactory::getTemplate();
$selected = $this->getRank();
$rankpath = $template->getRankPath();
$files1 = (array) JFolder::Files(JPATH_SITE . '/' . $rankpath, false, false, false, array('index.php', 'index.html'));
$files1 = (array) array_flip($files1);
foreach ($files1 as $key => &$path) {
$path = $rankpath . $key;
}
$rankpath = 'media/kunena/ranks/';
$files2 = (array) JFolder::Files(JPATH_SITE . '/' . $rankpath, false, false, false, array('index.php', 'index.html'));
$files2 = (array) array_flip($files2);
foreach ($files2 as $key => &$path) {
$path = $rankpath . $key;
}
$rank_images = $files1 + $files2;
ksort($rank_images);
$rank_list = array();
foreach ($rank_images as $file => $path) {
$rank_list[] = JHtml::_('select.option', $path, $file);
}
$list = JHtml::_('select.genericlist', $rank_list, 'rank_image', 'class="inputbox" onchange="update_rank(this.options[selectedIndex].value);" onmousemove="update_rank(this.options[selectedIndex].value);"', 'value', 'text', isset($selected->rank_image) ? $rank_images[$selected->rank_image] : '');
return $list;
}
示例4: __construct
function __construct()
{
$this->do = JRequest::getCmd('do', '');
$this->action = JRequest::getCmd('action', '');
$this->_app =& JFactory::getApplication();
$this->config = KunenaFactory::getConfig();
$this->_session = KunenaFactory::getSession();
$this->_db =& JFactory::getDBO();
$this->document = JFactory::getDocument();
require_once KPATH_SITE . '/lib/kunena.poll.class.php';
$this->poll =& CKunenaPolls::getInstance();
$this->my = JFactory::getUser();
$this->me = KunenaFactory::getUser();
$this->id = JRequest::getInt('id', 0);
if (!$this->id) {
$this->id = JRequest::getInt('parentid', 0);
}
if (!$this->id) {
// Support for old $replyto variable in post reply/quote
$this->id = JRequest::getInt('replyto', 0);
}
$this->catid = JRequest::getInt('catid', 0);
$this->msg_cat = null;
$this->allow = 1;
$this->cat_default_allow = null;
$this->allow_topic_icons = null;
$template = KunenaFactory::getTemplate();
$this->params = $template->params;
$this->numLink = null;
$this->replycount = null;
}
示例5: before
/**
* Prepare user attachments list.
*
* @return void
*/
protected function before()
{
parent::before();
$userid = $this->input->getInt('userid');
$params = array('file' => '1', 'image' => '1', 'orderby' => 'desc', 'limit' => '30');
$this->template = KunenaFactory::getTemplate();
$this->me = KunenaUserHelper::getMyself();
$this->profile = KunenaUserHelper::get($userid);
$this->attachments = KunenaAttachmentHelper::getByUserid($this->profile, $params);
// Pre-load messages.
$messageIds = array();
foreach ($this->attachments as $attachment)
{
$messageIds[] = (int) $attachment->mesid;
}
$messages = KunenaForumMessageHelper::getMessages($messageIds, 'none');
// Pre-load topics.
$topicIds = array();
foreach ($messages as $message)
{
$topicIds[] = $message->thread;
}
KunenaForumTopicHelper::getTopics($topicIds, 'none');
$this->headerText = JText::_('COM_KUNENA_MANAGE_ATTACHMENTS');
}
示例6: publish
function publish()
{
$cid = $this->app->input->get('cid', array(), 'method', 'array');
$id = array_shift($cid);
if (!JSession::checkToken('post'))
{
$this->app->enqueueMessage(JText::_('COM_KUNENA_ERROR_TOKEN'), 'error');
$this->setRedirect(KunenaRoute::_($this->baseurl, false));
return;
}
if ($id)
{
$this->config->template = $id;
$this->config->save();
}
$template = KunenaFactory::getTemplate($id);
$template->clearCache();
$this->app->enqueueMessage(JText::_('COM_KUNENA_A_TEMPLATE_MANAGER_DEFAULT_SELECTED'));
$this->setRedirect(KunenaRoute::_($this->baseurl, false));
}
示例7: display
public function display() {
static $cssadded = false;
require_once (KUNENA_PATH_LIB . DS . 'kunena.link.class.php');
require_once (KUNENA_PATH_LIB . DS . 'kunena.image.class.php');
require_once (KUNENA_PATH_LIB . DS . 'kunena.timeformat.class.php');
require_once (KUNENA_PATH_FUNCS . DS . 'latestx.php');
require_once (JPATH_ADMINISTRATOR . '/components/com_kunena/libraries/html/parser.php');
$this->kunena_config = KunenaFactory::getConfig ();
$this->myprofile = KunenaFactory::getUser ();
// load Kunena main language file so we can leverage langaueg strings from it
KunenaFactory::loadLanguage();
// Initialize session
$session = KunenaFactory::getSession ();
$session->updateAllowedForums();
$this->latestdo = null;
if ($this->params->get ( 'choosemodel' ) != 'latest') {
$this->latestdo = $this->params->get ( 'choosemodel' );
}
$this->ktemplate = KunenaFactory::getTemplate();
$this->klistpost = modKunenaLatestHelper::getKunenaLatestList ( $this->params );
$this->topic_ordering = modKunenaLatestHelper::getTopicsOrdering($this->myprofile, $this->kunena_config);
require (JModuleHelper::getLayoutPath ( 'mod_kunenalatest' ));
}
示例8: before
/**
* Prepare message actions display.
*
* @return void
*/
protected function before()
{
parent::before();
$catid = $this->input->getInt('id');
$me = KunenaUserHelper::getMyself();
$this->category = KunenaForumCategory::getInstance($catid);
$token = JSession::getFormToken();
$task = "index.php?option=com_kunena&view=category&task=%s&catid={$catid}&{$token}=1";
$layout = "index.php?option=com_kunena&view=topic&layout=%s&catid={$catid}";
$this->template = KunenaFactory::getTemplate();
$this->categoryButtons = new JObject();
// Is user allowed to post new topic?
if ($this->category->getNewTopicCategory()->exists()) {
$this->categoryButtons->set('create', $this->getButton(sprintf($layout, 'create'), 'create', 'topic', 'communication', true));
}
// Is user allowed to mark forums as read?
if ($me->exists()) {
$this->categoryButtons->set('markread', $this->getButton(sprintf($task, 'markread'), 'markread', 'category', 'user', true));
}
// Is user allowed to subscribe category?
if ($this->category->isAuthorised('subscribe')) {
$subscribed = $this->category->getSubscribed($me->userid);
if (!$subscribed) {
$this->categoryButtons->set('subscribe', $this->getButton(sprintf($task, 'subscribe'), 'subscribe', 'category', 'user', true));
} else {
$this->categoryButtons->set('unsubscribe', $this->getButton(sprintf($task, 'unsubscribe'), 'unsubscribe', 'category', 'user', true));
}
}
JPluginHelper::importPlugin('kunena');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onKunenaGetButtons', array('category.action', $this->categoryButtons, $this));
}
示例9: getEmoticons
public static function getEmoticons($grayscale = false, $emoticonbar = false)
{
$db = JFactory::getDBO ();
$grayscale == true ? $column = "greylocation" : $column = "location";
$sql = "SELECT code, {$db->quoteName($column)} AS file FROM #__kunena_smileys";
if ($emoticonbar == true)
{
$sql .= " WHERE emoticonbar='1'";
}
$db->setQuery ( $sql );
$smilies = $db->loadObjectList ();
KunenaError::checkDatabaseError();
$smileyArray = array ();
$template = KunenaFactory::getTemplate();
foreach ( $smilies as $smiley )
{
// We load all smileys in array, so we can sort them
$smileyArray [$smiley->code] = JUri::root(true) .'/'. $template->getSmileyPath($smiley->file);
}
if ($emoticonbar == 0)
{
// don't sort when it's only for use in the emoticonbar
array_multisort ( array_keys ( $smileyArray ), SORT_DESC, $smileyArray );
reset ( $smileyArray );
}
return $smileyArray;
}
示例10: getSmallCategoryIcon
/**
* Method to retrieve small category icon
*
* @param KunenaSubCategory $subcategory The KunenaCategory object
*
* @return string
*/
public function getSmallCategoryIcon($subcategory)
{
$this->ktemplate = KunenaFactory::getTemplate();
$defaultcategoryicon = $this->ktemplate->params->get('DefaultCategoryicon');
if ($subcategory->getNewCount())
{
if (!empty($subcategory->icon))
{
return '<i class="' . $subcategory->icon . ' icon-knewchar" alt="' . JText::_('COM_KUNENA_GEN_FORUM_NEWPOST') . '"> </i>';
}
else
{
return '<i class="' . $defaultcategoryicon . ' icon-knewchar" alt="' . JText::_('COM_KUNENA_GEN_FORUM_NEWPOST') . '"> </i>';
}
}
else
{
if (!empty($subcategory->icon))
{
return '<i class="' . $subcategory->icon . '" alt="' . JText::_('COM_KUNENA_GEN_FORUM_NEWPOST') . '"> </i>';
}
else
{
return '<i class="' . $defaultcategoryicon . '" alt="' . JText::_('COM_KUNENA_GEN_FORUM_NEWPOST') . '"> </i>';
}
}
}
示例11: __construct
public function __construct($params)
{
static $cssadded = false;
require_once KUNENA_PATH_LIB . DS . 'kunena.link.class.php';
require_once KUNENA_PATH_LIB . DS . 'kunena.image.class.php';
require_once KUNENA_PATH_LIB . DS . 'kunena.timeformat.class.php';
require_once KUNENA_PATH_FUNCS . DS . 'latestx.php';
require_once JPATH_ADMINISTRATOR . '/components/com_kunena/libraries/html/parser.php';
$this->kunena_config = KunenaFactory::getConfig();
$this->myprofile = KunenaFactory::getUser();
// load Kunena main language file so we can leverage langaueg strings from it
KunenaFactory::loadLanguage();
// Initialize session
$session = KunenaFactory::getSession();
$session->updateAllowedForums();
$this->document = JFactory::getDocument();
$kloadcss = $params->get('kunena_load_css');
if ($cssadded == false && $kloadcss) {
$this->document->addStyleSheet(JURI::root() . 'modules/mod_kunenalatest/tmpl/css/kunenalatest.css');
$cssadded = true;
}
$this->latestdo = null;
if ($params->get('choosemodel') != 'latest') {
$this->latestdo = $params->get('choosemodel');
}
$this->params = $params;
$this->ktemplate = KunenaFactory::getTemplate();
$this->klistpost = modKunenaLatestHelper::getKunenaLatestList($params);
$this->topic_ordering = modKunenaLatestHelper::getTopicsOrdering($this->myprofile, $this->kunena_config);
require JModuleHelper::getLayoutPath('mod_kunenalatest');
}
示例12: getSmileyspaths
public function getSmileyspaths()
{
$template = KunenaFactory::getTemplate();
$selected = $this->getSmiley();
$smileypath = $template->getSmileyPath();
$files1 = (array) KunenaFolder::Files(JPATH_SITE . '/' . $smileypath, false, false, false, array('index.php', 'index.html'));
$files1 = (array) array_flip($files1);
foreach ($files1 as $key => &$path) {
$path = $smileypath . $key;
}
$smileypath = 'media/kunena/emoticons/';
$files2 = (array) KunenaFolder::Files(JPATH_SITE . '/' . $smileypath, false, false, false, array('index.php', 'index.html'));
$files2 = (array) array_flip($files2);
foreach ($files2 as $key => &$path) {
$path = $smileypath . $key;
}
$smiley_images = $files1 + $files2;
ksort($smiley_images);
$smiley_list = array();
foreach ($smiley_images as $file => $path) {
$smiley_list[] = JHtml::_('select.option', $path, $file);
}
$list = JHtml::_('select.genericlist', $smiley_list, 'smiley_url', 'class="inputbox" onchange="update_smiley(this.options[selectedIndex].value);" onmousemove="update_smiley(this.options[selectedIndex].value);"', 'value', 'text', !empty($selected->location) ? $smiley_images[$selected->location] : '');
return $list;
}
示例13: before
/**
* Prepare credits display.
*
* @return void
*/
protected function before()
{
parent::before();
$this->logo = KunenaFactory::getTemplate()->getImagePath('icons/kunena-logo-48-white.png');
$this->intro = JText::sprintf('COM_KUNENA_CREDITS_INTRO', 'http://www.kunena.org/team');
$this->memberList = array(array('name' => 'Florian Dal Fitto', 'url' => 'http://www.kunena.org/forum/user/1288-xillibit', 'title' => JText::_('COM_KUNENA_CREDITS_DEVELOPMENT')), array('name' => 'Jelle Kok', 'url' => 'http://www.kunena.org/forum/user/634-810', 'title' => JText::sprintf('COM_KUNENA_CREDITS_X_AND_Y', JText::_('COM_KUNENA_CREDITS_DEVELOPMENT'), JText::_('COM_KUNENA_CREDITS_DESIGN'))), array('name' => 'Richard Binder', 'url' => 'http://www.kunena.org/forum/user/2198-rich', 'title' => JText::sprintf('COM_KUNENA_CREDITS_X_AND_Y', JText::_('COM_KUNENA_CREDITS_MODERATION'), JText::_('COM_KUNENA_CREDITS_TESTING'))), array('name' => 'Sami Haaranen', 'url' => 'http://www.kunena.org/forum/user/151-mortti', 'title' => JText::sprintf('COM_KUNENA_CREDITS_X_AND_Y', JText::_('COM_KUNENA_CREDITS_MODERATION'), JText::_('COM_KUNENA_CREDITS_TESTING'))), array('name' => 'Matias Griese', 'url' => 'http://www.kunena.org/forum/user/63-matias', 'title' => JText::_('COM_KUNENA_CREDITS_DEVELOPMENT')), array('name' => 'Joshua Weiss', 'url' => 'http://www.kunena.org/forum/user/10809-coder4life', 'title' => JText::sprintf('COM_KUNENA_CREDITS_X_AND_Y', JText::_('COM_KUNENA_CREDITS_DESIGN'), JText::_('COM_KUNENA_CREDITS_DEVELOPMENT'))), array('name' => 'Oliver Ratzesberger', 'url' => 'http://www.kunena.org/forum/user/64-fxstein', 'title' => JText::_('COM_KUNENA_CREDITS_FOUNDER')));
$this->thanks = JText::sprintf('COM_KUNENA_CREDITS_THANKS', 'http://www.kunena.org/team#special_thanks', 'https://www.transifex.com/projects/p/Kunena', 'http://www.kunena.org', 'https://github.com/Kunena/Kunena-Forum/graphs/contributors');
}
示例14: displayEdit
function displayEdit() {
$this->setToolBarEdit();
$this->state = $this->get('state');
$this->rank_selected = $this->get('rank');
$this->template = KunenaFactory::getTemplate();
$this->rankpath = $this->template->getRankPath();
$this->listranks = $this->get('Rankspaths');
$this->display ();
}
示例15: displayEdit
function displayEdit() {
$this->setToolBarEdit();
$this->state = $this->get('state');
$this->smiley_selected = $this->get('smiley');
$this->template = KunenaFactory::getTemplate();
$this->smileypath = $this->template->getSmileyPath();
$this->listsmileys = $this->get('Smileyspaths');
$this->display();
}