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


PHP BackendModel::getModuleSettings方法代码示例

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


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

示例1: loadData

 /**
  * Get the data
  */
 private function loadData()
 {
     $this->record = (array) BackendLocationModel::get($this->id);
     // no item found, throw an exceptions, because somebody is fucking with our URL
     if (empty($this->record)) {
         $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing');
     }
     $this->settings = BackendLocationModel::getMapSettings($this->id);
     // load the settings from the general settings
     if (empty($this->settings)) {
         $settings = BackendModel::getModuleSettings();
         $settings = $settings['location'];
         $this->settings['width'] = $settings['width_widget'];
         $this->settings['height'] = $settings['height_widget'];
         $this->settings['map_type'] = $settings['map_type_widget'];
         $this->settings['zoom_level'] = $settings['zoom_level_widget'];
         $this->settings['center']['lat'] = $this->record['lat'];
         $this->settings['center']['lng'] = $this->record['lng'];
     }
     // no center point given yet, use the first occurance
     if (!isset($this->settings['center'])) {
         $this->settings['center']['lat'] = $this->record['lat'];
         $this->settings['center']['lng'] = $this->record['lng'];
     }
     $this->settings['full_url'] = isset($this->settings['full_url']) ? $this->settings['full_url'] : false;
     $this->settings['directions'] = isset($this->settings['directions']) ? $this->settings['directions'] : false;
 }
开发者ID:nickmancol,项目名称:forkcms-rhcloud,代码行数:30,代码来源:edit.php

示例2: parse

 /**
  * Parse the datagrid
  */
 protected function parse()
 {
     parent::parse();
     $this->tpl->assign('dataGrid', $this->dataGrid->getNumResults() != 0 ? $this->dataGrid->getContent() : false);
     // get settings
     $settings = BackendModel::getModuleSettings();
     // assign to template
     $this->tpl->assign('items', BackendLocationModel::getAll());
     $this->tpl->assign('settings', $settings['location']);
 }
开发者ID:naujasdizainas,项目名称:forkcms,代码行数:13,代码来源:index.php

示例3: parse

 /**
  * Parse the form
  */
 protected function parse()
 {
     parent::parse();
     $settings = BackendModel::getModuleSettings();
     // assign to template
     $this->tpl->assign('item', $this->record);
     $this->tpl->assign('settings', $settings['location']);
     // assign message if address was not be geocoded
     if ($this->record['lat'] == null || $this->record['lng'] == null) {
         $this->tpl->assign('errorMessage', BL::err('AddressCouldNotBeGeocoded'));
     }
 }
开发者ID:richsage,项目名称:forkcms,代码行数:15,代码来源:edit.php

示例4: execute

 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     $generalSettings = BackendModel::getModuleSettings();
     $generalSettings = $generalSettings['location'];
     // get parameters
     $itemId = SpoonFilter::getPostValue('id', null, null, 'int');
     $zoomLevel = trim(SpoonFilter::getPostValue('zoom', null, 'auto'));
     $mapType = strtoupper(trim(SpoonFilter::getPostValue('type', array('roadmap', 'satelitte', 'hybrid', 'terrain'), 'roadmap')));
     $centerLat = SpoonFilter::getPostValue('centerLat', null, 1, 'float');
     $centerlng = SpoonFilter::getPostValue('centerLng', null, 1, 'float');
     $height = SpoonFilter::getPostValue('height', null, $generalSettings['height'], 'int');
     $width = SpoonFilter::getPostValue('width', null, $generalSettings['width'], 'int');
     $showLink = SpoonFilter::getPostValue('link', array('true', 'false'), 'false', 'string');
     $showDirections = SpoonFilter::getPostValue('directions', array('true', 'false'), 'false', 'string');
     $showOverview = SpoonFilter::getPostValue('showOverview', array('true', 'false'), 'true', 'string');
     // reformat
     $center = array('lat' => $centerLat, 'lng' => $centerlng);
     $showLink = $showLink == 'true';
     $showDirections = $showDirections == 'true';
     $showOverview = $showOverview == 'true';
     // standard dimensions
     if ($width > 800) {
         $width = 800;
     }
     if ($width < 300) {
         $width = $generalSettings['width'];
     }
     if ($height < 150) {
         $height = $generalSettings['height'];
     }
     // no id given, this means we should update the main map
     BackendLocationModel::setMapSetting($itemId, 'zoom_level', (string) $zoomLevel);
     BackendLocationModel::setMapSetting($itemId, 'map_type', (string) $mapType);
     BackendLocationModel::setMapSetting($itemId, 'center', (array) $center);
     BackendLocationModel::setMapSetting($itemId, 'height', (int) $height);
     BackendLocationModel::setMapSetting($itemId, 'width', (int) $width);
     BackendLocationModel::setMapSetting($itemId, 'directions', $showDirections);
     BackendLocationModel::setMapSetting($itemId, 'full_url', $showLink);
     $item = array('id' => $itemId, 'language' => BL::getWorkingLanguage(), 'show_overview' => $showOverview ? 'Y' : 'N');
     BackendLocationModel::update($item);
     // output
     $this->output(self::OK, null, FL::msg('Success'));
 }
开发者ID:nickmancol,项目名称:forkcms-rhcloud,代码行数:47,代码来源:save_live_location.php

示例5: loadData

 /**
  * Load the settings
  */
 protected function loadData()
 {
     $this->items = BackendLocationModel::getAll();
     $this->settings = BackendLocationModel::getMapSettings(0);
     $firstMarker = current($this->items);
     // if there are no markers we reset it to the birthplace of Fork
     if ($firstMarker === false) {
         $firstMarker = array('lat' => '51.052146', 'lng' => '3.720491');
     }
     // load the settings from the general settings
     if (empty($this->settings)) {
         $settings = BackendModel::getModuleSettings();
         $this->settings = $settings['location'];
         $this->settings['center']['lat'] = $firstMarker['lat'];
         $this->settings['center']['lng'] = $firstMarker['lng'];
     }
     // no center point given yet, use the first occurance
     if (!isset($this->settings['center'])) {
         $this->settings['center']['lat'] = $firstMarker['lat'];
         $this->settings['center']['lng'] = $firstMarker['lng'];
     }
 }
开发者ID:nickmancol,项目名称:forkcms-rhcloud,代码行数:25,代码来源:index.php

示例6: getData

 /**
  * Get all necessary data
  *
  * @return	void
  */
 private function getData()
 {
     // fetch the mailmotor settings
     $settings = BackendModel::getModuleSettings();
     // store mailmotor settings
     $this->settings = $settings['mailmotor'];
     // check if an account was linked already and/or client ID was set
     $this->accountLinked = BackendMailmotorCMHelper::checkAccount();
     $this->clientID = BackendMailmotorCMHelper::getClientID();
 }
开发者ID:netconstructor,项目名称:forkcms,代码行数:15,代码来源:settings.php


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