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


PHP Env::getLayoutPath方法代码示例

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


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

示例1: executeAction

	/**
	 * Contruct controller and execute specific action
	 *
	 * @access public
	 * @param string $controller_name
	 * @param string $action
	 * @return null
	 */
	static function executeAction($controller_name, $action) {
   		$max_users = config_option('max_users');
		if ($max_users && Contacts::count() > $max_users) {
	        echo lang("error").": ".lang("maximum number of users exceeded error");
	        return;
    	}
		ajx_check_login();
		
		Env::useController($controller_name);

		$controller_class = Env::getControllerClass($controller_name);
		if(!class_exists($controller_class, false)) {
			throw new ControllerDnxError($controller_name);
		} // if

		$controller = new $controller_class();
		if(!instance_of($controller, 'Controller')) {
			throw new ControllerDnxError($controller_name);
		} // if

		if (is_ajax_request()) {
			// if request is an ajax request return a json response
			
			// execute the action
			$controller->setAutoRender(false);
			$controller->execute($action);
			
			// fill the response
			$response = AjaxResponse::instance();
			if (!$response->hasCurrent()) {
				// set the current content
				$response->setCurrentContent("html", $controller->getContent(), page_actions(), ajx_get_panel());
			}
			$response->setEvents(evt_pop());
			$error = flash_pop('error');
			$success = flash_pop('success');
			if (!is_null($error)) {
				$response->setError(1, clean($error));
			} else if (!is_null($success)) {
				$response->setError(0, clean($success));
			}
			
			// display the object as json

			tpl_assign("object", $response);
			$content = tpl_fetch(Env::getTemplatePath("json"));
			tpl_assign("content_for_layout", $content);
			TimeIt::start("Transfer");
			if (is_iframe_request()) {
				tpl_display(Env::getLayoutPath("iframe"));
			} else {
				tpl_display(Env::getLayoutPath("json"));
			}
			TimeIt::stop();
		} else {
			return $controller->execute($action);
		}
	} // executeAction
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:66,代码来源:Env.class.php

示例2: getLayoutPath

 /**
  * Return path of the layout file.
  *
  * @param void
  * @return string
  * @throws FileDnxError
  */
 function getLayoutPath()
 {
     $layout_name = trim($this->getLayout()) == '' ? $this->getControllerName() : $this->getLayout();
     // Path of the layout
     $path = Env::getLayoutPath($layout_name);
     // File dnx? Throw exception
     if (!is_file($path)) {
         throw new FileDnxError($path);
     }
     // if
     // Return path
     return $path;
 }
开发者ID:469306621,项目名称:Languages,代码行数:20,代码来源:PageController.class.php

示例3: user_config_option

;
og.emailFilters = {};
og.emailFilters.classif = '<?php 
echo user_config_option('mails classification filter');
?>
';
og.emailFilters.read = '<?php 
echo user_config_option('mails read filter');
?>
';
og.emailFilters.account = '<?php 
echo user_config_option('mails account filter');
?>
';
if (og.emailFilters.account != 0 && og.emailFilters.account != '') {
	og.emailFilters.accountName = '<?php 
$acc_id = user_config_option('mails account filter');
$acc = $acc_id > 0 ? MailAccounts::findById($acc_id) : null;
echo $acc instanceof MailAccount ? mysql_real_escape_string($acc->getName()) : '';
?>
';
} else og.emailFilters.accountName = '';
og.lastSelectedRow = {messages:0, mails:0, contacts:0, documents:0, weblinks:0, overview:0, linkedobjs:0, archived:0};

</script>
<?php 
include_once Env::getLayoutPath("listeners");
?>
</body>
</html>
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:30,代码来源:website.php

示例4: function

			if(e && e.stopPropagation) {
				e.stopPropagation();
			} else {
				e = window.event;
				e.cancelBubble = true;
			}
		}
	}

	og.custom_properties_by_type = [];
	og.openLink(og.getUrl('object', 'get_cusotm_property_columns'), {
		callback: function(success, data){
			og.custom_properties_by_type = data.properties;
		}
	});
});

</script>
<?php include_once(Env::getLayoutPath("listeners"));?>

	<div id="quick-form" > 
            <div style="float: right; cursor: pointer;height: 12px;position: absolute;right: 19px;top: 2px;"><a href="#" onclick="$('.close').click();">close</a></div>
            <div class="close" style="float: right;"></div>
            <div class="form-container"></div>
	</div>
</body>
</html>

<?php Hook::fire('page_rendered', null, $ret); ?>

开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:29,代码来源:website.php

示例5: ajx_check_login

/**
 * Checks whether the user is logged in and if not returns an error response.
 *
 */
function ajx_check_login() {
	if (is_ajax_request() && !logged_user() instanceof Contact && (array_var($_GET, 'c') != 'access' || array_var($_GET, 'a') != 'relogin')) {
		// error, user not logged in => return error message
		$response = AjaxResponse::instance();
		$response->setCurrentContent("empty");
		$response->setError(SESSION_EXPIRED_ERROR_CODE, lang("session expired error"));
			
		// display the object as json
		tpl_assign("object", $response);
		$content = tpl_fetch(Env::getTemplatePath("json"));
		tpl_assign("content_for_layout", $content);
		tpl_display(Env::getLayoutPath("json"));
		exit();
	}
}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:19,代码来源:ajax.php

示例6: executeAction

 /**
  * Contruct controller and execute specific action
  *
  * @access public
  * @param string $controller_name
  * @param string $action
  * @return null
  */
 static function executeAction($controller_name, $action)
 {
     $max_users = config_option('max_users');
     if ($max_users && Users::count() > $max_users) {
         echo lang("error") . ": " . lang("maximum number of users exceeded error");
         return;
     }
     ajx_check_login();
     if (isset($_GET['active_project']) && logged_user() instanceof User) {
         $dont_update = false;
         if (GlobalCache::isAvailable()) {
             $option_value = GlobalCache::get('user_config_option_' . logged_user()->getId() . '_lastAccessedWorkspace', $success);
             if ($success) {
                 $dont_update = $option_value == $_GET['active_project'];
             }
         }
         if (!$dont_update) {
             set_user_config_option('lastAccessedWorkspace', $_GET['active_project'], logged_user()->getId());
             if (GlobalCache::isAvailable()) {
                 GlobalCache::update('user_config_option_' . logged_user()->getId() . '_lastAccessedWorkspace', $_GET['active_project']);
             }
         }
     }
     Env::useController($controller_name);
     $controller_class = Env::getControllerClass($controller_name);
     if (!class_exists($controller_class, false)) {
         throw new ControllerDnxError($controller_name);
     }
     // if
     $controller = new $controller_class();
     if (!instance_of($controller, 'Controller')) {
         throw new ControllerDnxError($controller_name);
     }
     // if
     if (is_ajax_request()) {
         // if request is an ajax request return a json response
         // execute the action
         $controller->setAutoRender(false);
         $controller->execute($action);
         // fill the response
         $response = AjaxResponse::instance();
         if (!$response->hasCurrent()) {
             // set the current content
             $response->setCurrentContent("html", $controller->getContent(), page_actions(), ajx_get_panel());
         }
         $response->setEvents(evt_pop());
         $error = flash_pop('error');
         $success = flash_pop('success');
         if (!is_null($error)) {
             $response->setError(1, clean($error));
         } else {
             if (!is_null($success)) {
                 $response->setError(0, clean($success));
             }
         }
         // display the object as json
         tpl_assign("object", $response);
         $content = tpl_fetch(Env::getTemplatePath("json"));
         tpl_assign("content_for_layout", $content);
         TimeIt::start("Transfer");
         if (is_iframe_request()) {
             tpl_display(Env::getLayoutPath("iframe"));
         } else {
             tpl_display(Env::getLayoutPath("json"));
         }
         TimeIt::stop();
     } else {
         return $controller->execute($action);
     }
 }
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:78,代码来源:Env.class.php


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