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


PHP Application_Model_Option::getIconUrl方法代码示例

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


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

示例1: findallAction

 public function findallAction()
 {
     $option_values = $this->getApplication()->getPages(10);
     $data = array('pages' => array());
     $color = $this->getApplication()->getBlock('tabbar')->getImageColor();
     $background_color = $this->getApplication()->getBlock('tabbar')->getBackgroundColor();
     foreach ($option_values as $option_value) {
         $data['pages'][] = array('value_id' => $option_value->getId(), 'id' => intval($option_value->getId()), 'code' => $option_value->getCode(), 'name' => $option_value->getTabbarName(), 'is_active' => $option_value->isActive(), 'url' => $option_value->getUrl(null, array('value_id' => $option_value->getId()), false), 'path' => $option_value->getPath(null, array('value_id' => $option_value->getId()), false), 'icon_url' => $this->_getColorizedImage($option_value->getIconId(), $color), 'icon_is_colorable' => $option_value->getImage()->getCanBeColorized(), 'is_locked' => $option_value->isLocked(), 'is_link' => !$option_value->getIsAjax(), 'position' => $option_value->getPosition());
     }
     $option = new Application_Model_Option();
     $option->findTabbarMore();
     $data['more_items'] = array('code' => $option->getCode(), 'name' => $option->getTabbarName(), 'is_active' => $option->isActive(), 'url' => "", 'icon_url' => $this->_getColorizedImage($option->getIconUrl(), $color), 'icon_is_colorable' => 1);
     $option = new Application_Model_Option();
     $option->findTabbarAccount();
     $data['customer_account'] = array('code' => $option->getCode(), 'name' => $option->getTabbarName(), 'is_active' => $option->isActive(), 'url' => $this->getUrl("customer/mobile_account_login"), 'path' => $this->getPath("customer/mobile_account_login"), 'login_url' => $this->getUrl("customer/mobile_account_login"), 'login_path' => $this->getPath("customer/mobile_account_login"), 'edit_url' => $this->getUrl("customer/mobile_account_edit"), 'edit_path' => $this->getPath("customer/mobile_account_edit"), 'icon_url' => $this->_getColorizedImage($option->getIconUrl(), $color), 'icon_is_colorable' => 1, 'is_visible' => $this->getApplication()->usesUserAccount());
     $layout = new Application_Model_Layout_Homepage();
     $layout->find($this->getApplication()->getLayoutId());
     $data['layout'] = array("layout_id" => "l{$this->getApplication()->getLayoutId()}", "visibility" => $this->getApplication()->getLayoutVisibility(), "use_horizontal_scroll" => (int) $layout->getUseHorizontalScroll(), "position" => $layout->getPosition());
     $data['limit_to'] = $this->getApplication()->getLayout()->getNumberOfDisplayedIcons();
     $data['layout_id'] = 'l' . $this->getApplication()->getLayoutId();
     $data['tabbar_is_transparent'] = $background_color == "transparent";
     $data['homepage_slider_is_visible'] = (bool) $this->getApplication()->getHomepageSliderIsVisible();
     $data['homepage_slider_duration'] = $this->getApplication()->getHomepageSliderDuration();
     $data['homepage_slider_loop_at_beginning'] = (bool) $this->getApplication()->getHomepageSliderLoopAtBeginning();
     $homepage_slider_images = array();
     $slider_images = $this->getApplication()->getSliderImages();
     foreach ($slider_images as $slider_image) {
         $homepage_slider_images[] = $slider_image->getLink();
     }
     $data['homepage_slider_images'] = $homepage_slider_images;
     $this->_sendHtml($data);
 }
开发者ID:bklein01,项目名称:siberian_cms_2,代码行数:32,代码来源:HomeController.php

示例2: findaccessAction

 public function findaccessAction()
 {
     if ($data = Zend_Json::decode($this->getRequest()->getRawBody())) {
         try {
             if (empty($data["admin_id"]) or empty($data["app_id"])) {
                 throw new Exception($this->_("An error occurred while saving. Please try again later."));
             }
             $admin = new Admin_Model_Admin();
             $admin->find($data["admin_id"]);
             $app = new Application_Model_Application();
             $app->find($data["app_id"]);
             $app_acl_option = new Application_Model_Acl_Option();
             $forbidden_options = $app_acl_option->findAllByAppId($data["app_id"], $data["admin_id"]);
             $option_tmp = array();
             foreach ($forbidden_options as $option) {
                 $option_tmp[] = $option->getValueId();
             }
             $forbidden_options = $option_tmp;
             $data = array("app_name" => $app->getName(), "user_name" => $admin->getData("firstname") . " " . $admin->getData("lastname"), "can_add_page" => $admin->isAllowedToAddPages($data["app_id"]), "options" => array());
             foreach ($app->getOptions() as $option) {
                 $option_is_allowed = !in_array($option->getValueId(), $forbidden_options);
                 $option_obj = new Application_Model_Option();
                 $option_obj->find($option->getOptionId());
                 if ($option_obj->getId()) {
                     $icon_url = $option_obj->getIconUrl();
                 } else {
                     $icon_url = null;
                 }
                 $data["options"][] = array("value_id" => $option->getValueId(), "icon_url" => $icon_url, "name" => $option->getTabbarName() ? $option->getTabbarName() : $option->getName(), "code" => $option->getCode(), "is_allowed" => $option_is_allowed);
             }
         } catch (Exception $e) {
             $data = array("error" => 1, "message" => $e->getMessage());
         }
         $this->_sendHtml($data);
     }
 }
开发者ID:bklein01,项目名称:siberian_cms_2,代码行数:36,代码来源:AclController.php

示例3: deleteAction

 public function deleteAction()
 {
     if ($datas = $this->getRequest()->getPost()) {
         try {
             if (empty($datas['value_id'])) {
                 throw new Exception($this->_('An error occurred while deleting the option'));
             }
             // Récupère les données de l'application pour cette option
             $option_value = new Application_Model_Option_Value();
             $option_value->find($datas['value_id']);
             // Option folder
             if (isset($datas['category_id'])) {
                 // Récupère l'option_value en cours
                 $category_option_value = new Application_Model_Option_Value();
                 $category_option_value->find($datas['value_id']);
                 $category_option_value->setFolderCategoryId(null)->setFolderCategoryPosition(null)->save();
                 foreach (Core_View_Default::getBlocks() as $block) {
                     if ($block->getCode() == 'area') {
                         $colorized_block = $block;
                     }
                 }
                 $icon_url = $category_option_value->getImage()->getCanBeColorized() ? Siberian_View::getColorizedImage($category_option_value->getIconId(), $colorized_block->getColor()) : $category_option_value->getIconUrl();
                 $html['folder'] = array('id' => $category_option_value->getId(), 'name' => $category_option_value->getShortTabbarName(), 'icon_url' => $icon_url, 'value_id' => $datas['value_id'], 'category_id' => $datas['category_id']);
             } else {
                 // Récupère l'id
                 $id = $option_value->getId();
                 // Récupère l'option
                 $option = new Application_Model_Option();
                 $option->find($option_value->getOptionId());
                 $option_folder = new Application_Model_Option();
                 $option_folder->find(array('code' => 'folder'));
                 $was_folder = 0;
                 //Folder, supprime les cat id des options
                 if ($option_value->getOptionId() == $option_folder->getOptionId()) {
                     $folder = new Folder_Model_Folder();
                     $folder->find($id, 'value_id');
                     $root_category = new Folder_Model_Category();
                     $root_category->find($folder->getRootCategoryId());
                     $categories_options = $root_category->deleteChildren($folder->getRootCategoryId());
                     $category_option = new Application_Model_Option_Value();
                     $option_values = $category_option->findAll(array('folder_category_id' => $folder->getRootCategoryId()));
                     $categories_options[$folder->getRootCategoryId()] = array();
                     foreach ($option_values as $ov) {
                         $ov->setFolderCategoryId(null)->setFolderCategoryPosition(null)->save();
                         $categories_options[$folder->getRootCategoryId()][] = $ov->getValueId();
                     }
                     $folder->delete();
                     $was_folder = 1;
                 }
                 // Supprime l'option de l'application
                 $option_value->delete();
                 // Renvoi le nouveau code HTML
                 $this->getLayout()->setBaseRender('content', 'application/customization/page/list.phtml', 'admin_view_default');
                 $html = array('success' => 1, 'option_id' => $id, 'use_user_account' => $this->getApplication()->usesUserAccount());
                 if ($option->onlyOnce()) {
                     $html['page'] = array('id' => $option->getId(), 'name' => $option->getName(), 'icon_url' => $option->getIconUrl());
                 }
                 if ($was_folder == 1) {
                     $html['was_folder'] = 1;
                     $html['categories_options'] = $categories_options;
                 }
             }
         } catch (Exception $e) {
             $html = array('message' => $this->_('An error occurred while deleting the option'), 'message_button' => 1, 'message_loader' => 1);
         }
         $this->getLayout()->setHtml(Zend_Json::encode($html));
     }
 }
开发者ID:BeamlabsTigre,项目名称:Webapp,代码行数:68,代码来源:FeaturesController.php

示例4: deleteAction

 public function deleteAction()
 {
     if ($datas = $this->getRequest()->getPost()) {
         try {
             if (empty($datas['value_id'])) {
                 throw new Exception($this->_('An error occurred while deleting the option'));
             }
             // Récupère les données de l'application pour cette option
             $option_value = new Application_Model_Option_Value();
             $option_value->find($datas['value_id']);
             $app_id = $this->getApplication()->getId();
             if (!$option_value->getId() or $option_value->getAppId() != $app_id) {
                 throw new Exception($this->_('An error occurred while deleting the option'));
             }
             $html = array('success' => 1, 'value_id' => $datas['value_id'], 'path' => $option_value->getPath(null, array(), "mobile"), 'was_folder' => false, 'was_category' => false, 'was_feature' => false);
             // Option folder
             if (isset($datas['category_id'])) {
                 $option_value->setFolderId(null)->setFolderCategoryId(null)->setFolderCategoryPosition(null)->save();
                 $html['was_category'] = true;
                 $html['category'] = array('id' => $datas['category_id']);
             } else {
                 // Récupère l'option
                 $option = new Application_Model_Option();
                 $option->find($option_value->getOptionId());
                 $html['was_feature'] = true;
                 $html['use_user_account'] = $this->getApplication()->usesUserAccount();
                 if ($option_value->getCode() == "folder") {
                     $html['was_folder'] = true;
                 }
                 // Supprime l'option de l'application
                 $option_value->delete();
                 if ($option->onlyOnce()) {
                     $html['page'] = array('id' => $option->getId(), 'name' => $option->getName(), 'icon_url' => $option->getIconUrl(), 'category_id' => $option->getCategoryId());
                 }
                 // Renvoi le nouveau code HTML
                 //                    $this->getLayout()->setBaseRender('content', 'application/customization/page/list.phtml', 'admin_view_default');
             }
         } catch (Exception $e) {
             $html = array('message' => $this->_('An error occurred while deleting the option'), 'message_button' => 1, 'message_loader' => 1);
         }
         $this->_sendHtml($html);
     }
 }
开发者ID:bklein01,项目名称:siberian_cms_2,代码行数:43,代码来源:FeaturesController.php


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