当前位置: 首页>>代码示例>>PHP>>正文


PHP KunenaLayout类代码示例

本文整理汇总了PHP中KunenaLayout的典型用法代码示例。如果您正苦于以下问题:PHP KunenaLayout类的具体用法?PHP KunenaLayout怎么用?PHP KunenaLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了KunenaLayout类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 public function execute()
 {
     KUNENA_PROFILER ? KunenaProfiler::instance()->start('function ' . get_class($this) . '::' . __FUNCTION__ . '()') : null;
     // Run before executing action.
     $result = $this->before();
     if ($result === false) {
         KUNENA_PROFILER ? KunenaProfiler::instance()->stop('function ' . get_class($this) . '::' . __FUNCTION__ . '()') : null;
         throw new KunenaExceptionAuthorise(JText::_('COM_KUNENA_NO_ACCESS'), 404);
     }
     // Wrapper layout.
     $this->output = KunenaLayout::factory('Page')->set('me', $this->me)->setOptions($this->getOptions());
     if ($this->config->board_offline && !$this->me->isAdmin()) {
         // Forum is offline.
         $this->setResponseStatus(503);
         $this->output->setLayout('offline');
         $this->content = KunenaLayout::factory('Widget/Custom')->set('header', JText::_('COM_KUNENA_FORUM_IS_OFFLINE'))->set('body', $this->config->offline_message);
     } elseif ($this->config->regonly && !$this->me->exists()) {
         // Forum is for registered users only.
         $this->setResponseStatus(403);
         $this->output->setLayout('offline');
         $this->content = KunenaLayout::factory('Widget/Custom')->set('header', JText::_('COM_KUNENA_LOGIN_NOTIFICATION'))->set('body', JText::_('COM_KUNENA_LOGIN_FORUM'));
     } else {
         // Display real content.
         try {
             // Split into two lines for exception handling.
             $content = $this->display()->set('breadcrumb', $this->breadcrumb);
             $this->content = $content->render();
         } catch (KunenaExceptionAuthorise $e) {
             $this->setResponseStatus($e->getResponseCode());
             $this->output->setLayout('unauthorized');
             $this->document->setTitle($e->getResponseStatus());
             $this->content = KunenaLayout::factory('Widget/Custom')->set('header', $e->getResponseStatus())->set('body', $e->getMessage());
         } catch (Exception $e) {
             if (!$e instanceof KunenaExceptionAuthorise) {
                 $header = 'Error while rendering layout';
                 $content = isset($content) ? $content->renderError($e) : $this->content->renderError($e);
                 $e = new KunenaExceptionAuthorise($e->getMessage(), $e->getCode(), $e);
             } else {
                 $header = $e->getResponseStatus();
                 $content = $e->getMessage();
             }
             $this->setResponseStatus($e->getResponseCode());
             $this->output->setLayout('unauthorized');
             $this->document->setTitle($header);
             $this->content = KunenaLayout::factory('Widget/Custom')->set('header', $header)->set('body', $content);
         }
     }
     // Display wrapper layout with given parameters.
     $this->output->set('content', $this->content)->set('breadcrumb', $this->breadcrumb);
     // Run after executing action.
     $this->after();
     KUNENA_PROFILER ? KunenaProfiler::instance()->stop('function ' . get_class($this) . '::' . __FUNCTION__ . '()') : null;
     return $this->output;
 }
开发者ID:giabmf11,项目名称:Kunena-Forum,代码行数:54,代码来源:display.php

示例2: foreach

echo $this->filterPost;
?>
" title="<?php 
echo JText::_('COM_KUNENA_SYS_BUTTON_FILTERSUBMIT');
?>
" />
						</td>
						<td class="nowrap center hidden-phone">
						</td>
					</tr>
				</thead>
				<tfoot>
					<tr>
						<td colspan="8">
							<?php 
echo KunenaLayout::factory('pagination/footer')->set('pagination', $this->pagination);
?>
						</td>
					</tr>
				</tfoot>
				<tbody>
				<?php 
$k = $i = 0;
if ($this->pagination->total > 0) {
    foreach ($this->attachments_instance as $attachment) {
        ?>
				<tr <?php 
        echo 'class = "row' . $k . '"';
        ?>
>
					<td><?php 
开发者ID:madcsaba,项目名称:li-de,代码行数:31,代码来源:default.php

示例3: getThumbnailLink

 /**
  * @return string
  * @deprecated K4.0
  */
 public function getThumbnailLink()
 {
     return (string) KunenaLayout::factory('Attachment/Item')->set('attachment', $this)->setLayout('thumbnail');
 }
开发者ID:densem-2013,项目名称:exikom,代码行数:8,代码来源:attachment.php

示例4: getButton

 /**
  * Get button.
  *
  * @param   string  $url      Target link (do not route it).
  * @param   string  $name     Name of the button.
  * @param   string  $scope    Scope of the button.
  * @param   string  $type     Type of the button.
  * @param   bool    $primary  True if primary button.
  * @param   bool    $normal   Define if the button will have the class btn or btn-small
  *
  * @return  string
  */
 public function getButton($url, $name, $scope, $type, $primary = false, $normal = true)
 {
     return KunenaLayout::factory('Widget/Button')->setProperties(array('url' => KunenaRoute::_($url), 'name' => $name, 'scope' => $scope, 'type' => $type, 'primary' => $primary, 'normal' => $normal, 'icon' => ''));
 }
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:16,代码来源:display.php

示例5: elseif

			</ul>
		</div>
	<?php 
} elseif ($attachs->total > 0 && !$this->me->exists()) {
    if ($attachs->image > 0 && !$this->config->showimgforguest) {
        if ($attachs->image > 1) {
            echo KunenaLayout::factory('BBCode/Image')->set('title', JText::_('COM_KUNENA_SHOWIMGFORGUEST_HIDEIMG_MULTIPLES'))->setLayout('unauthorised');
        } else {
            echo KunenaLayout::factory('BBCode/Image')->set('title', JText::_('COM_KUNENA_SHOWIMGFORGUEST_HIDEIMG_SIMPLE'))->setLayout('unauthorised');
        }
    }
    if ($attachs->file > 0 && !$this->config->showfileforguest) {
        if ($attachs->file > 1) {
            echo KunenaLayout::factory('BBCode/Image')->set('title', JText::_('COM_KUNENA_SHOWIMGFORGUEST_HIDEFILE_MULTIPLES'))->setLayout('unauthorised');
        } else {
            echo KunenaLayout::factory('BBCode/Image')->set('title', JText::_('COM_KUNENA_SHOWIMGFORGUEST_HIDEFILE_SIMPLE'))->setLayout('unauthorised');
        }
    }
}
?>
	<?php 
if ($signature) {
    ?>
		<div class="ksig">
			<hr>
			<span class="ksignature"><?php 
    echo $signature;
    ?>
</span>
		</div>
	<?php 
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:31,代码来源:default.php

示例6: __toString

 /**
  * Return view as a string.
  *
  * @return string
  */
 public function __toString()
 {
     try {
         $output = $this->execute();
     } catch (KunenaExceptionAuthorise $e) {
         if (!$this->primary) {
             return (string) KunenaLayout::factory('Empty');
         }
         $document = JFactory::getDocument();
         $document->setTitle($e->getResponseStatus());
         JResponse::setHeader('Status', $e->getResponseStatus(), true);
         $output = KunenaLayout::factory('Misc/Default', 'pages')->set('header', $e->getResponseStatus())->set('body', $e->getMessage());
     } catch (Exception $e) {
         // TODO: error message?
         if (!$this->primary) {
             return "<b>Exception</b> in layout <b>{$this->name}!</b>" . (!JDEBUG ? $e->getMessage() : '');
         }
         $title = '500 Internal Server Error';
         $document = JFactory::getDocument();
         $document->setTitle($title);
         JResponse::setHeader('Status', $title, true);
         $output = KunenaLayout::factory('Misc/Default', 'pages')->set('header', $title)->set('body', $e->getMessage());
     }
     return (string) $output;
 }
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:30,代码来源:display.php

示例7: attachEmailBody

 /**
  * @param JMail $mail
  * @param int $subscription
  * @param string $subject
  * @param string $url
  * @param bool $once
  *
  * @return string
  */
 protected function attachEmailBody(JMail $mail, $subscription, $subject, $url, $once)
 {
     $layout = KunenaLayout::factory('Email/Subscription')->debug(false)->set('mail', $mail)->set('message', $this)->set('messageUrl', $url)->set('once', $once);
     try {
         $msg = trim($layout->render($subscription ? 'default' : 'moderator'));
     } catch (Exception $e) {
         // TODO: Deprecated in K4.0, remove in K5.0
         // Clean up the message for review.
         $message = KunenaHtmlParser::stripBBCode($this->message, 0, false);
         $config = KunenaFactory::getConfig();
         if ($subscription) {
             $msg1 = $this->get('parent') ? JText::_('COM_KUNENA_POST_EMAIL_NOTIFICATION1') : JText::_('COM_KUNENA_POST_EMAIL_NOTIFICATION1_CAT');
             $msg2 = $this->get('parent') ? JText::_('COM_KUNENA_POST_EMAIL_NOTIFICATION2') : JText::_('COM_KUNENA_POST_EMAIL_NOTIFICATION2_CAT');
         } else {
             $msg1 = JText::_('COM_KUNENA_POST_EMAIL_MOD1');
             $msg2 = JText::_('COM_KUNENA_POST_EMAIL_MOD2');
         }
         $msg = $msg1 . " " . $config->board_title . "\n\n";
         // DO NOT REMOVE EXTRA SPACE, JMailHelper::cleanBody() removes "Subject:" from the message body
         $msg .= JText::_('COM_KUNENA_MESSAGE_SUBJECT') . " : " . $subject . "\n";
         $msg .= JText::_('COM_KUNENA_CATEGORY') . " : " . $this->getCategory()->name . "\n";
         $msg .= JText::_('COM_KUNENA_VIEW_POSTED') . " : " . $this->getAuthor()->getName('???', false) . "\n\n";
         $msg .= "URL : {$url}\n\n";
         if ($config->mailfull == 1) {
             $msg .= JText::_('COM_KUNENA_MESSAGE') . " :\n-----\n";
             $msg .= $message;
             $msg .= "\n-----\n\n";
         }
         $msg .= $msg2 . "\n";
         if ($subscription && $once) {
             if ($this->parent) {
                 $msg .= JText::_('COM_KUNENA_POST_EMAIL_NOTIFICATION_MORE_READ') . "\n";
             } else {
                 $msg .= JText::_('COM_KUNENA_POST_EMAIL_NOTIFICATION_MORE_SUBSCRIBE') . "\n";
             }
         }
         $msg .= "\n";
         $msg .= JText::_('COM_KUNENA_POST_EMAIL_NOTIFICATION3') . "\n";
     }
     $mail->setBody($msg);
 }
开发者ID:giabmf11,项目名称:Kunena-Forum,代码行数:50,代码来源:message.php

示例8: getButton

	/**
	 * Get button.
	 *
	 * @param   string       $url    Target link (do not route it).
	 * @param   string       $name   Name of the button.
	 * @param   string       $scope  Scope of the button.
	 * @param   string       $type   Type of the button.
	 * @param   bool         $id     Id of the button.
	 *
	 * @return  string
	 */
	public function getButton($url, $name, $scope, $type, $id = null)
	{
		return KunenaLayout::factory('Widget/Button')
			->setProperties(array('url' => KunenaRoute::_($url), 'name' => $name, 'scope' => $scope, 'type' => $type, 'id' => $id));
	}
开发者ID:BillVGN,项目名称:PortalPRP,代码行数:16,代码来源:display.php

示例9: renderTweet

 /**
  * Render the tweet by loading the right layout
  *
  * @param   int  $tweetid  The tweet id to render in layout
  *
  * @return string
  */
 public function renderTweet($tweetid)
 {
     $tweet = $this->getTweet($tweetid);
     $layout = KunenaLayout::factory('BBCode/twitter');
     if ($tweet->error === false) {
         if ($layout->getPath()) {
             return (string) $layout->set('tweetid', $tweet->id_str)->set('user_profile_url_normal', $tweet->user->profile_image_url)->set('user_profile_url_big', $tweet->user->profile_image_url_big)->set('user_name', $tweet->user->name)->set('user_screen_name', $tweet->user->screen_name)->set('tweet_created_at', $tweet->created_at)->set('tweet_text', $tweet->text)->set('retweet_count', $tweet->retweet_count)->set('favorite_count', $tweet->favorite_count)->set('verified', $tweet->user->verified)->setLayout('default');
         }
     } else {
         return '<b>' . $tweet->error . '</b>';
     }
 }
开发者ID:Weley,项目名称:Saviors-web,代码行数:19,代码来源:bbcode.php

示例10: loadTemplateFile

 /**
  * Load a template file -- first look in the templates folder for an override
  *
  * @param   string  $tpl	The name of the template source file ...
  * 					automatically searches the template paths and compiles as needed.
  * @param   array   $hmvcParams	Extra parameters for HMVC.
  * @return  string   The output of the the template script.
  */
 public function loadTemplateFile($tpl = null, $hmvcParams = null)
 {
     KUNENA_PROFILER ? $this->profiler->start('function ' . __CLASS__ . '::' . __FUNCTION__ . '()') : null;
     // HMVC legacy support.
     $view = $this->getName();
     $layout = $this->getLayout();
     list($name, $override) = $this->ktemplate->mapLegacyView("{$view}/{$layout}_{$tpl}");
     $hmvc = KunenaLayout::factory($name)->setLayout($override);
     if ($hmvc->getPath()) {
         if ($hmvcParams) {
             $hmvc->setProperties($hmvcParams);
         }
         KUNENA_PROFILER ? $this->profiler->stop('function ' . __CLASS__ . '::' . __FUNCTION__ . '()') : null;
         return $hmvc->setLegacy($this);
     }
     // Create the template file name based on the layout
     $file = isset($tpl) ? $layout . '_' . $tpl : $layout;
     if (!isset($this->templatefiles[$file])) {
         // Clean the file name
         $file = preg_replace('/[^A-Z0-9_\\.-]/i', '', $file);
         $tpl = isset($tpl) ? preg_replace('/[^A-Z0-9_\\.-]/i', '', $tpl) : $tpl;
         // Load the template script
         $filetofind = $this->_createFileName('template', array('name' => $file));
         $this->templatefiles[$file] = KunenaPath::find($this->_path['template'], $filetofind);
     }
     $this->_template = $this->templatefiles[$file];
     if ($this->_template != false) {
         $templatefile = preg_replace('%' . KunenaPath::clean(JPATH_ROOT, '/') . '/%', '', KunenaPath::clean($this->_template, '/'));
         // Unset so as not to introduce into template scope
         unset($tpl);
         unset($file);
         // Never allow a 'this' property
         if (isset($this->this)) {
             unset($this->this);
         }
         // Start capturing output into a buffer
         ob_start();
         // Include the requested template filename in the local scope
         // (this will execute the view logic).
         include $this->_template;
         // Done with the requested template; get the buffer and
         // clear it.
         $output = ob_get_contents();
         ob_end_clean();
         if (JDEBUG || $this->config->get('debug')) {
             $output = trim($output);
             $output = "\n<!-- START {$templatefile} -->\n{$output}\n<!-- END {$templatefile} -->\n";
         }
     } else {
         $output = JError::raiseError(500, JText::sprintf('JLIB_APPLICATION_ERROR_LAYOUTFILE_NOT_FOUND', $this->getName() . '/' . $file));
     }
     KUNENA_PROFILER ? $this->profiler->stop('function ' . __CLASS__ . '::' . __FUNCTION__ . '()') : null;
     return $output;
 }
开发者ID:densem-2013,项目名称:exikom,代码行数:62,代码来源:view.php

示例11: defined

<?php
/**
 * Kunena Component
 * @package Kunena.Administrator.Template.Joomla30
 * @subpackage Layouts.Pagination
 *
 * @copyright (C) 2008 - 2016 Kunena Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link https://www.kunena.org
 **/
defined ( '_JEXEC' ) or die ();
?>
<div class="pagination pagination-toolbar">
	<?php echo KunenaLayout::factory('pagination/list')->set('pagination', $this->pagination); ?>
	<input type="hidden" name="<?php echo $this->pagination->prefix ?>limitstart" value="<?php echo $this->pagination->limitstart; ?>" />
</div>
开发者ID:BillVGN,项目名称:PortalPRP,代码行数:16,代码来源:default.php

示例12: report

 function report()
 {
     if (!JSession::checkToken('post')) {
         $this->app->enqueueMessage(JText::_('COM_KUNENA_ERROR_TOKEN'), 'error');
         $this->setRedirectBack();
         return;
     }
     if (!$this->me->exists() || $this->config->reportmsg == 0) {
         // Deny access if report feature has been disabled or user is guest
         $this->app->enqueueMessage(JText::_('COM_KUNENA_NO_ACCESS'), 'notice');
         $this->setRedirectBack();
         return;
     }
     if (!$this->config->get('send_emails')) {
         // Emails have been disabled
         $this->app->enqueueMessage(JText::_('COM_KUNENA_EMAIL_DISABLED'), 'notice');
         $this->setRedirectBack();
         return;
     }
     if (!$this->config->getEmail() || !JMailHelper::isEmailAddress($this->config->getEmail())) {
         // Error: email address is invalid
         $this->app->enqueueMessage(JText::_('COM_KUNENA_EMAIL_INVALID'), 'error');
         $this->setRedirectBack();
         return;
     }
     // Get target object for the report
     if ($this->mesid) {
         $message = $target = KunenaForumMessageHelper::get($this->mesid);
         $topic = $target->getTopic();
     } else {
         $topic = $target = KunenaForumTopicHelper::get($this->id);
         $message = KunenaForumMessageHelper::get($topic->first_post_id);
     }
     $messagetext = $message->message;
     $baduser = KunenaFactory::getUser($message->userid);
     if (!$target->authorise('read')) {
         // Deny access if user cannot read target
         $this->app->enqueueMessage($target->getError(), 'notice');
         $this->setRedirectBack();
         return;
     }
     $reason = JRequest::getString('reason');
     $text = JRequest::getString('text');
     $template = KunenaTemplate::getInstance();
     if (method_exists($template, 'reportMessage')) {
         $template->reportMessage($message, $reason, $text);
     }
     // Load language file from the template.
     KunenaFactory::getTemplate()->loadLanguage();
     if (empty($reason) && empty($text)) {
         // Do nothing: empty subject or reason is empty
         $this->app->enqueueMessage(JText::_('COM_KUNENA_REPORT_FORG0T_SUB_MES'));
         $this->setRedirectBack();
         return;
     } else {
         $acl = KunenaAccess::getInstance();
         $emailToList = $acl->getSubscribers($topic->category_id, $topic->id, false, true, false);
         if (!empty($emailToList)) {
             $mailsender = JMailHelper::cleanAddress($this->config->board_title . ' ' . JText::_('COM_KUNENA_FORUM') . ': ' . $this->me->getName());
             $mailsubject = "[" . $this->config->board_title . " " . JText::_('COM_KUNENA_FORUM') . "] " . JText::_('COM_KUNENA_REPORT_MSG') . ": ";
             if ($reason) {
                 $mailsubject .= $reason;
             } else {
                 $mailsubject .= $topic->subject;
             }
             jimport('joomla.environment.uri');
             $msglink = JUri::getInstance()->toString(array('scheme', 'host', 'port')) . $target->getPermaUrl(null, false);
             $mail = JFactory::getMailer();
             $mail->setSender(array($this->me->username, $this->me->email));
             $mail->setSubject($mailsubject);
             // Render the email.
             $layout = KunenaLayout::factory('Email/Report')->debug(false)->set('mail', $mail)->set('message', $message)->set('me', $this->me)->set('title', $reason)->set('content', $text)->set('messageLink', $msglink);
             try {
                 $body = trim($layout->render());
                 $mail->setBody($body);
             } catch (Exception $e) {
                 // TODO: Deprecated in K4.0, remove in K5.0
                 $mailmessage = "" . JText::_('COM_KUNENA_REPORT_RSENDER') . " {$this->me->username} ({$this->me->name})";
                 $mailmessage .= "\n";
                 $mailmessage .= "" . JText::_('COM_KUNENA_REPORT_RREASON') . " " . $reason;
                 $mailmessage .= "\n";
                 $mailmessage .= "" . JText::_('COM_KUNENA_REPORT_RMESSAGE') . " " . $text;
                 $mailmessage .= "\n\n";
                 $mailmessage .= "" . JText::_('COM_KUNENA_REPORT_POST_POSTER') . " {$baduser->username} ({$baduser->name})";
                 $mailmessage .= "\n";
                 $mailmessage .= "" . JText::_('COM_KUNENA_REPORT_POST_SUBJECT') . ": " . $topic->subject;
                 $mailmessage .= "\n";
                 $mailmessage .= "" . JText::_('COM_KUNENA_REPORT_POST_MESSAGE') . "\n-----\n" . KunenaHtmlParser::stripBBCode($messagetext, 0, false);
                 $mailmessage .= "\n-----\n\n";
                 $mailmessage .= "" . JText::_('COM_KUNENA_REPORT_POST_LINK') . " " . $msglink;
                 $mailmessage = JMailHelper::cleanBody(strtr($mailmessage, array('&#32;' => '')));
                 $mail->setBody($mailmessage);
             }
             $receivers = array();
             foreach ($emailToList as $emailTo) {
                 if (!$emailTo->email || !JMailHelper::isEmailAddress($emailTo->email)) {
                     continue;
                 }
                 $receivers[] = $emailTo->email;
             }
//.........这里部分代码省略.........
开发者ID:giabmf11,项目名称:Kunena-Forum,代码行数:101,代码来源:topic.php


注:本文中的KunenaLayout类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。