本文整理汇总了PHP中Phpfox_Template类的典型用法代码示例。如果您正苦于以下问题:PHP Phpfox_Template类的具体用法?PHP Phpfox_Template怎么用?PHP Phpfox_Template使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Phpfox_Template类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get
/**
* Get HTML form.
*
* @param array $aArgs ARRAY of settings to pass to the form.
* @return string HTML form.
*/
public function get($aArgs = array())
{
$aVars = Phpfox_Template::instance()->getVar('aForms');
$sHtml = '';
$sHtml .= '<input type="text" name="val[' . $aArgs['id'] . '][]" id="js_inline_input_' . $aArgs['id'] . '" style="width:' . $aArgs['width'] . ';" size="' . $aArgs['size'] . '"';
$sHtml .= " autocomplete=\"off\"";
if (isset($aArgs['edit']) && $aArgs['edit'] != '') {
$sHtml .= " value=\"" . $aArgs['edit'] . "\" ";
} elseif (isset($aArgs['display'])) {
$sHtml .= " value=\"" . $aArgs['display'] . "\" onfocus=\"if (this.value == '" . $aArgs['display'] . "') { this.value=''; }\"";
}
$sHtml .= " onkeyup=\"if (this.value != '') { oInlineSearch.call('" . $aArgs['id'] . "', '" . $aArgs['call'] . "', '" . Phpfox_Template::instance()->getVar('sTagType') . "'); }\" ";
$sHtml .= ' />';
if (isset($aArgs['type']) && $aArgs['type'] == 'comma') {
$sHtml .= ' <input type="button" value="Add" class="button" onclick="return oInlineSearch.addWithComma(\'' . $aArgs['id'] . '\');" />';
}
$sHtml .= '<div style="position:relative; width:' . $aArgs['width'] . '; z-index:100;"><div class="drop_layer" id="js_inline_hidden_' . $aArgs['id'] . '" style="position:absolute;"></div></div>';
$sHtml .= '<div class="inline_search_box" id="js_inline_search_box_' . $aArgs['id'] . '" style="width:' . $aArgs['width'] . ';"><div style="overflow:scroll; height:60px;"><div id="js_inline_search_content_' . $aArgs['id'] . '" style="padding:5px;"></div></div></div>';
if (isset($aArgs['info'])) {
$sHtml .= '<div class="p_4">' . $aArgs['info'] . '</div>';
}
if (isset($aVars[$aArgs['id']]) && is_array($aVars[$aArgs['id']])) {
$sHtml .= '<script type="text/javascript">';
foreach ($aVars[$aArgs['id']] as $mKey => $mValue) {
$sHtml .= "oInlineSearch.add('" . $aArgs['id'] . "', 'val[" . $aArgs['id'] . "]', '{$mKey}', '{$mValue}');";
}
$sHtml .= '</script>';
}
return $sHtml;
}
开发者ID:lev1976g,项目名称:core,代码行数:36,代码来源:inline.class.php
示例2: getNotificationAction
/** This function catches all the "actions" (Dislike, and in the future maybe others)
* */
public function getNotificationAction($aNotification)
{
//d($aNotification);die();
// get the type of item that was marked ("blog", "photo"...)
$aAction = $this->database()->select('*')->from(Phpfox::getT('action'))->where('action_id = ' . (int) $aNotification['item_id'])->limit(1)->execute('getSlaveRow');
if (empty($aAction) || !isset($aAction['item_type_id'])) {
return false;
throw new Exception('No type for this action (' . print_r($aAction, true) . ')');
}
// Check if the module is a sub module
if (preg_match('/(?P<module>[a-z]+)[_]?(?P<submodule>[a-z]{0,99})/i', $aAction['item_type_id'], $aMatch) < 1) {
throw new Exception('Malformed item_type');
}
// Call the module and get the title
if (!Phpfox::isModule($aMatch['module'])) {
return false;
}
$aRow = Phpfox::getService($aMatch['module'])->getInfoForAction($aAction);
$sUsers = Phpfox::getService('notification')->getUsers($aNotification);
$sTitle = Phpfox::getLib('parse.output')->shorten($aRow['title'], Phpfox::getParam('notification.total_notification_title_length'), '...');
$sPhrase = '';
if ($aNotification['user_id'] == $aRow['user_id']) {
// {users} disliked {gender} own {item} "{title}"
$sPhrase = Phpfox::getPhrase('like.users_disliked_gender_own_item_title', array('users' => $sUsers, 'gender' => Phpfox::getService('user')->gender($aRow['gender'], 1), 'title' => $sTitle, 'item' => $aAction['item_type_id']));
} elseif ($aRow['user_id'] == Phpfox::getUserId()) {
// {users} liked your blog "{title}"
$sPhrase = Phpfox::getPhrase('like.users_disliked_your_item_title', array('users' => $sUsers, 'title' => $sTitle, 'item' => $aAction['item_type_id']));
} else {
$sPhrase = Phpfox::getPhrase('like.users_disliked_users_item', array('users' => $sUsers, 'row_full_name' => $aRow['full_name'], 'title' => $sTitle, 'item' => $aAction['item_type_id']));
}
return array('link' => $aRow['link'], 'message' => $sPhrase, 'icon' => Phpfox_Template::instance()->getStyle('image', 'activity.png', 'blog'));
}
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:34,代码来源:callback.class.php
示例3: addCategory
public function addCategory()
{
if (!Phpfox::getService('blog.category')->canAdd()) {
return $this->alert(Phpfox::getPhrase('blog.you_have_reached_your_limit'));
}
$aVals = $this->get('val');
$oBlogCategoryProcess = Phpfox::getService('blog.category.process');
$sCleanUrl = Phpfox::getLib('parse.input')->clean($aVals['add']);
if (Phpfox::getService('blog.category')->isPrivateCategory($sCleanUrl, Phpfox::getUserId())) {
$this->call('alert("' . Phpfox::getPhrase('blog.already_a_category') . '"); $("#js_add_category").val(""); $("#js_add_category").focus();');
return false;
}
$aCategories = explode(',', $aVals['add']);
$aRows = array();
foreach ($aCategories as $sCategory) {
$sCategory = trim($sCategory);
$iId = $oBlogCategoryProcess->add($sCategory);
$aRows[] = array('category_id' => $iId, 'name' => Phpfox::getLib('parse.input')->clean($sCategory, 255));
}
rsort($aRows);
foreach ($aRows as $aRow) {
Phpfox_Template::instance()->assign(array('aItem' => array('category_id' => $aRow['category_id'], 'name' => $aRow['name'], 'user_id' => Phpfox::getUserId())));
Phpfox_Template::instance()->getTemplate('blog.block.category-form');
}
$this->call('$("#js_add_new_category").prepend("' . $this->getContent() . '"); $("#js_category_info").html("' . Phpfox::getPhrase('blog.added') . '").highlightFade().fadeOut(5000); $("#js_add_category").val(""); $Core.loadInit();');
}
开发者ID:lev1976g,项目名称:core,代码行数:26,代码来源:ajax.class.php
示例4: process
/**
* Controller
*/
public function process()
{
// $this->request()->cache('text/html', strtotime('-2 days'), 7);
if ($sPlugin = Phpfox_Plugin::get('core.component_controller_index_member_start')) {
eval($sPlugin);
}
if ($this->request()->segment(1) != 'hashtag') {
Phpfox::isUser(true);
}
if ($this->request()->get('req3') == 'customize') {
define('PHPFOX_IN_DESIGN_MODE', true);
define('PHPFOX_CAN_MOVE_BLOCKS', true);
if ($iTestStyle = $this->request()->get('test_style_id')) {
if (Phpfox_Template::instance()->testStyle($iTestStyle)) {
}
}
$aDesigner = array('current_style_id' => Phpfox::getUserBy('style_id'), 'design_header' => Phpfox::getPhrase('core.customize_dashboard'), 'current_page' => $this->url()->makeUrl(''), 'design_page' => $this->url()->makeUrl('core.index-member', 'customize'), 'block' => 'core.index-member', 'item_id' => Phpfox::getUserId(), 'type_id' => 'user');
$this->setParam('aDesigner', $aDesigner);
$this->template()->setPhrase(array('theme.are_you_sure'))->setHeader('cache', array('style.css' => 'style_css', 'video.css' => 'module_video', 'design.js' => 'module_theme', 'select.js' => 'module_theme'));
if (Phpfox::getParam('profile.can_drag_drop_blocks_on_profile')) {
$this->template()->setHeader('cache', array('jquery/ui.js' => 'static_script', 'sort.js' => 'module_theme'))->setHeader(array('<script type="text/javascript">$Behavior.core_controller_member_designonupdate = function() { function designOnUpdate() { $Core.design.updateSorting(); } };</script>', '<script type="text/javascript">$Behavior.core_controller_init = function() { $Core.design.init({type_id: \'user\'}); };</script>'));
}
} else {
// $this->template()->setHeader('jquery/ui.js', 'static_script');
$this->template()->setHeader('cache', array('sort.js' => 'module_theme', 'design.js' => 'module_theme', 'video.css' => 'module_video'))->setHeader(array());
}
if (Phpfox::getParam('video.convert_servers_enable')) {
$this->template()->setHeader('<script type="text/javascript">document.domain = "' . Phpfox::getParam('video.convert_js_parent') . '";</script>');
}
Phpfox_Module::instance()->setCacheBlockData(array('table' => 'user_dashboard', 'field' => 'user_id', 'item_id' => Phpfox::getUserId(), 'controller' => 'core.index-member'));
$this->template()->setHeader('cache', array('feed.js' => 'module_feed', 'welcome.css' => 'style_css', 'announcement.css' => 'style_css', 'comment.css' => 'style_css', 'quick_edit.js' => 'static_script', 'jquery/plugin/jquery.highlightFade.js' => 'static_script', 'jquery/plugin/jquery.scrollTo.js' => 'static_script'))->setEditor(array('load' => 'simple'));
}
开发者ID:noikiy,项目名称:phpfox-dist,代码行数:35,代码来源:index-member.class.php
示例5: getDashboardLinks
public function getDashboardLinks()
{
$aMenus = array();
$aModules = Phpfox::massCallback('getDashboardLinks');
foreach ($aModules as $aModule) {
if ($aModule === false) {
continue;
}
if (isset($aModule['submit']['link'])) {
$aMenus['submit'][] = $aModule['submit'];
} else {
foreach ($aModule['submit'] as $aSubModule) {
$aMenus['submit'][] = $aSubModule;
}
}
$aMenus['edit'][] = $aModule['edit'];
}
$aProfileMenus = Phpfox_Template::instance()->getMenu('profile');
foreach ($aProfileMenus as $aProfileMenu) {
if ($aProfileMenu['url'] == 'profile') {
continue;
}
$aMenus['profile'][] = array('module' => $aProfileMenu['module'], 'var_name' => $aProfileMenu['var_name'], 'url' => $aProfileMenu['url']);
}
// $this->cache()->save($sCacheId, $aMenus);
return $aMenus;
}
开发者ID:Goudarzi-hahram,项目名称:phpfox,代码行数:27,代码来源:core.class.php
示例6: getRequestLink
public function getRequestLink()
{
($sPlugin = Phpfox_Plugin::get('comment.component_service_callback_getrequestlink__start')) ? eval($sPlugin) : false;
$iTotalApproveCount = $this->database()->select('COUNT(*)')->from(Phpfox::getT('comment'))->where('owner_user_id = ' . Phpfox::getUserId() . ' AND view_id = 1')->execute('getSlaveField');
if (!Phpfox::getParam('request.display_request_box_on_empty') && !$iTotalApproveCount) {
return null;
}
return '<li><a href="' . Phpfox_Url::instance()->makeUrl('request', '#comment') . '"' . (!$iTotalApproveCount ? ' onclick="alert(\'' . Phpfox::getPhrase('comment.nothing_new_to_approve') . '\'); return false;"' : '') . '><img src="' . Phpfox_Template::instance()->getStyle('image', 'misc/comment.png') . '" alt="" class="v_middle" /> ' . Phpfox::getPhrase('comment.comments_pending_approval_total', array('total' => $iTotalApproveCount)) . '</a></li>';
}
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:9,代码来源:callback.class.php
示例7: getContent
public function getContent()
{
$Template = \Phpfox_Template::instance();
if (!$this->_render) {
/*
if (PHPFOX_IS_AJAX_PAGE) {
\Phpfox_Module::instance()->getControllerTemplate();
$content = ob_get_contents(); ob_clean();
$content = (string) new View\Functions('content', $content);
return $content;
}
else {
\Phpfox_Module::instance()->getControllerTemplate();
$content = ob_get_contents(); ob_clean();
$this->_render['name'] = '@Base/Layout.html';
$this->_render['params']['content'] = $content;
}
*/
\Phpfox_Module::instance()->getControllerTemplate();
$content = ob_get_contents();
ob_clean();
$this->_render['name'] = '@Base/' . self::$template . '.html';
$this->_render['params']['content'] = $content;
}
$params = $this->_render['params'];
$params['content'] = $this->_env->render($this->_render['name'], $params);
if (PHPFOX_IS_AJAX_PAGE) {
$content = (string) new View\Functions('content', $params['content']);
return $content;
}
// $params['content'] = '<div class="_block_content">' . $params['content'] . '</div>';
$params['content'] = new View\Functions('content', $params['content']);
$params['header'] = $Template->getHeader();
$params['title'] = $Template->getTitle();
$params['js'] = $Template->getFooter();
$params['nav'] = new View\Functions('nav');
$params['menu'] = new View\Functions('menu');
$params['share'] = new View\Functions('share');
$params['notify'] = new View\Functions('notify');
$params['search'] = new View\Functions('search');
$params['footer'] = new View\Functions('footer');
$params['errors'] = new View\Functions('errors');
$params['top'] = new View\Functions('top');
$params['left'] = new View\Functions('left');
$params['right'] = new View\Functions('right');
$params['h1'] = new View\Functions('h1');
$params['breadcrumb'] = new View\Functions('breadcrumb');
$params['notification'] = new View\Functions('notification');
$params['logo'] = new View\Functions('logo');
$params['body'] = 'id="page_' . \Phpfox_Module::instance()->getPageId() . '" class="' . \Phpfox_Module::instance()->getPageClass() . '"';
// d($params['active']); exit;
$locale = \Phpfox_Locale::instance()->getLang();
$params['html'] = 'xmlns="http://www.w3.org/1999/xhtml" dir="' . $locale['direction'] . '" lang="' . $locale['language_code'] . '"';
// return $this->_env->render($this->_render['name'], $params);
return $this->_env->render('@Theme/' . self::$template . '.html', $params);
}
开发者ID:lev1976g,项目名称:core,代码行数:57,代码来源:View.php
示例8: getNotificationLink
public function getNotificationLink($mId, $mTotal = null)
{
$sImage = '<img src="' . Phpfox_Template::instance()->getStyle('image', 'misc/email.png') . '" alt="" class="v_middle" />';
if (is_array($mId) && $mTotal === null) {
return Phpfox::getPhrase('mail.li_a_href_link_email_image_new_messages_messages_number_a_li', array('link' => Phpfox_Url::instance()->makeUrl('mail'), 'email_image' => $sImage, 'messages_number' => isset($mId['mail']) ? $mId['mail'] : '0'));
} else {
return '<li><a href="' . Phpfox_Url::instance()->makeUrl('mail') . '" class="js_nofitication_' . $mId . '">' . $sImage . ' ' . ($mTotal > 1 ? Phpfox::getPhrase('mail.total_new_messages', array('total' => $mTotal)) : Phpfox::getPhrase('mail.1_new_message')) . '</a></li>';
}
}
开发者ID:lev1976g,项目名称:core,代码行数:9,代码来源:callback.class.php
示例9: getSource
public function getSource($name)
{
if ($name == '@Theme/layout.html') {
$Theme = \Phpfox_Template::instance()->theme()->get();
$Service = new \Core\Theme\Service($Theme);
return $Service->html()->get();
}
return parent::getSource($name);
}
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:9,代码来源:Loader.php
示例10: process
/**
* Controller
*/
public function process()
{
Phpfox::isUser(true);
if (!Phpfox::getParam('mail.threaded_mail_conversation')) {
$this->url()->send('mail');
}
$aVals = $this->request()->get('val');
if ($aVals && ($iNewId = Mail_Service_Process::instance()->add($aVals))) {
list($aCon, $aMessages) = Mail_Service_Mail::instance()->getThreadedMail($iNewId);
$aMessages = array_reverse($aMessages);
Phpfox_Template::instance()->assign(array('aMail' => $aMessages[0], 'aCon' => $aCon, 'bIsLastMessage' => true))->getTemplate('mail.block.entry');
$content = ob_get_contents();
ob_clean();
return ['append' => ['to' => '#mail_threaded_new_message', 'with' => $content]];
}
$iThreadId = $this->request()->getInt('id');
list($aThread, $aMessages) = Mail_Service_Mail::instance()->getThreadedMail($iThreadId);
if ($aThread === false) {
return Phpfox_Error::display(Phpfox::getPhrase('mail.unable_to_find_a_conversation_history_with_this_user'));
}
$aValidation = array('message' => Phpfox::getPhrase('mail.add_reply'));
$oValid = Phpfox_Validator::instance()->set(array('sFormName' => 'js_form', 'aParams' => $aValidation));
if ($aThread['user_is_archive']) {
$this->request()->set('view', 'trash');
}
Mail_Service_Mail::instance()->buildMenu();
Mail_Service_Process::instance()->threadIsRead($aThread['thread_id']);
$iUserCnt = 0;
$sUsers = '';
$bCanViewThread = false;
foreach ($aThread['users'] as $aUser) {
if ($aUser['user_id'] == Phpfox::getUserId()) {
$bCanViewThread = true;
}
if ($aUser['user_id'] == Phpfox::getUserId()) {
continue;
}
$iUserCnt++;
if ($iUserCnt == count($aThread['users']) - 1 && count($aThread['users']) - 1 > 1) {
$sUsers .= ' & ';
} else {
if ($iUserCnt != '1') {
$sUsers .= ', ';
}
}
$sUsers .= $aUser['full_name'];
}
if (!$bCanViewThread) {
return Phpfox_Error::display('Unable to view this thread.');
} else {
$this->template()->setBreadcrumb(Phpfox::getPhrase('mail.mail'), $this->url()->makeUrl('mail'))->setBreadcrumb($sUsers, $this->url()->makeUrl('mail.thread', array('id' => $iThreadId)), true);
}
$this->template()->setTitle($sUsers)->setTitle(Phpfox::getPhrase('mail.mail'))->setHeader('cache', array('mail.js' => 'module_mail', 'jquery/plugin/jquery.scrollTo.js' => 'static_script'))->assign(array('sCreateJs' => $oValid->createJS(), 'sGetJsForm' => $oValid->getJsForm(false), 'aMessages' => $aMessages, 'aThread' => $aThread, 'sCurrentPageCnt' => $this->request()->getInt('page', 0) + 1));
$this->setParam('attachment_share', array('type' => 'mail', 'id' => 'js_form_mail'));
$this->setParam('global_moderation', array('name' => 'mail', 'ajax' => 'mail.mailThreadAction', 'custom_fields' => '<div><input type="hidden" name="forward_thread_id" value="' . $aThread['thread_id'] . '" id="js_forward_thread_id" /></div>', 'menu' => array(array('phrase' => Phpfox::getPhrase('mail.forward'), 'action' => 'forward'))));
}
开发者ID:Goudarzi-hahram,项目名称:phpfox,代码行数:59,代码来源:thread.class.php
示例11: __construct
public function __construct($assets)
{
if (!is_array($assets)) {
$assets = [$assets];
}
foreach ($assets as $asset) {
if (substr($asset, 0, 7) == '@static') {
\Phpfox_Template::instance()->delayedHeaders[] = [str_replace('@static/', '', $asset) => 'static_script'];
}
}
}
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:11,代码来源:Asset.php
示例12: __construct
public function __construct($path = null)
{
$this->request = new Request();
$this->url = new Url();
$this->active = (new \Api\User())->get(\Phpfox::getUserId());
$this->_template = \Phpfox_Template::instance();
$this->_view = new View();
if ($path !== null && is_dir($path)) {
$this->_view->loader()->addPath($path);
}
}
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:11,代码来源:Controller.php
示例13: addThreadMail
public function addThreadMail()
{
$aVals = $this->get('val');
if ($iNewId = Mail_Service_Process::instance()->add($aVals)) {
list($aCon, $aMessages) = Mail_Service_Mail::instance()->getThreadedMail($iNewId);
$aMessages = array_reverse($aMessages);
Phpfox_Template::instance()->assign(array('aMail' => $aMessages[0], 'aCon' => $aCon, 'bIsLastMessage' => true))->getTemplate('mail.block.entry');
$this->call('$(\'.mail_thread_holder\').removeClass(\'is_last_message\');');
$this->append('#mail_threaded_new_message', $this->getContent(false));
$this->call("\$.scrollTo('.is_last_message:first');");
$this->call("\$('.mail_thread_form_holder').addClass('not_fixed');");
}
}
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:13,代码来源:ajax.class.php
示例14: display
/**
* Displays the error message and directly creates a variable for the template engine
*
* @static
* @param string $sMsg Error message you want to display on the current page the user is on.
*/
public static function display($sMsg, $iErrCode = null)
{
if (PHPFOX_IS_AJAX) {
echo $sMsg;
} else {
Phpfox_Module::instance()->setController('error.display');
Phpfox_Template::instance()->assign(array('sErrorMessage' => $sMsg));
}
if ($iErrCode !== null) {
$oUrl = Phpfox_Url::instance();
header($oUrl->getHeaderCode($iErrCode));
}
return false;
}
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:20,代码来源:error.class.php
示例15: loadProfileBlock
public function loadProfileBlock()
{
exit;
$sProfileUrl = str_replace('profile_', '', $this->get('url'));
if ($this->get('url') == 'profile_info') {
$sProfileUrl = 'profile';
}
if (!Phpfox::isModule($sProfileUrl)) {
Phpfox_Error::set('Trying to load an invalid module.');
} else {
if (!Phpfox::hasCallback($sProfileUrl, 'getAjaxProfileController')) {
Phpfox_Error::set('Unable to load the section you are looking for.');
}
}
if (Phpfox_Error::isPassed()) {
$oModule = Phpfox_Module::instance();
$oTpl = Phpfox_Template::instance();
$oTpl->assign(array('bIsAjaxLoader' => true));
$aStyleInUse = $oTpl->getStyleInUse();
$oModule->loadBlocks();
$aUrlParams = array($this->get('user_name'));
if ($this->get('url') != 'profile') {
$aUrlParams[] = str_replace('profile_', '', $this->get('url'));
}
Phpfox_Url::instance()->setParam($aUrlParams);
$oModule->setController(Phpfox::callback($sProfileUrl . '.getAjaxProfileController'));
if ($aStyleInUse['total_column'] == '3') {
$oTpl->assign(array('aBlocks1' => $oTpl->bIsSample ? true : Phpfox_Module::instance()->getModuleBlocks(1), 'aBlocks3' => $oTpl->bIsSample ? true : Phpfox_Module::instance()->getModuleBlocks(3), 'aAdBlocks1' => $oTpl->bIsSample ? true : (Phpfox::isModule('ad') ? Ad_Service_Ad::instance()->getForBlock(1) : null), 'aAdBlocks3' => $oTpl->bIsSample ? true : (Phpfox::isModule('ad') ? Ad_Service_Ad::instance()->getForBlock(3) : null)));
} else {
$oTpl->assign(array('aBlocks1' => array(), 'aBlocks3' => array(), 'aAdBlocks1' => array(), 'aAdBlocks3' => array()));
}
$oTpl->assign(array('sPublicMessage' => Phpfox::getMessage(), 'aErrors' => Phpfox_Error::getDisplay() ? Phpfox_Error::get() : array(), 'aStyleInUse' => $aStyleInUse));
list($aBreadCrumbs, $aBreadCrumbTitle) = $oTpl->getBreadCrumb();
$this->remove('#js_temp_breadcrumb');
if (count($aBreadCrumbs)) {
foreach ($aBreadCrumbs as $sLink => $sPhrase) {
$this->append('h1', '<span id="js_temp_breadcrumb"><span class="profile_breadcrumb">»</span><a href="' . $sLink . '">' . $sPhrase . '</a></span>');
break;
}
}
$oTpl->getLayout($oTpl->sDisplayLayout);
$this->html($aStyleInUse['total_column'] == '3' ? '#content_load_data' : '#content', $this->getContent(false));
if ($this->get('url') == 'profile_info') {
$this->call('$Core.loadProfileInfo();');
}
} else {
$this->html('#js_profile_block_view_data_' . $this->get('url'), implode('', Phpfox_Error::get()));
}
$this->call('$Core.loadInit();');
}
开发者ID:lev1976g,项目名称:core,代码行数:50,代码来源:ajax.class.php
示例16: __construct
public function __construct()
{
header('Cache-Control: no-cache');
header('Pragma: no-cache');
session_start();
$this->_oTpl = Phpfox_Template::instance();
$this->_oReq = Phpfox_Request::instance();
$this->_oUrl = Phpfox_Url::instance();
$this->_sTempDir = Phpfox_File::instance()->getTempDir();
$this->_sPage = $this->_oReq->get('page');
$this->_sUrl = $this->_oReq->get('req1') == 'upgrade' ? 'upgrade' : 'install';
self::$_sSessionId = $this->_oReq->get('sessionid') ? $this->_oReq->get('sessionid') : uniqid();
if (defined('PHPFOX_IS_UPGRADE')) {
$this->_oTpl->assign('bIsUprade', true);
$this->_bUpgrade = true;
if (file_exists(PHPFOX_DIR . 'include' . PHPFOX_DS . 'settings' . PHPFOX_DS . 'server.sett.php')) {
$_CONF = [];
require_once PHPFOX_DIR . 'include' . PHPFOX_DS . 'settings' . PHPFOX_DS . 'server.sett.php';
$this->_aOldConfig = $_CONF;
}
}
if (!Phpfox_File::instance()->isWritable($this->_sTempDir)) {
if (PHPFOX_SAFE_MODE) {
$this->_sTempDir = PHPFOX_DIR_FILE . 'log' . PHPFOX_DS;
if (!Phpfox_File::instance()->isWritable($this->_sTempDir)) {
exit('Unable to write to temporary folder: ' . $this->_sTempDir);
}
} else {
exit('Unable to write to temporary folder: ' . $this->_sTempDir);
}
}
$this->_sSessionFile = $this->_sTempDir . 'installer_' . ($this->_bUpgrade ? 'upgrade_' : '') . '_' . self::$_sSessionId . '_' . 'phpfox.log';
$this->_hFile = fopen($this->_sSessionFile, 'a');
if ($this->_sUrl == 'install' && $this->_oReq->get('req2') == '') {
if (file_exists(PHPFOX_DIR_SETTING . 'server.sett.php')) {
require PHPFOX_DIR_SETTING . 'server.sett.php';
if (isset($_CONF['core.is_installed']) && $_CONF['core.is_installed'] === true) {
$this->_oUrl->forward('../install/index.php?' . PHPFOX_GET_METHOD . '=/upgrade/');
}
}
if (file_exists(PHPFOX_DIR . 'include' . PHPFOX_DS . 'settings' . PHPFOX_DS . 'server.sett.php')) {
$this->_oUrl->forward('../install/index.php?' . PHPFOX_GET_METHOD . '=/upgrade/');
}
}
// Define some needed params
Phpfox::getLib('setting')->setParam(array('core.path' => self::getHostPath(), 'core.url_static_script' => self::getHostPath() . 'static/jscript/', 'core.url_static_css' => self::getHostPath() . 'static/style/', 'core.url_static_image' => self::getHostPath() . 'static/image/', 'sCookiePath' => '/', 'sCookieDomain' => '', 'sWysiwyg' => false, 'bAllowHtml' => false, 'core.url_rewrite' => '2'));
}
开发者ID:lev1976g,项目名称:core,代码行数:47,代码来源:installer.class.php
示例17: getNotificationComment
public function getNotificationComment($aNotification)
{
$aRow = $this->database()->select('b.poke_id, u.user_id, u.gender, u.user_name, u.full_name, u2.full_name AS to_full_name')->from(Phpfox::getT('poke_data'), 'b')->join(Phpfox::getT('user'), 'u', 'u.user_id = b.user_id')->join(Phpfox::getT('user'), 'u2', 'u2.user_id = b.to_user_id')->where('b.poke_id = ' . (int) $aNotification['item_id'])->execute('getSlaveRow');
if (!isset($aRow['poke_id'])) {
return false;
}
$sUsers = Phpfox::getService('notification')->getUsers($aNotification);
$sTitle = Phpfox::getLib('parse.output')->shorten($aRow['to_full_name'], Phpfox::getParam('notification.total_notification_title_length'), '...');
$sPhrase = '';
if ($aNotification['user_id'] == $aRow['user_id'] && !isset($aNotification['extra_users'])) {
$sPhrase = Phpfox::getPhrase('poke.users_commented_on_gender_poke_for_title', array('users' => $sUsers, 'gender' => Phpfox::getService('user')->gender($aRow['gender'], 1), 'title' => $sTitle));
} elseif ($aRow['user_id'] == Phpfox::getUserId()) {
$sPhrase = Phpfox::getPhrase('poke.users_commented_on_your_poke_for_title', array('users' => $sUsers, 'title' => $sTitle));
} else {
$sPhrase = Phpfox::getPhrase('poke.users_commented_on_span_class_drop_data_user_row_full_name_s_span_for_title', array('users' => $sUsers, 'row_full_name' => $aRow['full_name'], 'title' => $sTitle));
}
return array('link' => Phpfox_Url::instance()->makeUrl($aRow['user_name'], array('poke-id' => $aRow['poke_id'])), 'message' => $sPhrase, 'icon' => Phpfox_Template::instance()->getStyle('image', 'activity.png', 'blog'));
}
开发者ID:lev1976g,项目名称:core,代码行数:18,代码来源:callback.class.php
示例18: setHeaders
public function setHeaders()
{
$sCacheId = $this->cache()->set('seo_nofollow_build');
if (!($aNoFollows = $this->cache()->get($sCacheId))) {
$aRows = $this->database()->select('*')->from(Phpfox::getT('seo_nofollow'))->execute('getSlaveRows');
$aNoFollows = array();
foreach ($aRows as $aRow) {
$aNoFollows[$aRow['url']] = true;
}
$this->cache()->save($sCacheId, $aNoFollows);
}
if (count($aNoFollows)) {
$sUrl = trim(Phpfox_Url::instance()->getFullUrl(true), '/');
if (isset($aNoFollows[$sUrl])) {
Phpfox_Template::instance()->setHeader('<meta name="robots" content="nofollow" />');
}
}
$sCacheId = $this->cache()->set('seo_meta_build');
if (!($aMetas = $this->cache()->get($sCacheId))) {
$aRows = $this->database()->select('*')->from(Phpfox::getT('seo_meta'))->execute('getSlaveRows');
$aMetas = array();
foreach ($aRows as $aRow) {
if (!isset($aMetas[$aRow['url']])) {
$aMetas[$aRow['url']] = array();
}
$aMetas[$aRow['url']][] = $aRow;
}
$this->cache()->save($sCacheId, $aMetas);
}
if (count($aMetas)) {
$sUrl = trim(Phpfox_Url::instance()->getFullUrl(true), '/');
if (isset($aMetas[$sUrl])) {
foreach ($aMetas[$sUrl] as $aMeta) {
if ($aMeta['type_id'] == '2') {
Phpfox_Template::instance()->setTitle(Phpfox_Locale::instance()->convert($aMeta['content']));
continue;
}
Phpfox_Template::instance()->setMeta(!$aMeta['type_id'] ? 'keywords' : 'description', $aMeta['content']);
}
}
}
}
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:42,代码来源:seo.class.php
示例19: getSource
public function getSource($name)
{
if ($name == '@Theme/layout.html') {
$Theme = \Phpfox_Template::instance()->theme()->get();
$Service = new \Core\Theme\Service($Theme);
return $Service->html()->get();
} else {
if (substr($name, 0, 7) == '@Theme/') {
$Theme = \Phpfox_Template::instance()->theme()->get();
$name = str_replace('@Theme/', '', $name);
$file = $Theme->getPath() . $name;
if (!file_exists($file)) {
$file = PHPFOX_DIR . 'theme/default/html/' . $name;
}
$html = file_get_contents($file);
return $html;
}
}
return parent::getSource($name);
}
开发者ID:lev1976g,项目名称:core,代码行数:20,代码来源:Loader.php
示例20: searchUsersTags
public function searchUsersTags()
{
$aParams = $this->get('val');
$aParams['tag_list'] = $aParams['tag_list'][0];
if (strstr($aParams['tag_list'], ',')) {
$aParts = explode(',', $aParams['tag_list']);
$aWords = array_reverse($aParts);
if (isset($aWords[0])) {
$aParams['tag_list'] = trim($aWords[0]);
}
}
if (empty($aParams['tag_list'])) {
$this->call("oInlineSearch.close('" . $this->get('id') . "');");
return false;
}
$aRows = Tag_Service_Tag::instance()->getInlineSearchForUser(Phpfox::getUserId(), $aParams['tag_list'], $this->get('category_id'));
if (count($aRows)) {
Phpfox_Template::instance()->assign(array('aRows' => $aRows, 'sJsId' => $this->get('id'), 'sSearch' => $aParams['tag_list']));
Phpfox_Template::instance()->getLayout('inline-search');
$this->call("oInlineSearch.display('" . $this->get('id') . "', '" . $this->getContent() . "');");
} else {
$this->call("oInlineSearch.close('" . $this->get('id') . "');");
}
}
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:24,代码来源:ajax.class.php
注:本文中的Phpfox_Template类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论