Exemplo n.º 1
0
 public function changelayoutAction()
 {
     if ($datas = $this->getRequest()->getPost()) {
         try {
             $html = array();
             if (empty($datas['layout_id'])) {
                 throw new Exception($this->_('An error occurred while changing your layout.'));
             }
             $layout = new Application_Model_Layout_Homepage();
             $layout->find($datas['layout_id']);
             if (!$layout->getId()) {
                 throw new Exception($this->_('An error occurred while changing your layout.'));
             }
             $html = array('success' => 1);
             if ($layout->getId() != $this->getApplication()->getLayoutId()) {
                 $this->getApplication()->setLayoutId($datas['layout_id'])->save();
                 $html['reload'] = 1;
             }
         } catch (Exception $e) {
             //                $html = array('message' => 'Une erreur est survenue lors de la sauvegarde, merci de réessayer ultérieurement');
             $html = array('message' => $e->getMessage(), 'message_button' => 1, 'message_loader' => 1);
         }
         $this->getLayout()->setHtml(Zend_Json::encode($html));
     }
 }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 public function changelayoutvisibilityAction()
 {
     if ($datas = $this->getRequest()->getPost()) {
         try {
             if (empty($datas['layout_id'])) {
                 throw new Exception($this->_('An error occurred while changing your layout.'));
             }
             $layout = new Application_Model_Layout_Homepage();
             $layout->find($datas['layout_id']);
             if (!$layout->getId()) {
                 throw new Exception($this->_('An error occurred while changing your layout.'));
             }
             $html = array();
             if ($layout->getId() == $this->getApplication()->getLayoutId()) {
                 $html["success"] = 1;
                 $visibility = $layout->getVisibility();
                 if ($layout->getVisibility() == Application_Model_Layout_Homepage::VISIBILITY_ALWAYS) {
                     $visibility = !empty($datas["layout_is_visible_in_all_the_pages"]) ? Application_Model_Layout_Homepage::VISIBILITY_ALWAYS : Application_Model_Layout_Homepage::VISIBILITY_HOMEPAGE;
                 }
                 $this->getApplication()->setLayoutId($datas['layout_id'])->setLayoutVisibility($visibility)->save();
                 $html['reload'] = 1;
                 $html["display_layout_options"] = $layout->getVisibility() == Application_Model_Layout_Homepage::VISIBILITY_ALWAYS;
                 $html["layout_id"] = $layout->getId();
                 $html["layout_visibility"] = $this->getApplication()->getLayoutVisibility();
             }
         } catch (Exception $e) {
             $html = array('message' => $e->getMessage(), 'message_button' => 1, 'message_loader' => 1);
         }
         $this->getLayout()->setHtml(Zend_Json::encode($html));
     }
 }
$this->query("\n\n    CREATE TABLE `application_option` (\n        `option_id` int(11) unsigned NOT NULL AUTO_INCREMENT,\n        `category_id` INT(11) UNSIGNED NOT NULL,\n        `library_id` int(11) unsigned NOT NULL,\n        `icon_id` int(11) NOT NULL,\n        `code` varchar(20) NOT NULL,\n        `name` varchar(25) NOT NULL,\n        `model` varchar(100) NOT NULL,\n        `desktop_uri` varchar(100) NOT NULL,\n        `mobile_uri` varchar(100) NOT NULL,\n        `mobile_view_uri` varchar(100) NULL DEFAULT NULL,\n        `mobile_view_uri_parameter` varchar(100) NULL DEFAULT NULL,\n        `only_once` tinyint(1) NOT NULL DEFAULT '0',\n        `is_ajax` tinyint(1) NOT NULL DEFAULT '1',\n        `position` tinyint(1) unsigned NOT NULL DEFAULT '0',\n        `social_sharing_is_available` TINYINT(1) NOT NULL DEFAULT 0,\n        PRIMARY KEY (`option_id`),\n        KEY `KEY_LIBRARY_ID` (`library_id`)\n    ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;\n\n");
$this->query("\n    CREATE TABLE `application_option_value` (\n        `value_id` int(11) unsigned NOT NULL AUTO_INCREMENT,\n        `app_id` INT(11) UNSIGNED NOT NULL,\n        `option_id` int(11) unsigned NOT NULL,\n        `layout_id` int(11) unsigned NOT NULL DEFAULT '1',\n        `icon_id` int(11) DEFAULT NULL,\n        `folder_id` int(11) unsigned DEFAULT NULL,\n        `folder_category_id` int(11) unsigned DEFAULT NULL,\n        `folder_category_position` int(11) unsigned DEFAULT NULL,\n        `tabbar_name` varchar(30) DEFAULT NULL,\n        `icon` varchar(255) DEFAULT NULL,\n        `background_image` varchar(255) DEFAULT NULL,\n        `is_visible` tinyint(1) NOT NULL DEFAULT '1',\n        `position` tinyint(1) unsigned NOT NULL DEFAULT '0',\n        `is_active` tinyint(1) unsigned NOT NULL DEFAULT '0',\n        `social_sharing_is_active` TINYINT(1) UNSIGNED NOT NULL DEFAULT 1,\n        PRIMARY KEY (`value_id`),\n        KEY `KEY_APP_ID` (`app_id`),\n        KEY `KEY_OPTION_ID` (`option_id`)\n    ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;\n");
$this->query("\n    CREATE TABLE IF NOT EXISTS `application_admin` (\n        `app_id` INT(11) UNSIGNED NOT NULL,\n        `admin_id` INT(11) UNSIGNED NOT NULL,\n        `is_allowed_to_add_pages` TINYINT(1) NOT NULL DEFAULT 1,\n        PRIMARY KEY (`app_id`,`admin_id`),\n        KEY `sign_id_idxfk` (`admin_id`)\n    ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;\n");
$this->query("\n    CREATE TABLE `application_device` (\n        `device_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,\n        `app_id` INT(11) UNSIGNED NOT NULL,\n        `type_id` TINYINT(11) UNSIGNED NOT NULL,\n        `status_id` TINYINT(11) UNSIGNED NULL DEFAULT 1,\n        `admob_id` VARCHAR(50) NULL DEFAULT NULL,\n        `admob_type` enum('banner','interstitial') NOT NULL DEFAULT 'banner',\n        `version` VARCHAR(10) NOT NULL DEFAULT '0.0.1',\n        `developer_account_username` VARCHAR(255) NULL DEFAULT NULL,\n        `developer_account_password` VARCHAR(255) NULL DEFAULT NULL,\n        `use_our_developer_account` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,\n        `store_url` VARCHAR(255) NULL DEFAULT NULL,\n        `store_pass` VARCHAR(10) NULL DEFAULT NULL,\n        `store_app_id` VARCHAR(150) NULL DEFAULT NULL,\n        `banner_store_label` VARCHAR(150) NULL DEFAULT NULL,\n        `banner_store_price` VARCHAR(150) NULL DEFAULT NULL,\n        `key_pass` VARCHAR(10) NULL DEFAULT NULL,\n        `alias` VARCHAR(50) NULL DEFAULT NULL,\n        PRIMARY KEY (`device_id`),\n        KEY `KEY_APP_ID` (`app_id`)\n    ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;\n");
$this->query("\n    CREATE TABLE `application_option_layout` (\n        `layout_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,\n        `code` TINYINT(1) UNSIGNED NOT NULL DEFAULT 1,\n        `option_id` INT(11) UNSIGNED NOT NULL,\n        `name` VARCHAR(50) NOT NULL,\n        `preview` VARCHAR(255) NOT NULL,\n        `position` TINYINT(1) NOT NULL DEFAULT 1,\n        PRIMARY KEY (`layout_id`)\n    ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;\n");
$this->query("\n    CREATE TABLE `application_tc` (\n        `tc_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,\n        `app_id` INT(11) UNSIGNED NOT NULL,\n        `type` VARCHAR(50) NOT NULL,\n        `text` LONGTEXT NULL DEFAULT NULL,\n        `created_at` datetime NOT NULL,\n        `updated_at` datetime NOT NULL,\n        PRIMARY KEY (`tc_id`),\n        INDEX `IDX_TC_APPLICATION_APP_ID` (`app_id`),\n        UNIQUE `UNIQUE_TC_APPLICATION_APP_ID_TYPE` (`app_id`, `type`)\n    ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;\n");
$this->query("\n    CREATE TABLE `application_acl_option` (\n        `application_acl_option_id` int(11) unsigned NOT NULL AUTO_INCREMENT,\n        `app_id` int(11) unsigned NOT NULL,\n        `admin_id` int(11) unsigned NOT NULL,\n        `value_id` int(11) unsigned NOT NULL,\n        `resource_code` varchar(50) COLLATE utf8_unicode_ci NOT NULL,\n        PRIMARY KEY (`application_acl_option_id`),\n        KEY value_id (`value_id`)\n    ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;\n");
$this->query("\n    CREATE TABLE `application_option_category` (\n        `category_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,\n        `code` VARCHAR(50) NOT NULL DEFAULT 1,\n        `name` VARCHAR(50) NOT NULL,\n        `icon` VARCHAR(255) NOT NULL,\n        `position` TINYINT(1) NOT NULL DEFAULT 1,\n        `created_at` datetime NOT NULL,\n        `updated_at` datetime NOT NULL,\n        PRIMARY KEY (`category_id`)\n    ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;\n");
$this->query("\n    ALTER TABLE application_acl_option\n        ADD CONSTRAINT FK_APPLICATION_ACL_OPTION_VALUE_ID\n            FOREIGN KEY (value_id) REFERENCES application_option_value (value_id) ON DELETE CASCADE ON UPDATE CASCADE;\n");
$this->query("ALTER TABLE `application` ADD `key` VARCHAR(20) NOT NULL AFTER `bundle_id`;");
$this->query("ALTER TABLE `application` ADD UNIQUE `UNIQUE_APPLICATION_KEY` (`key`);");
$this->query("\n    ALTER TABLE `application_option_value`\n        ADD FOREIGN KEY (`app_id`) REFERENCES `application` (`app_id`) ON DELETE CASCADE ON UPDATE CASCADE;\n");
$this->query("\n    ALTER TABLE `application_option_value`\n        ADD FOREIGN KEY `FK_OPTION_ID` (`option_id`) REFERENCES `application_option` (`option_id`) ON DELETE CASCADE ON UPDATE CASCADE;\n");
$this->query("\n    ALTER TABLE `application_admin`\n        ADD FOREIGN KEY `FK_APPLICATION_APP_ID` (`app_id`) REFERENCES `application` (`app_id`) ON DELETE CASCADE ON UPDATE CASCADE;\n");
$this->query("\n    ALTER TABLE `application_device`\n        ADD CONSTRAINT `APPLICATION_DEVICE_APP_ID`\n            FOREIGN KEY (`app_id`) REFERENCES `application` (`app_id`) ON DELETE CASCADE ON UPDATE CASCADE;\n");
$this->query("\n    ALTER TABLE `application_tc`\n        ADD CONSTRAINT `FK_APPLICATION_TC_APP_ID`\n            FOREIGN KEY (`app_id`) REFERENCES `application` (`app_id`) ON UPDATE CASCADE ON DELETE CASCADE;\n");
$this->query("\n    ALTER TABLE `application_option`\n        ADD CONSTRAINT `FK_APPLICATION_OPTION_CATEGORY_ID`\n            FOREIGN KEY (`category_id`) REFERENCES `application_option_category` (`category_id`) ON UPDATE CASCADE ON DELETE CASCADE;\n");
$this->query("ALTER TABLE `log` ADD FOREIGN KEY `FK_APPLICATION_APPLICATION_ID` (app_id) references `application` (`app_id`) ON UPDATE CASCADE ON DELETE CASCADE;");
$datas = array(array('name' => 'Layout 1', 'visibility' => Application_Model_Layout_Homepage::VISIBILITY_ALWAYS, 'code' => 'layout_1', 'preview' => '/customization/layout/homepage/layout_1.png', 'use_more_button' => 1, 'use_horizontal_scroll' => 0, 'number_of_displayed_icons' => 5, 'position' => "bottom", "order" => 1, "is_active" => 1), array('name' => 'Layout 2', 'visibility' => Application_Model_Layout_Homepage::VISIBILITY_HOMEPAGE, 'code' => 'layout_2', 'preview' => '/customization/layout/homepage/layout_2.png', 'use_more_button' => 1, 'use_horizontal_scroll' => 0, 'number_of_displayed_icons' => 10, 'position' => "bottom", "order" => 2, "is_active" => 1), array('name' => 'Layout 3', 'visibility' => Application_Model_Layout_Homepage::VISIBILITY_HOMEPAGE, 'code' => 'layout_3', 'preview' => '/customization/layout/homepage/layout_3.png', 'use_more_button' => 0, 'use_horizontal_scroll' => 0, 'number_of_displayed_icons' => null, 'position' => "bottom", "order" => 3, "is_active" => 1), array('name' => 'Layout 4', 'visibility' => Application_Model_Layout_Homepage::VISIBILITY_HOMEPAGE, 'code' => 'layout_4', 'preview' => '/customization/layout/homepage/layout_4.png', 'use_more_button' => 0, 'use_horizontal_scroll' => 0, 'number_of_displayed_icons' => null, 'position' => "bottom", "order" => 4, "is_active" => 1), array('name' => 'Layout 5', 'visibility' => Application_Model_Layout_Homepage::VISIBILITY_HOMEPAGE, 'code' => 'layout_5', 'preview' => '/customization/layout/homepage/layout_5.png', 'use_more_button' => 0, 'use_horizontal_scroll' => 0, 'number_of_displayed_icons' => null, 'position' => "bottom", "order" => 5, "is_active" => 1), array('name' => 'Layout 6', 'visibility' => Application_Model_Layout_Homepage::VISIBILITY_HOMEPAGE, 'code' => 'layout_6', 'preview' => '/customization/layout/homepage/layout_6.png', 'use_more_button' => 0, 'use_horizontal_scroll' => 0, 'number_of_displayed_icons' => null, 'position' => "bottom", "order" => 6, "is_active" => 1), array('name' => 'Layout 7', 'visibility' => Application_Model_Layout_Homepage::VISIBILITY_HOMEPAGE, 'code' => 'layout_7', 'preview' => '/customization/layout/homepage/layout_7.png', 'use_more_button' => 0, 'use_horizontal_scroll' => 0, 'number_of_displayed_icons' => null, 'position' => "bottom", "order" => 7, "is_active" => 1), array('name' => 'Layout 8', 'visibility' => Application_Model_Layout_Homepage::VISIBILITY_HOMEPAGE, 'code' => 'layout_8', 'preview' => '/customization/layout/homepage/layout_8.png', 'use_more_button' => 0, 'use_horizontal_scroll' => 0, 'number_of_displayed_icons' => null, 'position' => "bottom", "order" => 8, "is_active" => 0), array('name' => 'Layout 9', 'visibility' => Application_Model_Layout_Homepage::VISIBILITY_TOGGLE, 'code' => 'layout_9', 'preview' => '/customization/layout/homepage/layout_9.png', 'use_more_button' => 0, 'use_horizontal_scroll' => 0, 'number_of_displayed_icons' => null, 'position' => "left", "order" => 9, "is_active" => 1), array('name' => 'Layout 3 - Horizontal', 'visibility' => Application_Model_Layout_Homepage::VISIBILITY_HOMEPAGE, 'code' => 'layout_3_h', 'preview' => '/customization/layout/homepage/layout_3-h.png', 'use_more_button' => 0, 'use_horizontal_scroll' => 0, "number_of_displayed_icons" => 6, 'position' => "bottom", "order" => 10, "is_active" => 1), array('name' => 'Layout 4 - Horizontal', 'visibility' => Application_Model_Layout_Homepage::VISIBILITY_HOMEPAGE, 'code' => 'layout_4_h', 'preview' => '/customization/layout/homepage/layout_4-h.png', 'use_more_button' => 0, 'use_horizontal_scroll' => 1, "number_of_displayed_icons" => 6, 'position' => "bottom", "order" => 11, "is_active" => 1), array('name' => 'Layout 5 - Horizontal', 'visibility' => Application_Model_Layout_Homepage::VISIBILITY_HOMEPAGE, 'code' => 'layout_5_h', 'preview' => '/customization/layout/homepage/layout_5-h.png', 'use_more_button' => 0, 'use_horizontal_scroll' => 1, "number_of_displayed_icons" => 4, 'position' => "bottom", "order" => 12, "is_active" => 1), array('name' => 'Layout 10', 'visibility' => Application_Model_Layout_Homepage::VISIBILITY_HOMEPAGE, 'code' => 'layout_10', 'preview' => '/customization/layout/homepage/layout_10.png', 'use_more_button' => 1, 'use_horizontal_scroll' => 0, 'number_of_displayed_icons' => 5, 'position' => 'bottom', "order" => 13, "is_active" => 1));
foreach ($datas as $data) {
    $layout = new Application_Model_Layout_Homepage();
    $layout->setData($data)->save();
}
$categories = array(array("code" => "social", "name" => "Social", "icon" => "icon-share", "position" => 10), array("code" => "media", "name" => "Media", "icon" => "icon-play", "position" => 20), array("code" => "contact", "name" => "Contact", "icon" => "icon-phone", "position" => 30), array("code" => "monetization", "name" => "Monetization", "icon" => "icon-money", "position" => 40), array("code" => "customization", "name" => "Customization", "icon" => "icon-edit", "position" => 50), array("code" => "integration", "name" => "Integration", "icon" => "icon-globe", "position" => 60), array("code" => "events", "name" => "Events", "icon" => "icon-calendar", "position" => 70), array("code" => "misc", "name" => "Misc", "icon" => "icon-code", "position" => 80));
foreach ($categories as $category_data) {
    $category = new Application_Model_Option_Category();
    $category->setData($category_data)->save();
    foreach ($category_data["features"] as $feature_code) {
        $this->_db->update("application_option", array("category_id" => $category->getId()), array("code = ?" => $feature_code));
    }
}
$this->query("\n    CREATE TABLE `template_design_content` (\n        `content_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,\n        `design_id` INT(11) UNSIGNED NOT NULL,\n        `option_id` INT(11) UNSIGNED NOT NULL,\n        `option_tabbar_name` VARCHAR(30) NULL DEFAULT NULL,\n        `option_icon` VARCHAR(30) NULL DEFAULT NULL,\n        `option_background_image` VARCHAR(255) NULL DEFAULT NULL,\n        PRIMARY KEY (`content_id`),\n        KEY (`design_id`),\n        KEY (`option_id`)\n    )\n");
$this->query("\n    ALTER TABLE `template_design_content`\n        ADD CONSTRAINT `FK_TEMPLATE_DESIGN_CONTENT_DESIGN_ID` FOREIGN KEY (`design_id`) REFERENCES `template_design` (`design_id`)\n            ON DELETE CASCADE ON UPDATE CASCADE;\n");
$this->query("\n    ALTER TABLE `template_design_content`\n        ADD CONSTRAINT `FK_TEMPLATE_DESIGN_CONTENT_OPTION_ID` FOREIGN KEY (`option_id`) REFERENCES `application_option` (`option_id`)\n            ON DELETE CASCADE ON UPDATE CASCADE;\n");
// Inserting categories in 'template_category' table
$categories = array("Entertainment", "Local Business", "Music");
foreach ($categories as $category_name) {
    $category_data = array();
    $category_data['name'] = $category_name;
    $category_data['code'] = preg_replace('/[&\\s]+/', "_", strtolower($category_name));
    $category = new Template_Model_Category();
    $category->find($category_data['code'], "code");
    $category->setData($category_data)->save();
}
// Listing all layouts
$layouts = array();
$layout = new Application_Model_Layout_Homepage();
foreach ($layout->findAll() as $layout) {
    $layouts[$layout->getCode()] = $layout;
}
// Listings all block ids
$block_ids = array();
$block = new Template_Model_Block();
foreach ($block->findAll() as $block) {
    $block_ids[$block->getCode()] = $block->getId();
}
// Inserting designs with blocks
$designs = array("fairground" => array("layout_id" => $layouts["layout_3"]->getId(), "name" => "Fairground", "overview" => "/fairground/overview.png", "background_image" => "/../../images/templates/fairground/640x1136.jpg", "background_image_hd" => "/../../images/templates/fairground/1242x2208.jpg", "background_image_tablet" => "/../../images/templates/fairground/1536x2048.jpg", "icon" => "/../../images/templates/fairground/180x180.png", "startup_image" => "/../../images/templates/fairground/640x960.png", "startup_image_retina" => "/../../images/templates/fairground/640x1136.jpg", "startup_image_iphone_6" => "/../../images/templates/fairground/750x1334.png", "startup_image_iphone_6_plus" => "/../../images/templates/fairground/1242x2208.jpg", "startup_image_ipad_retina" => "/../../images/templates/fairground/1536x2048.jpg", "blocks" => array("header" => array("color" => "#323b40", "background_color" => "#ee4b63"), "subheader" => array("color" => "#323b40", "background_color" => "#fdc32f"), "connect_button" => array("color" => "#323b40", "background_color" => "#6fb7b1"), "background" => array("color" => "#323b40", "background_color" => "#f9e4d1"), "discount" => array("color" => "#ee4b63", "background_color" => "#f9e4d1"), "button" => array("color" => "#323b40", "background_color" => "#6fb7b1"), "news" => array("color" => "#323b40", "background_color" => "#f9e4d1"), "comments" => array("color" => "#", "background_color" => "#fdc32f"), "tabbar" => array("color" => "#ee4b63", "background_color" => "transparent", "image_color" => "#ee4b63"))), "pizza" => array("layout_id" => $layouts["layout_9"]->getId(), "layout_visibility" => "toggle", "name" => "Pizza", "overview" => "/pizza/overview.png", "background_image" => "/../../images/templates/pizza/640x1136.jpg", "background_image_hd" => "/../../images/templates/pizza/1242x2208.jpg", "background_image_tablet" => "/../../images/templates/pizza/1536x2048.jpg", "icon" => "/../../images/templates/pizza/180x180.png", "startup_image" => "/../../images/templates/pizza/640x960.png", "startup_image_retina" => "/../../images/templates/pizza/640x1136.jpg", "startup_image_iphone_6" => "/../../images/templates/pizza/750x1334.png", "startup_image_iphone_6_plus" => "/../../images/templates/pizza/1242x2208.jpg", "startup_image_ipad_retina" => "/../../images/templates/pizza/1536x2048.jpg", "blocks" => array("header" => array("color" => "#ffffff", "background_color" => "#00a72d"), "subheader" => array("color" => "#ffffff", "background_color" => "#e50017"), "connect_button" => array("color" => "#ffffff", "background_color" => "#00a72d"), "background" => array("color" => "#00a72d", "background_color" => "#ffffff"), "discount" => array("color" => "#ffffff", "background_color" => "#e50017"), "button" => array("color" => "#ffffff", "background_color" => "#00a72d"), "news" => array("color" => "#00a72d", "background_color" => "#ffffff"), "comments" => array("color" => "#ffffff", "background_color" => "#00a72d"), "tabbar" => array("color" => "#00a72d", "background_color" => "#ffffff", "image_color" => "#00a72d"))), "dj" => array("layout_id" => $layouts["layout_2"]->getId(), "name" => "DJ", "overview" => "/dj/overview.png", "background_image" => "/../../images/templates/dj/640x1136.jpg", "background_image_hd" => "/../../images/templates/dj/1242x2208.jpg", "background_image_tablet" => "/../../images/templates/dj/1536x2048.jpg", "icon" => "/../../images/templates/dj/180x180.png", "startup_image" => "/../../images/templates/dj/640x960.png", "startup_image_retina" => "/../../images/templates/dj/640x1136.jpg", "startup_image_iphone_6" => "/../../images/templates/dj/750x1334.png", "startup_image_iphone_6_plus" => "/../../images/templates/dj/1242x2208.jpg", "startup_image_ipad_retina" => "/../../images/templates/dj/1536x2048.jpg", "blocks" => array("header" => array("color" => "#404040", "background_color" => "#e0c341"), "subheader" => array("color" => "#404040", "background_color" => "#f0d970"), "connect_button" => array("color" => "#404040", "background_color" => "#e0c341"), "background" => array("color" => "#f0d970", "background_color" => "#b65c12"), "discount" => array("color" => "#404040", "background_color" => "#e0c341"), "button" => array("color" => "#b65c12", "background_color" => "#e0c341"), "news" => array("color" => "#f0d970", "background_color" => "#b65c12"), "comments" => array("color" => "#404040", "background_color" => "#e0c341"), "tabbar" => array("color" => "#e0c341", "background_color" => "transparent", "image_color" => "#e0c341"))), "blank" => array("layout_id" => $layouts["layout_1"]->getId(), "name" => "Blank", "overview" => "/blank/overview.png", "background_image" => "/../../images/application/placeholder/no-background.jpg", "background_image_hd" => "/../../images/application/placeholder/no-background-hd.jpg", "background_image_tablet" => "/../../images/application/placeholder/no-background-tablet.jpg", "icon" => "/../../images/application/placeholder/no-image.png", "startup_image" => "/../../images/application/placeholder/no-startupimage.png", "startup_image_retina" => "/../../images/application/placeholder/no-startupimage-retina.png", "startup_image_iphone_6" => "/../../images/application/placeholder/no-startupimage-iphone-6.png", "startup_image_iphone_6_plus" => "/../../images/application/placeholder/no-startupimage-iphone-6-plus.png", "startup_image_ipad_retina" => "/../../images/application/placeholder/no-startupimage-tablet.png"));
foreach ($designs as $code => $data) {
    $design = new Template_Model_Design();
    $design->find($code, "code");
    if (!$design->getId()) {
Exemplo n.º 6
0
<?php

$this->query("\n    ALTER TABLE `application_layout_homepage`\n        ADD `number_of_displayed_icons` tinyint(2) NULL DEFAULT NULL AFTER `use_more_button`\n    ;\n");
$layout = new Application_Model_Layout_Homepage();
$layout->find(1);
$layout->setNumberOfDisplayedIcons(5)->save();
$layout = new Application_Model_Layout_Homepage();
$layout->find(2);
$layout->setNumberOfDisplayedIcons(10)->save();
Exemplo n.º 7
0
<?php

$this->query("\n    ALTER TABLE `application_layout_homepage`\n        ADD `code` VARCHAR(10) NOT NULL AFTER `layout_id`;\n");
$layout = new Application_Model_Layout_Homepage();
$layouts = $layout->findAll();
foreach ($layouts as $key => $layout) {
    $layout->setCode("layout_" . $key)->setName("Layout " . $key)->save();
}
$layout = new Application_Model_Layout_Homepage();
$layout->setData(array('code' => 'layout_8', 'name' => 'Layout 8', 'preview' => '/customization/layout/homepage/layout_8.png', 'use_more_button' => 0, 'position' => 80))->save();
Exemplo n.º 8
0
<?php

$layout = new Application_Model_Layout_Homepage();
$layouts = $layout->findAll();
foreach ($layouts as $key => $layout) {
    ++$key;
    $layout->setCode("layout_" . $key)->setName("Layout " . $key)->save();
}
$layout = new Application_Model_Layout_Homepage();
$layout->setData(array('code' => 'layout_9', 'name' => 'Layout 9', 'preview' => '/customization/layout/homepage/layout_9.png', 'use_more_button' => 0, 'position' => 80))->save();
$this->query("\n    ALTER TABLE `application_layout_homepage`\n        ADD `visibility` VARCHAR(10) NOT NULL DEFAULT 'homepage' AFTER `layout_id`,\n        ADD position VARCHAR(10) NOT NULL DEFAULT 'bottom' AFTER `number_of_displayed_icons`\n    ;\n");
$this->query("\n    ALTER TABLE `application`\n        ADD `layout_visibility` VARCHAR(10) NOT NULL DEFAULT 'homepage' AFTER `layout_id`;\n");
$layout = new Application_Model_Layout_Homepage();
$layouts = $layout->findAll();
foreach ($layouts as $key => $layout) {
    switch ($layout->getId()) {
        case 1:
            $layout->setVisibility(Application_Model_Layout_Homepage::VISIBILITY_ALWAYS)->setPosition("bottom");
            break;
        case 7:
            $layout->setPosition("left");
            break;
        case 9:
            $layout->setVisibility(Application_Model_Layout_Homepage::VISIBILITY_TOGGLE)->setPosition("left");
            break;
        default:
            $layout->setVisibility(Application_Model_Layout_Homepage::VISIBILITY_HOMEPAGE)->setPosition("bottom");
            break;
    }
    $layout->save();
}