The followings are the available columns in table '{{_layouts}}':
Inheritance: extends CActiveRecord
コード例 #1
1
ファイル: view_as_tabs.php プロジェクト: rair/yacs
     $box['text'] .= Skin::build_list($box['bar'], 'menu_bar');
 }
 // there is some box content
 if (trim($box['text'])) {
     $text .= Skin::build_box($title_label, $box['text'], 'header1', '_discussion');
 }
 // if not at another follow-up page
 if (!$zoom_type || $zoom_type == 'sections') {
     // layout sub-sections
     if (!isset($item['sections_layout']) || $item['sections_layout'] != 'none') {
         // select a layout
         if (!isset($item['sections_layout']) || !$item['sections_layout']) {
             include_once $context['path_to_root'] . 'sections/layout_sections.php';
             $layout = new Layout_sections();
         } else {
             $layout = Layouts::new_($item['sections_layout'], 'section');
         }
         // the maximum number of sections per page
         if (is_object($layout)) {
             $items_per_page = $layout->items_per_page();
         } else {
             $items_per_page = SECTIONS_PER_PAGE;
         }
         // build a complete box
         $box = array('top_bar' => array(), 'text' => '', 'bottom_bar' => array());
         // the command to add a new section
         if (Sections::allow_creation($item, $anchor)) {
             Skin::define_img('SECTIONS_ADD_IMG', 'sections/add.gif');
             $box['top_bar'] += array('sections/edit.php?anchor=' . urlencode('section:' . $item['id']) => SECTIONS_ADD_IMG . i18n::s('Add a section'));
         }
         // list items by title
コード例 #2
1
ファイル: files.php プロジェクト: rair/yacs
 /**
  * list selected files
  *
  * If variant is provided as a string, the functions looks for a script featuring this name.
  * E.g., for variant 'compact', the file 'files/layout_files_as_compact.php' is loaded.
  * If no file matches then the default 'files/layout_files.php' script is loaded.
  *
  * @param resource result of database query
  * @param string 'full', etc or object, i.e., an instance of Layout_Interface
  * @param string '?' or 'A', to support editors and to impersonate associates, where applicable
  * @return an array of $url => ($prefix, $label, $suffix, $icon)
  *
  * @see skins/skin_skeleton.php
  * @see files/fetch_all.php
  */
 public static function &list_selected($result, $variant = 'compact')
 {
     global $context;
     // no result
     if (!$result) {
         $output = NULL;
         return $output;
     }
     // special layout
     if (is_object($variant)) {
         $output = $variant->layout($result);
         return $output;
     }
     // instanciate the provided name
     $layout = Layouts::new_($variant, 'file', false, true);
     // do the job
     $output = $layout->layout($result);
     return $output;
 }
コード例 #3
0
 /** Receives the form submission from the edit action and updates the specific object. */
 public function actionUpdate()
 {
     if ($this->request->isPost()) {
         // valid stylesheet?
         $layouts = new Layouts();
         $post = $this->request->getPost();
         if (in_array($post['layout'], $layouts->listDirectory('public'))) {
             // update our cached user row
             $this->userRow['layout'] = $post['layout'];
             // passwords identical?
             if (!empty($post['password1'])) {
                 if ($post['password1'] == $post['password2']) {
                     $this->userRow['password'] = sha1($post['password1']);
                 } else {
                     $this->flashFail = 'The passwords do not match';
                     $this->redirectTo('/settings');
                 }
             }
             $users = new Users();
             $users->update()->set($this->userRow)->where($this->userRow['id']);
             $this->flashSuccess = 'Settings updated';
         } else {
             $this->flashFail = 'Invalid stylesheet';
         }
     }
     $this->redirectTo('/settings');
 }
コード例 #4
0
 public static function layoutWallSlotsBreakdown($id)
 {
     $data = array();
     if ($layout = Layouts::get_layouts($id)) {
         // Get studio, sizing can diff between certain studios
         $studio = $layout->studio()->get();
         $studio = $studio[0];
         $data['singleLargeSideSlots'] = round($layout->size_x / $studio->externalwallsingleslotlength);
         $data['singleSmallSideSlots'] = round($layout->size_y / $studio->externalwallsingleslotlength);
         $data['totalLargeSideSlots'] = $data['singleLargeSideSlots'] * 2;
         $data['totalSmallSideSlots'] = $data['singleSmallSideSlots'] * 2;
         $data['totalSlots'] = $data['totalLargeSideSlots'] + $data['totalSmallSideSlots'];
         return $data;
     }
     return 0;
 }
コード例 #5
0
ファイル: Layouts.php プロジェクト: viniciusilveira/pluton
 /**
  * Atualiza os dados de uma deterimanda parte do layout
  * @param  string $attribute parte do layout a ser alterada
  * @param  string $content   novo conteúdo a ser inserido
  * @return boolean            Verdadeiro caso sucesso ou falso caso ocorra algum erro
  */
 public function updateLayout($attribute, $content)
 {
     $content = addslashes(htmlentities($content));
     $layout = Layouts::findFirst();
     switch ($attribute) {
         case 'title':
             $layout->layout_title = $content;
             return $layout->save();
             break;
         case 'subtitle':
             $layout->layout_subtitle = $content;
             return $layout->save();
         case 'home':
             $layout->layout_menu1 = $content;
             return $layout->save();
         case 'about':
             $layout->layout_menu2 = $content;
             return $layout->save();
         case 'contact':
             $layout->layout_menu3 = $content;
             return $layout->save();
             break;
         case 'lateralbar':
             $layout->layout_lateralbar = $content;
             return $layout->save();
             break;
         case 'searchbar':
             $layout->layout_searchbar = $content;
             return $layout->save();
             break;
         case 'footer':
             $layout->layout_footer = $content;
             return $layout->save();
             break;
         case 'navigation':
             $layout->layout_navigation = $content;
             return $layout->save();
             break;
         default:
             return false;
             break;
     }
 }
コード例 #6
0
ファイル: index.php プロジェクト: ShuiMuQinHua/yiishop
                </div>
            </div>
        </div>
        <!-- END PROMO -->
    </div>
    <!-- END TWO PRODUCTS & PROMO -->
</div>

<!-- BEGIN BRANDS -->
<div class="brands">
    <div class="container">
        <div class="row">
            <div class="bxslider-wrapper">
                <ul class="bxslider" data-slides-phone="1" data-slides-tablet="3" data-slides-desktop="6" data-slide-margin="15">
                    <?php 
foreach (Layouts::brand() as $v) {
    ?>
                        <li>
                            <a href="product-list.html">
                                <img src="<?php 
    echo $this->img . $v['brand_logo'];
    ?>
" style="width: 153px;height: 92px;" alt="<?php 
    echo $v['brand_name'];
    ?>
" title="<?php 
    echo $v['brand_name'];
    ?>
">
                            </a>
                        </li>
コード例 #7
0
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     if (!is_numeric($id)) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     try {
         $model = Layouts::model()->findByPk($id);
         if ($model === null) {
             Yii::log("The requested page does not exist.");
             throw new CHttpException(404, 'The requested page does not exist.');
         }
         return $model;
     } catch (Exception $e) {
         Yii::log("Exception " . print_r($e, true), 'error');
         throw new CHttpException("Exception " . print_r($e, true));
     }
 }
コード例 #8
0
ファイル: view.php プロジェクト: rair/yacs
 if ($count) {
     $box['bottom'] += array('_count' => sprintf(i18n::ns('%d section', '%d sections', $count), $count));
 }
 // navigation commands for articles
 $home = Users::get_permalink($item);
 $prefix = Users::get_url($item['id'], 'navigate', 'sections');
 $box['bottom'] = array_merge($box['bottom'], Skin::navigate($home, $prefix, $count, SECTIONS_PER_PAGE, $zoom_index));
 // append a menu bar before the list
 $box['top'] = array_merge($box['top'], $box['bottom']);
 if (count($box['top'])) {
     $box['text'] .= Skin::build_list($box['top'], 'menu_bar');
 }
 // compute offset from list beginning
 $offset = ($zoom_index - 1) * SECTIONS_PER_PAGE;
 // list assigned by title
 $layout = Layouts::new_('rights', 'section');
 $layout->set_focus($item['id']);
 $items =& Sections::list_by_date_for_user($item['id'], $offset, SECTIONS_PER_PAGE, $layout);
 if (is_array($items)) {
     $box['text'] .= Skin::build_list($items, 'compact');
 } elseif ($items) {
     $box['text'] .= $items;
 }
 // append a menu bar below the list
 if (count($box['bottom']) > 1) {
     $box['text'] .= Skin::build_list($box['bottom'], 'menu_bar');
 }
 // one box
 if ($box['text']) {
     $sections .= $box['text'];
 }
コード例 #9
0
ファイル: print.php プロジェクト: rair/yacs
 } elseif (is_array($items)) {
     $box['text'] .= Skin::build_list($items, '2-columns');
 } elseif (is_string($items)) {
     $box['text'] .= $items;
 }
 if ($box['text']) {
     $context['text'] .= Skin::build_box('', $box['text']);
 }
 //
 // the articles section
 //
 // select a layout
 if (!isset($item['articles_layout'])) {
     $layout = NULL;
 } else {
     $layout = Layouts::new_($item['articles_layout'], 'article');
 }
 // the maximum number of articles per page
 if (is_object($layout)) {
     $items_per_page = $layout->items_per_page();
 } else {
     $items_per_page = ARTICLES_PER_PAGE;
 }
 // list articles by date (default) or by title (option 'articles_by_title')
 if (preg_match('/\\barticles_by_([a-z_]+)\\b/i', $item['options'], $matches)) {
     $order = $matches[1];
 } else {
     $order = 'edition';
 }
 $items =& Articles::list_for_anchor_by($order, 'section:' . $item['id'], 0, MAXIMUM_ITEMS_PER_SECTION + 1, 'compact');
 // actually render the html
コード例 #10
0
ファイル: layout_sections_as_tabs.php プロジェクト: rair/yacs
 /**
  * list sections
  *
  * @param resource the SQL result
  * @return a string to be displayed
  *
  * @see layouts/layout.php
  **/
 function layout($result)
 {
     global $context;
     // we return some text
     $text = '';
     // empty list
     if (!SQL::count($result)) {
         return $text;
     }
     // no hovering label
     $href_title = '';
     // we build an array for the skin::build_tabs() function
     $panels = array();
     // process all items in the list
     while ($item = SQL::fetch($result)) {
         // get the main anchor
         $anchor = Anchors::get($item['anchor']);
         // get the related overlay, if any
         $overlay = Overlay::load($item, 'section:' . $item['id']);
         // get the overlay for content of this section, if any
         $content_overlay = NULL;
         if (isset($item['content_overlay'])) {
             $content_overlay = Overlay::bind($item['content_overlay']);
         }
         // panel content
         $text = '';
         // insert anchor prefix
         if (is_object($anchor)) {
             $text .= $anchor->get_prefix();
         }
         // the introduction text, if any
         if (is_object($overlay)) {
             $text .= Skin::build_block($overlay->get_text('introduction', $item), 'introduction');
         } elseif (isset($item['introduction']) && trim($item['introduction'])) {
             $text .= Skin::build_block($item['introduction'], 'introduction');
         }
         // get text related to the overlay, if any
         if (is_object($overlay)) {
             $text .= $overlay->get_text('view', $item);
         }
         // filter description, if necessary
         if (is_object($overlay)) {
             $description = $overlay->get_text('description', $item);
         } else {
             $description = $item['description'];
         }
         // the beautified description, which is the actual page body
         if ($description) {
             // use adequate label
             if (is_object($overlay) && ($label = $overlay->get_label('description'))) {
                 $text .= Skin::build_block($label, 'title');
             }
             // beautify the target page
             $text .= Skin::build_block($description, 'description', '', $item['options']);
         }
         // delegate rendering to the overlay, where applicable
         if (is_object($content_overlay) && ($overlaid = $content_overlay->render('articles', 'section:' . $item['id'], 1))) {
             $text .= $overlaid;
             // regular rendering
         } elseif (!isset($item['articles_layout']) || $item['articles_layout'] != 'none') {
             // select a layout
             if (!isset($item['articles_layout']) || !$item['articles_layout']) {
                 include_once '../articles/layout_articles.php';
                 $layout = new Layout_articles();
             } else {
                 $layout = Layouts::new_($item['articles_layout'], 'article');
             }
             // avoid links to this page
             if (is_object($layout) && is_callable(array($layout, 'set_variant'))) {
                 $layout->set_focus('section:' . $item['id']);
             }
             // the maximum number of articles per page
             if (is_object($layout)) {
                 $items_per_page = $layout->items_per_page();
             } else {
                 $items_per_page = ARTICLES_PER_PAGE;
             }
             // sort and list articles
             $offset = 0;
             if (preg_match('/\\barticles_by_([a-z_]+)\\b/i', $item['options'], $matches)) {
                 $order = $matches[1];
             } elseif (is_callable(array($layout, 'items_order'))) {
                 $order = $layout->items_order();
             } else {
                 $order = 'edition';
             }
             // create a box
             $box = array('top_bar' => array(), 'text' => '', 'bottom_bar' => array());
             // the command to post a new page
             //if(Articles::allow_creation($item, $anchor)) {
             if ($anchor->allows('creation', 'article')) {
                 Skin::define_img('ARTICLES_ADD_IMG', 'articles/add.gif');
                 $url = 'articles/edit.php?anchor=' . urlencode('section:' . $item['id']);
                 if (is_object($content_overlay) && ($label = $content_overlay->get_label('new_command', 'articles'))) {
                 } else {
                     $label = ARTICLES_ADD_IMG . i18n::s('Add a page');
                 }
                 $box['top_bar'] += array($url => $label);
             }
             // list pages under preparation
             $this_section = new section();
             $this_section->load_by_content($item, $anchor);
             if ($this_section->is_assigned()) {
                 if ($order == 'publication' && ($items =& Articles::list_for_anchor_by('draft', 'section:' . $item['id'], 0, 20, 'compact'))) {
                     if (is_array($items)) {
                         $items = Skin::build_list($items, 'compact');
                     }
                     $box['top_bar'] += array('_draft' => Skin::build_sliding_box(i18n::s('Draft pages'), $items));
                 }
             }
             // top menu
             if ($box['top_bar']) {
                 $box['text'] .= Skin::build_list($box['top_bar'], 'menu_bar');
             }
             // get pages
             $items =& Articles::list_for_anchor_by($order, 'section:' . $item['id'], $offset, $items_per_page, $layout);
             // items in the middle
             if (is_array($items) && isset($item['articles_layout']) && $item['articles_layout'] == 'compact') {
                 $box['text'] .= Skin::build_list($items, 'compact');
             } elseif (is_array($items)) {
                 $box['text'] .= Skin::build_list($items, 'decorated');
             } elseif (is_string($items)) {
                 $box['text'] .= $items;
             }
             // no navigation bar with alistapart
             if (!isset($item['articles_layout']) || $item['articles_layout'] != 'alistapart') {
                 // count the number of articles in this section
                 if ($count = Articles::count_for_anchor('section:' . $item['id'])) {
                     if ($count > 20) {
                         $box['bottom_bar'] += array('_count' => sprintf(i18n::ns('%d page', '%d pages', $count), $count));
                     }
                     // navigation commands for articles
                     $home = Sections::get_permalink($item);
                     $prefix = Sections::get_url($item['id'], 'navigate', 'articles');
                     $box['bottom_bar'] += Skin::navigate($home, $prefix, $count, $items_per_page, 1);
                 }
             }
             // bottom menu
             if ($box['bottom_bar']) {
                 $box['text'] .= Skin::build_list($box['bottom_bar'], 'menu_bar');
             }
             // there is some box content
             if ($box['text']) {
                 $text .= $box['text'];
             }
         }
         // layout sub-sections
         if (!isset($item['sections_layout']) || $item['sections_layout'] != 'none') {
             // select a layout
             if (!isset($item['sections_layout']) || !$item['sections_layout']) {
                 include_once 'layout_sections.php';
                 $layout = new Layout_sections();
             } else {
                 $layout = Layouts::new_($item['sections_layout'], 'section');
             }
             // the maximum number of sections per page
             if (is_object($layout)) {
                 $items_per_page = $layout->items_per_page();
             } else {
                 $items_per_page = SECTIONS_PER_PAGE;
             }
             // build a complete box
             $box = array('top_bar' => array(), 'text' => '', 'bottom_bar' => array());
             // the command to add a new section
             //if(Sections::allow_creation($item, $anchor)) {
             if ($anchor->allows('creation', 'section')) {
                 Skin::define_img('SECTIONS_ADD_IMG', 'sections/add.gif');
                 $box['top_bar'] += array('sections/edit.php?anchor=' . urlencode('section:' . $item['id']) => SECTIONS_ADD_IMG . i18n::s('Add a section'));
             }
             // top menu
             if ($box['top_bar']) {
                 $box['text'] .= Skin::build_list($box['top_bar'], 'menu_bar');
             }
             // list items by family then title
             $offset = 0 * $items_per_page;
             $items = Sections::list_by_title_for_anchor('section:' . $item['id'], $offset, $items_per_page, $layout, TRUE);
             // actually render the html for the section
             if (is_array($items) && is_string($item['sections_layout']) && $item['sections_layout'] == 'compact') {
                 $box['text'] .= Skin::build_list($items, 'compact');
             } elseif (is_array($items)) {
                 $box['text'] .= Skin::build_list($items, 'decorated');
             } elseif (is_string($items)) {
                 $box['text'] .= $items;
             }
             // count the number of subsections
             if ($count = Sections::count_for_anchor('section:' . $item['id'])) {
                 if ($count > 20) {
                     $box['bottom_bar'] = array('_count' => sprintf(i18n::ns('%d section', '%d sections', $count), $count));
                 }
                 // navigation commands for sections
                 $home = Sections::get_permalink($item);
                 $prefix = Sections::get_url($item['id'], 'navigate', 'sections');
                 $box['bottom_bar'] += Skin::navigate($home, $prefix, $count, $items_per_page, 1);
             }
             // bottom menu
             if ($box['bottom_bar']) {
                 $box['text'] .= Skin::build_list($box['bottom_bar'], 'menu_bar');
             }
             // there is some box content
             if ($box['text']) {
                 $text .= $box['text'];
             }
         }
         // ensure that the surfer can change content
         if (Sections::allow_modification($item, $anchor)) {
             // view or modify this section
             $menu = array();
             $menu[] = Skin::build_link(Sections::get_permalink($item), i18n::s('View the sub-section'), 'span');
             if (!is_object($overlay) || !($label = $overlay->get_label('edit_command', 'sections'))) {
                 $label = i18n::s('Edit this sub-section');
             }
             $menu[] = Skin::build_link(Sections::get_url($item['id'], 'edit'), $label, 'span');
             $text .= Skin::finalize_list($menu, 'menu_bar');
         }
         // assemble the full panel
         $panels[] = array('stt' . $item['id'], ucfirst(Skin::strip($item['title'], 30)), 'stc' . $item['id'], $text);
     }
     // format tabs
     if ($this->has_variant('as_array')) {
         $text = $panels;
     } else {
         $text = Skin::build_tabs($panels);
     }
     // end of processing
     SQL::free($result);
     return $text;
 }
コード例 #11
0
ファイル: view.php プロジェクト: rair/yacs
         $panels[] = array('categories', i18n::s('Categories'), 'categories_panel', $box['text']);
     }
 }
 //
 // users associated to this category
 //
 // the list of related users if not at another follow-up page
 if ((!$zoom_type || $zoom_type == 'users') && (!isset($item['users_layout']) || $item['users_layout'] != 'none')) {
     // build a complete box
     $box = array('bar' => array(), 'text' => '');
     // select a layout
     if (!isset($item['users_layout']) || !$item['users_layout']) {
         include_once '../users/layout_users.php';
         $layout = new Layout_users();
     } else {
         $layout = Layouts::new_($item['users_layout'], 'user');
     }
     // count the number of users in this category
     $count = Members::count_users_for_anchor('category:' . $item['id']);
     // notify members
     if ($count > 1 && Surfer::is_associate()) {
         Skin::define_img('CATEGORIES_EMAIL_IMG', 'categories/email.gif');
         $box['bar'] += array(Categories::get_url($item['id'], 'mail') => CATEGORIES_EMAIL_IMG . i18n::s('Notify members'));
     }
     // spread the list over several pages
     if ($count > USERS_LIST_SIZE) {
         $box['bar'] += array('_count' => sprintf(i18n::ns('%d user', '%d users', $count), $count));
     }
     // navigation commands for users
     $home = Categories::get_permalink($item);
     $prefix = Categories::get_url($item['id'], 'navigate', 'users');
コード例 #12
0
ファイル: view.php プロジェクト: rair/yacs
 if ($cur_article->allows('modification')) {
     $embedded = NULL;
 } else {
     $embedded = Codes::list_embedded($item['description']);
 }
 // build a complete box
 $box = array('bar' => array(), 'text' => '');
 // count the number of files in this article
 if ($count = Files::count_for_anchor('article:' . $item['id'], FALSE, $embedded)) {
     $attachments_count += $count;
     if ($count > 20) {
         $box['bar'] += array('_count' => sprintf(i18n::ns('%d file', '%d files', $count), $count));
     }
     // compact list of files
     if ($compact = Articles::has_option('files_as_compact', $anchor, $item)) {
         $layout = Layouts::new_('compact', 'file');
         $layout->set_focus('article:' . $item['id']);
         // standard list of files
     } else {
         $layout = 'article:' . $item['id'];
     }
     // list files by date (default) or by title (option files_by_title)
     $offset = ($zoom_index - 1) * FILES_PER_PAGE;
     if ($cur_article->has_option('files_by') == 'title') {
         $items = Files::list_by_title_for_anchor('article:' . $item['id'], 0, 300, $layout, $embedded);
     } else {
         $items = Files::list_by_date_for_anchor('article:' . $item['id'], 0, 300, $layout, $embedded);
     }
     // actually render the html
     if (is_array($items)) {
         $box['text'] .= Skin::build_list($items, $compact ? 'compact' : 'decorated');
コード例 #13
0
 private function build_decking_page($layout)
 {
     // Calc available space based on studio size
     $slotsBreakdown = Layouts::layoutWallSlotsBreakdown($layout->id);
     $maximum_slots = $slotsBreakdown['totalSlots'] + 4;
     // Add 4 slots for cheap additional corner on the outside
     $data = new stdClass();
     $data->maximum_slots = $maximum_slots;
     // Slots per single large / small side
     $data->sizeSlots = new stdClass();
     $data->sizeSlots->singleLargeSideSlots = $slotsBreakdown['singleLargeSideSlots'];
     $data->sizeSlots->singleSmallSideSlots = $slotsBreakdown['singleSmallSideSlots'];
     // Delivery information
     $data->delivery = Quotation::calcDeliver();
     // Costs
     $data->costs = new stdClass();
     $data->costs->init_cost = Quotation::calcSessionQuotationCurrentValue('customise');
     $data->costs->composite_deck_910_910 = QuotationPriceAdjustments::getPrice('composite_deck_910_910');
     $data->costs->composite_deck_910_1820 = QuotationPriceAdjustments::getPrice('composite_deck_910_1820');
     $data->costs->composite_deck_910_2730 = QuotationPriceAdjustments::getPrice('composite_deck_910_2730');
     $data->costs->flyover_roof_910_910 = QuotationPriceAdjustments::getPrice('flyover_roof_910_910');
     $data->costs->flyover_roof_910_1820 = QuotationPriceAdjustments::getPrice('flyover_roof_910_1820');
     $data->costs->flyover_roof_910_2730 = QuotationPriceAdjustments::getPrice('flyover_roof_910_2730');
     // Notes
     $data->help = new stdClass();
     $data->help->composite_deck_910_910 = QuotationPriceAdjustments::getNote('composite_deck_910_910');
     $data->help->composite_deck_910_1820 = QuotationPriceAdjustments::getNote('composite_deck_910_1820');
     $data->help->composite_deck_910_2730 = QuotationPriceAdjustments::getNote('composite_deck_910_2730');
     $data->help->flyover_roof_910_910 = QuotationPriceAdjustments::getNote('flyover_roof_910_910');
     $data->help->flyover_roof_910_1820 = QuotationPriceAdjustments::getNote('flyover_roof_910_1820');
     $data->help->flyover_roof_910_2730 = QuotationPriceAdjustments::getNote('flyover_roof_910_2730');
     // Field defaults
     $data->defaults = new stdClass();
     $data->defaults->composite_deck_910_910 = \Laravel\Session::get('quote_decking_composite_deck_910_910', 0);
     $data->defaults->composite_deck_910_1820 = \Laravel\Session::get('quote_decking_composite_deck_910_1820', 0);
     $data->defaults->composite_deck_910_2730 = \Laravel\Session::get('quote_decking_composite_deck_910_2730', 0);
     $data->defaults->flyover_roof_910_910 = \Laravel\Session::get('quote_decking_flyover_roof_910_910', 0);
     $data->defaults->flyover_roof_910_1820 = \Laravel\Session::get('quote_decking_flyover_roof_910_1820', 0);
     $data->defaults->flyover_roof_910_2730 = \Laravel\Session::get('quote_decking_flyover_roof_910_2730', 0);
     return View::make('quotations.add_decking')->with('data', $data);
 }
コード例 #14
0
 public function init()
 {
     $this->img = 'http://' . $_SERVER['HTTP_HOST'] . '/';
     $this->cart = Layouts::Cart($this->member_id);
 }
コード例 #15
0
ファイル: index.php プロジェクト: rair/yacs
             $prefix = $home;
         } else {
             $prefix = $home . '?page=';
         }
         $menu = array_merge($menu, Skin::navigate($home, $prefix, $count, $items_per_page, $page));
         // add a menu at the bottom
         $text .= Skin::build_list($menu, 'menu_bar');
     }
     // make a box
     if ($items) {
         $text .= Skin::build_box('', $items, 'header1', 'sections');
     }
     // associates may list specific sections as well
     if ($page == 1 && Surfer::is_associate()) {
         // load the layout to use
         $layout = Layouts::new_('yahoo', 'section');
         $layout->set_variant(20);
         // show more elements at the site map
         // query the database and layout that stuff
         if ($items = Sections::list_inactive_by_title_for_anchor(NULL, 0, 50, $layout)) {
             // we have an array to format
             if (is_array($items)) {
                 $items = Skin::build_list($items, '2-columns');
             }
             // displayed as another page section
             $text .= Skin::build_box(i18n::s('Other sections'), $items, 'header1', 'other_sections');
         }
     }
     // cache this to speed subsequent queries
     Cache::put($cache_id, $text, 'sections');
 }
コード例 #16
0
ファイル: index.php プロジェクト: rair/yacs
        if ($context['with_friendly_urls'] == 'Y') {
            $prefix = $home . 'index.php/';
        } elseif ($context['with_friendly_urls'] == 'R') {
            $prefix = $home;
        } else {
            $prefix = $home . '?page=';
        }
        $context['page_menu'] += Skin::navigate($home, $prefix, $stats['count'], THREADS_PER_PAGE, $page);
    }
    // page main content
    $cache_id = 'comments/index.php#text#' . $page;
    if (!($text = Cache::get($cache_id))) {
        // the first comment to list
        $offset = ($page - 1) * THREADS_PER_PAGE;
        // load the layout to use
        $layout = Layouts::new_('yabb', 'article');
        // query the database and layout that stuff
        if (!($text = Comments::list_threads_by_date($offset, THREADS_PER_PAGE, $layout))) {
            $context['text'] .= '<p>' . i18n::s('No comment has been transmitted.') . '</p>';
        }
        // we have an array to format
        if (is_array($text)) {
            $text =& Skin::build_list($text, 'rows');
        }
        // cache, whatever changes, for 1 minute
        Cache::put($cache_id, $text, 'stable', 60);
    }
    $context['text'] .= $text;
}
// page tools
if (Surfer::is_associate()) {
コード例 #17
0
ファイル: index.php プロジェクト: rair/yacs
// load the skin
load_skin('site_taxonomy');
// the title of the page
$context['page_title'] = i18n::s('Categories');
// count categories in the database
$stats = Categories::stat_for_anchor(NULL);
// stop hackers
if ($page > 1 && ($page - 1) * CATEGORIES_PER_PAGE > $stats['count']) {
    Safe::header('Status: 401 Unauthorized', TRUE, 401);
    Logger::error(i18n::s('You are not allowed to perform this operation.'));
} else {
    // page main content
    $cache_id = 'categories/index.php#text#' . $page;
    if (!($text = Cache::get($cache_id))) {
        // do it the Yahoo! style
        $layout = Layouts::new_('yahoo', 'category');
        // the list of active categories
        $offset = ($page - 1) * CATEGORIES_PER_PAGE;
        if (!($text = Categories::list_by_title_for_anchor(NULL, $offset, CATEGORIES_PER_PAGE, $layout))) {
            $text = '<p>' . i18n::s('No category has been created yet.') . '</p>';
        }
        // we have an array to format
        if (is_array($text)) {
            $text =& Skin::build_list($text, '2-columns');
        }
        // navigation commands for categories, if necessary
        if ($stats['count'] > CATEGORIES_PER_PAGE) {
            $menu = array('_count' => Skin::build_number($stats['count'], i18n::s('categories')));
            $home = 'categories/';
            if ($context['with_friendly_urls'] == 'Y') {
                $prefix = $home . 'index.php/';
コード例 #18
0
ファイル: Layouts.php プロジェクト: Rademade/MedOptima
 public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)
 {
     self::$moduleName = $request->getModuleName();
     Zend_Layout::getMvcInstance()->setLayoutPath(APPLICATION_PATH . '/modules/' . $request->getModuleName() . '/views/layouts');
 }
コード例 #19
0
ファイル: list.php プロジェクト: rair/yacs
    // anonymous users are invited to log in or to register
    if (!Surfer::is_logged()) {
        Safe::redirect($context['url_to_home'] . $context['url_to_root'] . 'users/login.php?url=' . urlencode('files/list.php?id=' . $anchor->get_reference()));
    }
    // permission denied to authenticated user
    Safe::header('Status: 401 Unauthorized', TRUE, 401);
    Logger::error(i18n::s('You are not allowed to perform this operation.'));
    // stop hackers
} elseif ($page > 10) {
    Safe::header('Status: 401 Unauthorized', TRUE, 401);
    Logger::error(i18n::s('You are not allowed to perform this operation.'));
    // display the index
} else {
    // insert anchor prefix and suffix, plus any available icon
    $context['prefix'] .= $anchor->get_prefix();
    $layout = Layouts::new_('decorated', 'file');
    // provide anthor information to layout
    if (is_object($layout)) {
        $layout->set_focus($anchor->get_reference());
    }
    // the maximum number of files per page
    if (is_object($layout)) {
        $items_per_page = $layout->items_per_page();
    } else {
        $items_per_page = FILES_PER_PAGE;
    }
    // the first file to list
    $offset = ($page - 1) * $items_per_page;
    if (is_object($layout) && method_exists($layout, 'set_offset')) {
        $layout->set_offset($offset);
    }
コード例 #20
0
ファイル: invite.php プロジェクト: rair/yacs
         $fields[] = $field;
     }
 }
 // recipients
 $label = i18n::s('Invite participants');
 $input = '';
 if (Sections::is_owned($item, $anchor, TRUE)) {
     // roles are defined as per invitation settings
     if (is_callable(array($overlay, 'get_invite_roles'))) {
         $input .= $overlay->get_invite_roles();
     } elseif ($item['active'] != 'N') {
         $input .= '<p><input type="radio" name="provide_credentials" value="N" checked="checked" /> ' . i18n::s('to review public content (watchers)') . BR . '<input type="radio" name="provide_credentials" value="Y" /> ' . i18n::s('to manage public and private content (editors)') . '</p>' . '<hr/>';
     }
 }
 // get a customized layout
 $layout = Layouts::new_('mail', 'user');
 // avoid links to this page
 if (is_object($layout) && is_callable(array($layout, 'set_variant'))) {
     $layout->set_variant('unchecked');
 }
 // pre-invite someone
 $invited = '';
 if (isset($_REQUEST['invited']) && ($user = Users::get($_REQUEST['invited']))) {
     $invited = $user['nick_name'];
 } else {
     $handle = $item['anchor'];
     while ($handle && ($parent = Anchors::get($handle))) {
         $handle = $parent->get_parent();
         // invitation to a private page should be limited to editors
         if ($item['active'] == 'N') {
             if ($editors = Members::list_editors_for_member($parent->get_reference(), 0, 1000, $layout)) {
コード例 #21
0
<div class="sidebar-products clearfix">
    <h2>畅销</h2>
    <?php 
foreach (Layouts::Recomman(10, 3) as $v) {
    ?>
        <div class="item">
            <a href="item.html">
                <img src="<?php 
    echo $this->img . $v['s_url'];
    ?>
" class="img-responsive" alt="<?php 
    echo $v['name'];
    ?>
">
            </a>
            <h3><a href="/product.html?id=<?php 
    echo $v['product_id'];
    ?>
" target="_blank"><?php 
    echo $v['name'];
    ?>
</a></h3>
            <div class="price">¥<?php 
    echo $v['price'];
    ?>
</div>
        </div>
    <?php 
}
?>
</div>
コード例 #22
0
<div class="row margin-bottom-40">
    <div class="col-md-12 col-sm-12 bxslider-wrapper bxslider-wrapper-similar-products">
        <h2>最受欢迎商品</h2>
        <ul class="bxslider bxslider-similar-products" data-slides-phone="1"
            data-slides-tablet="2" data-slides-desktop="4" data-slide-margin="20">
            <?php 
foreach (Layouts::Popular() as $v) {
    ?>
                <!-- PRODUCT ITEM START -->
                <?php 
    echo $this->renderPartial('/common/_detail_list', array('row' => $v));
    ?>
                <!-- PRODUCT ITEM END -->
            <?php 
}
?>
        </ul>
    </div>
</div>
コード例 #23
0
ファイル: sections.php プロジェクト: rair/yacs
 /**
  * list selected sections
  *
  * If variant is provided as a string, the functions looks for a script featuring this name.
  * E.g., for variant 'compact', the file 'sections/layout_sections_as_compact.php' is loaded.
  * If no file matches then the default 'sections/layout_sections.php' script is loaded.
  *
  * @param resource result of database query
  * @param string 'full', etc or object, i.e., an instance of Layout_Interface
  * @return NULL on error, else an ordered array with $url => ($prefix, $label, $suffix, $icon)
  *
  */
 public static function &list_selected($result, $variant = 'full')
 {
     global $context;
     // no result
     if (!$result) {
         $output = NULL;
         return $output;
     }
     // special layouts
     if (is_object($variant)) {
         $output = $variant->layout($result);
         return $output;
     }
     // get a layout
     $layout = Layouts::new_($variant, 'section', false, true);
     // do the job
     $output = $layout->layout($result);
     return $output;
 }
コード例 #24
-1
ファイル: index.php プロジェクト: rair/yacs
// the main hook
if (is_callable(array('Hooks', 'include_scripts'))) {
    $context['text'] .= Hooks::include_scripts('index.php');
}
// the list of most recent articles
switch ($context['root_articles_layout']) {
    case 'compact':
    case 'decorated':
        $layout = Layouts::new_($context['root_articles_layout'], 'article');
        break;
    case 'no_articles':
        $layout = NULL;
        break;
    default:
        // load layout, if one exists, for the home page
        $layout = Layouts::new_($context['root_articles_layout'], 'article', true);
        /*if(is_readable($context['path_to_root'].'skins/layout_home_articles_as_'.$context['root_articles_layout'].'.php')) {
        		$name = 'layout_home_articles_as_'.$context['root_articles_layout'];
        		include_once $context['path_to_root'].'skins/'.$name.'.php';
        		$layout = new $name;
        
        	// no layout to use
        	} else {
        
        		// useful warning for associates
        		if(Surfer::is_associate())
        			Logger::error(sprintf(i18n::s('Warning: No script exists for the customized layout %s'), $context['root_articles_layout']));
        
        		// load default layout
        		include_once $context['path_to_root'].'skins/layout_home_articles_as_daily.php';
        		$layout = new Layout_home_articles_as_daily();
コード例 #25
-1
ファイル: manage.php プロジェクト: rair/yacs
         $prefix = Sections::get_url($item['id'], 'manage', 'articles');
         $menu = array_merge($menu, Skin::navigate($home, $prefix, $count, $items_per_page, $zoom_index));
     }
     if (count($menu)) {
         $text .= Skin::build_list($menu, 'menu_bar');
     }
 }
 // diplay in a separate panel
 if (trim($text)) {
     $panels[] = array('articles', i18n::s('Pages'), 'articles_panel', $text);
 }
 // one tab for sections
 //
 $text = '';
 // managed sections
 $layout = Layouts::new_('manage', 'section');
 // avoid links to this page
 if (is_object($layout) && is_callable(array($layout, 'set_variant'))) {
     $layout->set_focus('section:' . $item['id']);
 }
 // the maximum number of articles per page
 if (is_object($layout)) {
     $items_per_page = $layout->items_per_page();
 } else {
     $items_per_page = SECTIONS_PER_PAGE;
 }
 // list content
 $offset = ($zoom_index - 1) * $items_per_page;
 if ($items =& Sections::list_by_title_for_anchor('section:' . $item['id'], $offset, $items_per_page, $layout)) {
     // splash
     $text .= Skin::build_block(i18n::s('Select items you want to manage, and click some button at the bottom of the page.'), 'introduction');
コード例 #26
-1
ファイル: tree_manager_ajax.php プロジェクト: rair/yacs
         $output['success'] = 'false';
         break;
     }
     // check surfer's rights
     if (is_object($anchor) && !$anchor->allows('creation') || $anchor_id == 'index' && !Surfer::is_associate()) {
         $output['success'] = 'false';
         break;
     }
     // create obj interface
     $newitem = new $type();
     // try to post
     if ($output['success'] = $newitem->post($_REQUEST['anchor'], $_REQUEST['title'])) {
         $output['title'] = $newitem->get_title();
         $output['ref'] = $newitem->get_reference();
         // ask menu rendering for this new entry
         $l = Layouts::new_('tree_manager', $type);
         if (isset($_REQUEST['variant'])) {
             $l->set_variant($_REQUEST['variant']);
         }
         $output['menu'] = $l->get_interactive_menu();
     }
     break;
     // delete the anchor with the given reference
 // delete the anchor with the given reference
 case 'delete':
     // reference to anchor is mandatory
     if (!isset($_REQUEST['anchor']) || !$_REQUEST['anchor']) {
         die_on_invalid();
     }
     // get obj interface
     if (!($to_delete = Anchors::get($_REQUEST['anchor']))) {
コード例 #27
-1
<ul class="list-group margin-bottom-25 sidebar-menu">
    <?php 
foreach (Layouts::category() as $k => $v) {
    ?>
        <?php 
    if (isset($v['cat_id']) && $v['cat_id']) {
        ?>
        <li class="list-group-item clearfix <?php 
        if ($v['child']) {
            ?>
dropdown<?php 
        }
        ?>
 <?php 
        if ($parent_id == $v['cat_id'] || $cat_id == $v['cat_id']) {
            ?>
active<?php 
        }
        ?>
">
            <a href="<?php 
        echo $v['child'] ? 'javascript:void(0);' : '/category.html?cid=' . $v['cat_id'];
        ?>
"
               <?php 
        if ($parent_id == $v['cat_id']) {
            ?>
class="collapsed" <?php 
        }
        ?>
>