本文整理汇总了PHP中XenForo_Link::setHandlerInfoForGroup方法的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_Link::setHandlerInfoForGroup方法的具体用法?PHP XenForo_Link::setHandlerInfoForGroup怎么用?PHP XenForo_Link::setHandlerInfoForGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XenForo_Link
的用法示例。
在下文中一共展示了XenForo_Link::setHandlerInfoForGroup方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
/* @var $classModel ThemeHouse_Objects_Model_Class */
$classModel = XenForo_Model::create('ThemeHouse_Objects_Model_Class');
$classes = $classModel->getAllClasses();
if (self::$_dependencies instanceof XenForo_Dependencies_Public) {
$routes = self::$_data['routesPublic'];
} elseif (self::$_dependencies instanceof XenForo_Dependencies_Admin) {
$routes = self::$_data['routesAdmin'];
}
foreach ($classes as $class) {
$routePrefix = '';
if (self::$_dependencies instanceof XenForo_Dependencies_Public) {
$routePrefix = isset($class['route_prefix']) ? $class['route_prefix'] : '';
} elseif (self::$_dependencies instanceof XenForo_Dependencies_Admin) {
$routePrefix = isset($class['route_prefix_admin']) ? $class['route_prefix_admin'] : '';
}
if ($routePrefix && !isset($routes[$routePrefix])) {
$routes[$routePrefix]['build_link'] = 'all';
if (self::$_dependencies instanceof XenForo_Dependencies_Public) {
$routes[$routePrefix]['route_class'] = 'ThemeHouse_Objects_Route_Prefix_Objects';
} elseif (self::$_dependencies instanceof XenForo_Dependencies_Admin) {
$routes[$routePrefix]['route_class'] = 'ThemeHouse_Objects_Route_PrefixAdmin_Objects';
}
}
}
if (self::$_dependencies instanceof XenForo_Dependencies_Public) {
XenForo_Link::setHandlerInfoForGroup('public', $routes);
} elseif (self::$_dependencies instanceof XenForo_Dependencies_Admin) {
XenForo_Link::setHandlerInfoForGroup('admin', $routes);
}
parent::run();
}
示例2: _handleCustomPreloadedData
/**
* Handles the custom data that needs to be preloaded.
*
* @param array $data Data that was loaded. Unsuccessfully loaded items will have a value of null
*/
protected function _handleCustomPreloadedData(array &$data)
{
if (!is_array($data['routesAdmin'])) {
$data['routesAdmin'] = XenForo_Model::create('XenForo_Model_RoutePrefix')->rebuildRoutePrefixTypeCache('admin');
}
XenForo_Link::setHandlerInfoForGroup('admin', $data['routesAdmin']);
if (!is_array($data['adminStyleProperties'])) {
$data['adminStyleProperties'] = XenForo_Model::create('XenForo_Model_StyleProperty')->rebuildPropertyCacheInStyleAndChildren(-1);
}
XenForo_Application::set('adminStyleProperties', $data['adminStyleProperties']);
if (!is_int($data['adminStyleModifiedDate'])) {
$data['adminStyleModifiedDate'] = 0;
}
XenForo_Application::set('adminStyleModifiedDate', $data['adminStyleModifiedDate']);
if (!is_array($data['adminSearchTypes'])) {
try {
$data['adminSearchTypes'] = XenForo_Model::create('XenForo_Model_AdminSearch')->rebuildSearchTypesCache();
} catch (Exception $e) {
$data['adminSearchTypes'] = array();
}
}
XenForo_Application::set('adminSearchTypes', $data['adminSearchTypes']);
XenForo_Application::$allowManualDeferred = true;
XenForo_Application::$javaScriptUrl = 'js';
}
示例3: _setCustomRoutePrefixes
/**
* Internal method for doing the actual swapping/shifting of route prefixes.
*
* @param string $defaultRoutePrefix
* @param array $routesPublic
*/
protected static function _setCustomRoutePrefixes($defaultRoutePrefix, array $routesPublic)
{
$routesPublic['index'] = array('build_link' => 'all', 'route_class' => 'WidgetPortal_Route_PrefixPublic_Index');
$routesPublic['forum'] = array('build_link' => 'none', 'route_class' => 'WidgetPortal_Route_PrefixPublic_Forum');
$routesPublic[$defaultRoutePrefix]['build_link'] = 'all';
XenForo_Link::setHandlerInfoForGroup('public', $routesPublic);
XenForo_CodeEvent::addListener('load_class_route_prefix', array(__CLASS__, 'loadClassRoutePrefix'));
}
示例4: _handleCustomPreloadedData
/**
* Handles the custom data that needs to be preloaded.
*
* @param array $data Data that was loaded. Unsuccessfully loaded items will have a value of null
*/
protected function _handleCustomPreloadedData(array &$data)
{
if (!is_array($data['routesAdmin'])) {
$data['routesAdmin'] = XenForo_Model::create('XenForo_Model_RoutePrefix')->rebuildRoutePrefixTypeCache('admin');
}
XenForo_Link::setHandlerInfoForGroup('admin', $data['routesAdmin']);
if (!is_array($data['adminStyleProperties'])) {
$data['adminStyleProperties'] = XenForo_Model::create('XenForo_Model_StyleProperty')->rebuildPropertyCacheInStyleAndChildren(-1);
}
XenForo_Application::set('adminStyleProperties', $data['adminStyleProperties']);
if (!is_int($data['adminStyleModifiedDate'])) {
$data['adminStyleModifiedDate'] = 0;
}
XenForo_Application::set('adminStyleModifiedDate', $data['adminStyleModifiedDate']);
}
示例5: _handleCustomPreloadedData
/**
* Handles the custom data that needs to be preloaded.
*
* @param array $data Data that was loaded. Unsuccessfully loaded items will have a value of null
*/
protected function _handleCustomPreloadedData(array &$data)
{
if (!is_array($data['routesPublic'])) {
$data['routesPublic'] = XenForo_Model::create('XenForo_Model_RoutePrefix')->rebuildRoutePrefixTypeCache('public');
}
XenForo_Link::setHandlerInfoForGroup('public', $data['routesPublic']);
if (!is_array($data['bannedIps'])) {
$data['bannedIps'] = XenForo_Model::create('XenForo_Model_Banning')->rebuildBannedIpCache();
}
XenForo_Application::set('bannedIps', $data['bannedIps']);
if (!is_array($data['discouragedIps'])) {
$data['discouragedIps'] = XenForo_Model::create('XenForo_Model_Banning')->rebuildDiscouragedIpCache();
}
XenForo_Application::set('discouragedIps', $data['discouragedIps']);
if (!is_array($data['styles'])) {
$data['styles'] = XenForo_Model::create('XenForo_Model_Style')->rebuildStyleCache();
}
XenForo_Application::set('styles', $data['styles']);
if (!is_array($data['nodeTypes'])) {
$data['nodeTypes'] = XenForo_Model::create('XenForo_Model_Node')->rebuildNodeTypeCache();
}
XenForo_Application::set('nodeTypes', $data['nodeTypes']);
if (!is_array($data['smilies'])) {
$data['smilies'] = XenForo_Model::create('XenForo_Model_Smilie')->rebuildSmilieCache();
}
XenForo_Application::set('smilies', $data['smilies']);
if (!is_array($data['bbCode'])) {
$data['bbCode'] = XenForo_Model::create('XenForo_Model_BbCode')->rebuildBbCodeCache();
}
XenForo_Application::set('bbCode', $data['bbCode']);
if (!is_array($data['displayStyles'])) {
$data['displayStyles'] = XenForo_Model::create('XenForo_Model_UserGroup')->rebuildDisplayStyleCache();
}
XenForo_Application::set('displayStyles', $data['displayStyles']);
XenForo_Template_Helper_Core::setDisplayStyles($data['displayStyles']);
if (!is_array($data['trophyUserTitles'])) {
$data['trophyUserTitles'] = XenForo_Model::create('XenForo_Model_Trophy')->rebuildTrophyUserTitleCache();
}
XenForo_Application::set('trophyUserTitles', $data['trophyUserTitles']);
XenForo_Template_Helper_Core::setUserTitles($data['trophyUserTitles']);
if (is_array($data['reportCounts'])) {
XenForo_Application::set('reportCounts', $data['reportCounts']);
}
if (is_array($data['moderationCounts'])) {
XenForo_Application::set('moderationCounts', $data['moderationCounts']);
}
}
示例6: run
//.........这里部分代码省略.........
}
return parent::get($field, $tableName);
}
public function set($field, $value, $tableName = \'\', array $options = null)
{
$fields = $this->_getObjectFieldDefinitions();
if (isset($fields[$field]) && !$this->getExtraData(\'forceSet\'))
{
$this->_objectCustomFields[$field] = $value;
return true;
}
return parent::set($field, $value, $tableName, $options);
}
public function preSave()
{
$this->setCustomFields($this->_objectCustomFields);
parent::preSave();
}
}');
} else {
eval('class ThemeHouse_' . $class['addon_id'] . '_DataWriter_' . $className . ' extends ThemeHouse_ObjectFields_Extend_ThemeHouse_Objects_DataWriter_Object
{
protected $_objectCustomFields = array();
public function __construct($errorHandler = self::ERROR_ARRAY, array $inject = null)
{
parent::__construct($errorHandler, $inject);
$this->setExtraData(\'forceSet\', true);
$this->set(\'class_id\', \'' . $classId . '\');
$this->setExtraData(\'forceSet\', false);
}
protected function _getFields()
{
$fields = parent::_getFields();
$fields[\'xf_object\'][\'class_id\'] = array(\'type\' => self::TYPE_STRING, \'default\' => \'' . $classId . '\');
return $fields;
}
public function get($field, $tableName = "")
{
if ($field != "custom_fields")
{
$customFields = $this->get("custom_fields");
if ($customFields)
{
$customFields = unserialize($customFields);
$fields = $this->_getObjectFieldDefinitions();
if (isset($fields[$field]))
{
if (isset($this->_objectCustomFields[$field]))
{
return $this->_objectCustomFields[$field];
}
else if (isset($customFields[$field]))
{
return $customFields[$field];
}
}
}
}
return parent::get($field, $tableName);
}
public function set($field, $value, $tableName = \'\', array $options = null)
{
$fields = $this->_getObjectFieldDefinitions();
if (isset($fields[$field]) && !$this->getExtraData(\'forceSet\'))
{
$this->_objectCustomFields[$field] = $value;
return true;
}
return parent::set($field, $value, $tableName, $options);
}
public function preSave()
{
$this->setCustomFields($this->_objectCustomFields);
parent::preSave();
}
}');
}
$routePrefix = str_replace("_", "-", $classId) . 's';
if (isset($routesPublic) && !isset($routesPublic[$routePrefix])) {
$routesPublic[$routePrefix] = array('build_link' => 'all', 'route_class' => 'ThemeHouse_Objects_Route_Prefix_Objects');
}
}
if (isset($routesPublic)) {
XenForo_Link::setHandlerInfoForGroup('public', $routesPublic);
}
}
$cacheRebuilders = array('CustomFields' => 'ThemeHouse_ObjectFields_CacheRebuilder_CustomFields');
$this->addCacheRebuilders($cacheRebuilders);
}
示例7: _setupForXenForo1_1_x
protected static function _setupForXenForo1_1_x()
{
self::$_setup11x = true;
if (XenForo_Application::$versionId < 1020000) {
// dirty trick to get the public routes
$className = 'a' . md5(uniqid());
eval(sprintf('class %s extends XenForo_Link{
public static function getHandlerInfoForGroup($group){
if (empty(XenForo_Link::$_handlerCache[$group]))return false;
return XenForo_Link::$_handlerCache[$group];}}', $className));
$routesPublic = call_user_func(array($className, 'getHandlerInfoForGroup'), 'public');
} else {
$routesPublic = XenForo_Link::getHandlerInfoForGroup('public');
}
if (!empty($routesPublic)) {
foreach ($routesPublic as $routePrefix => &$handlerInfo) {
if ($routePrefix === 'index') {
$handlerInfo['build_link'] = 'all';
}
}
XenForo_Link::setHandlerInfoForGroup('public', $routesPublic);
}
}
示例8: _handleCustomPreloadedData
/**
* Handles the custom data that needs to be preloaded.
*
* @param array $data Data that was loaded. Unsuccessfully loaded items will have a value of null
*/
protected function _handleCustomPreloadedData(array &$data)
{
if (!is_array($data['routesPublic'])) {
$data['routesPublic'] = XenForo_Model::create('XenForo_Model_RoutePrefix')->rebuildRoutePrefixTypeCache('public');
}
XenForo_Link::setHandlerInfoForGroup('public', $data['routesPublic']);
if (!is_array($data['bannedIps']) || !isset($data['bannedIps']['version'])) {
$data['bannedIps'] = XenForo_Model::create('XenForo_Model_Banning')->rebuildBannedIpCache();
}
XenForo_Application::set('bannedIps', $data['bannedIps']);
if (!is_array($data['discouragedIps']) || !isset($data['discouragedIps']['version'])) {
$data['discouragedIps'] = XenForo_Model::create('XenForo_Model_Banning')->rebuildDiscouragedIpCache();
}
XenForo_Application::set('discouragedIps', $data['discouragedIps']);
if (!is_array($data['styles'])) {
$data['styles'] = XenForo_Model::create('XenForo_Model_Style')->rebuildStyleCache();
}
XenForo_Application::set('styles', $data['styles']);
if (!is_array($data['nodeTypes'])) {
$data['nodeTypes'] = XenForo_Model::create('XenForo_Model_Node')->rebuildNodeTypeCache();
}
XenForo_Application::set('nodeTypes', $data['nodeTypes']);
if (!is_array($data['smilies'])) {
$data['smilies'] = XenForo_Model::create('XenForo_Model_Smilie')->rebuildSmilieCache();
}
XenForo_Application::set('smilies', $data['smilies']);
if (!is_array($data['bbCode'])) {
$data['bbCode'] = XenForo_Model::create('XenForo_Model_BbCode')->rebuildBbCodeCache();
}
XenForo_Application::set('bbCode', $data['bbCode']);
if (!is_array($data['threadPrefixes'])) {
$data['threadPrefixes'] = XenForo_Model::create('XenForo_Model_ThreadPrefix')->rebuildPrefixCache();
}
XenForo_Application::set('threadPrefixes', $data['threadPrefixes']);
XenForo_Template_Helper_Core::setThreadPrefixes($data['threadPrefixes']);
if (!is_array($data['displayStyles'])) {
$data['displayStyles'] = XenForo_Model::create('XenForo_Model_UserGroup')->rebuildDisplayStyleCache();
}
XenForo_Application::set('displayStyles', $data['displayStyles']);
XenForo_Template_Helper_Core::setDisplayStyles($data['displayStyles']);
if (!is_array($data['userBanners'])) {
$data['userBanners'] = XenForo_Model::create('XenForo_Model_UserGroup')->rebuildUserBannerCache();
}
XenForo_Application::set('userBanners', $data['userBanners']);
XenForo_Template_Helper_Core::setUserBanners($data['userBanners']);
if (!is_array($data['userTitleLadder'])) {
$data['userTitleLadder'] = XenForo_Model::create('XenForo_Model_UserTitleLadder')->rebuildUserTitleLadderCache();
}
XenForo_Application::set('userTitleLadder', $data['userTitleLadder']);
XenForo_Template_Helper_Core::setUserTitles($data['userTitleLadder'], XenForo_Application::getOptions()->userTitleLadderField);
if (!is_array($data['notices'])) {
$data['notices'] = XenForo_Model::create('XenForo_Model_Notice')->rebuildNoticeCache();
}
XenForo_Application::set('notices', $data['notices']);
if (!is_array($data['userFieldsInfo'])) {
$data['userFieldsInfo'] = XenForo_Model::create('XenForo_Model_UserField')->rebuildUserFieldCache();
}
XenForo_Application::set('userFieldsInfo', $data['userFieldsInfo']);
if (is_array($data['reportCounts'])) {
XenForo_Application::set('reportCounts', $data['reportCounts']);
}
if (is_array($data['moderationCounts'])) {
XenForo_Application::set('moderationCounts', $data['moderationCounts']);
}
if (is_array($data['userModerationCounts'])) {
XenForo_Application::set('userModerationCounts', $data['userModerationCounts']);
}
}