Exemplo n.º 1
0
 function alter(Layout $layout)
 {
     $matched = $layout->find($this->path);
     if ($matched) {
         $this->mergeInto($matched->blocks);
     } elseif (count($this->path) == 2 and !reset($this->path) and $view = $layout->find('')) {
         $view->add(array(join('.', end($this->path)) => $this->blocks));
     } else {
         Log::info_Alter("No matching block [{$this->pathStr()}] to {$this->type}.");
     }
     return $this;
 }
Exemplo n.º 2
0
 public static function passLayout()
 {
     $id = AppHelper::getLayoutId();
     $layout = Layout::find($id);
     //return $layout->full_layout;
     eval('?' . '>' . $layout->full_layout);
 }
 public function updateDevice()
 {
     $name = Input::get('name');
     $dtp = Input::get('dtp');
     $layout = Layout::find(Input::get('id'));
     if (!empty($name)) {
         $layout->name = $name;
     }
     if (!empty($dtp)) {
         $layout->dtp = $dtp;
     }
     $layout->save();
 }
 public static function get_layouts($id = null)
 {
     // We return an array if returning all layouts
     // Other wise return the object if we looking up a specific layout id
     $return = array();
     // Are we looking for a specific studio layout id?
     // If not we return all layouts
     if ($id) {
         // Return a specific studio layout by ID
         if (($data = Layout::find($id)) != NULL) {
             $data->formatted_cost = $data->cost == '' ? '' : '£' . number_format($data->cost, 2);
             $return = $data;
         }
     } else {
         // Get all studio layout data and iterate the returned data
         $layouts = DB::table('quotation_layouts')->order_by('size_y', 'asc')->order_by('size_x', 'asc')->get();
         foreach ($layouts as $layout) {
             $layout->formatted_cost = $layout->cost == '' ? '' : '£' . number_format($layout->cost, 2);
             $code = str_replace('.', '', $layout->size_x) . 'x' . str_replace('.', '', $layout->size_y);
             $return[$code] = $layout;
         }
     }
     return $return;
 }
 private function loadQuote(Quotation $quote)
 {
     // Find layout
     $layout = Layout::find($quote->quotation_layouts_id);
     $customer = Customer::find($quote->customer_id);
     // Init
     \Laravel\Session::put('quote_id', $quote->id);
     \Laravel\Session::put('quote_email', $customer->email);
     \Laravel\Session::put('quote_layout', $layout);
     \Laravel\Session::put('quote_layout_id', $layout->id);
     \Laravel\Session::put('quote_size', $layout->size_x . 'x' . $layout->size_y);
     \Laravel\Session::put('quote_postcode', $quote->postcode);
     //Customise
     \Laravel\Session::put('quote_customise_swap_window', $quote->quote_customise_swap_window);
     \Laravel\Session::put('quote_customise_swap_wall', $quote->quote_customise_swap_wall);
     \Laravel\Session::put('quote_customise_extra_door', $quote->quote_customise_extra_door);
     \Laravel\Session::put('quote_customise_fanlight', $quote->quote_customise_fanlight);
     \Laravel\Session::put('quote_customise_half_window', $quote->quote_customise_half_window);
     \Laravel\Session::put('quote_customise_picture_window', $quote->quote_customise_picture_window);
     //Decking & floyover
     \Laravel\Session::put('quote_decking_composite_deck_910_910', $quote->quote_decking_composite_deck_910_910);
     \Laravel\Session::put('quote_decking_composite_deck_910_1820', $quote->quote_decking_composite_deck_910_1820);
     \Laravel\Session::put('quote_decking_composite_deck_910_2730', $quote->quote_decking_composite_deck_910_2730);
     \Laravel\Session::put('quote_decking_flyover_roof_910_910', $quote->quote_decking_flyover_roof_910_910);
     \Laravel\Session::put('quote_decking_flyover_roof_910_1820', $quote->quote_decking_flyover_roof_910_1820);
     \Laravel\Session::put('quote_decking_flyover_roof_910_2730', $quote->quote_decking_flyover_roof_910_2730);
     // Electrics
     \Laravel\Session::put('quote_electrics_double_sockets_450', $quote->quote_electrics_double_sockets_450);
     \Laravel\Session::put('quote_electrics_double_sockets_1150', $quote->quote_electrics_double_sockets_1150);
     \Laravel\Session::put('quote_electrics_light_switch', $quote->quote_electrics_light_switch);
     \Laravel\Session::put('quote_electrics_panel_heater', $quote->quote_electrics_panel_heater);
     \Laravel\Session::put('quote_electrics_double_floor_socket', $quote->quote_electrics_double_floor_socket);
     \Laravel\Session::put('quote_electrics_fused_spur_socket', $quote->quote_electrics_fused_spur_socket);
     // Internals
     \Laravel\Session::put('quote_internals_silver_aluminium_venitian_blind_no_screws', $quote->quote_internals_silver_aluminium_venitian_blind_no_screws);
     \Laravel\Session::put('quote_internals_recessed_blinds', $quote->quote_internals_recessed_blinds);
     \Laravel\Session::put('quote_internals_internal_910_partition_wall', $quote->quote_internals_internal_910_partition_wall);
     \Laravel\Session::put('quote_internals_internal_door_dividing_studio', $quote->quote_internals_internal_door_dividing_studio);
     \Laravel\Session::put('quote_internals_internal_wall_corner_post', $quote->quote_internals_internal_wall_corner_post);
     // Other
     \Laravel\Session::put('quote_other_decoupled_floor', $quote->quote_other_decoupled_floor);
     \Laravel\Session::put('quote_other_aquastep_oak_floor', $quote->quote_other_aquastep_oak_floor);
     \Laravel\Session::put('quote_other_walls_to_timber', $quote->quote_other_walls_to_timber);
     \Laravel\Session::put('quote_other_taller_walls', $quote->quote_other_taller_walls);
     \Laravel\Session::put('quote_other_entry_steps', $quote->quote_other_entry_steps);
     \Laravel\Session::put('quote_other_entry_handrail', $quote->quote_other_entry_handrail);
     \Laravel\Session::put('quote_other_skirt', $quote->quote_other_skirt);
 }
Exemplo n.º 6
0
 function index()
 {
     $this->display('layout/index', array('layouts' => Layout::find(array('order' => 'position'))));
 }
Exemplo n.º 7
0
            $output = $dispatchContent;
        } else {
            header('Content-Type: text/html; charset=utf-8');
            // Include a themes init file, to allow a theme to configure some things
            $initFile = $zula->getDir('themes') . '/' . $themeName . '/init.php';
            if (is_readable($initFile)) {
                include $initFile;
            }
            /**
             * Work out which layout to use with the theme, load all cntrlrs from that
             * and then load the main dispatchers content
             */
            if ($zula->getState() == 'setup') {
                $layout = new Layout($zula->getDir('setup') . '/layout.xml');
            } else {
                $layout = new Layout(Layout::find($requestedUrl->siteType, $router->getRawRequestPath()));
            }
            $theme->loadDispatcher($dispatchContent, $dispatcher);
            $theme->loadLayout($layout);
            $output = $theme;
        }
    } catch (Theme_NoExist $e) {
        Registry::get('log')->message($e->getMessage(), Log::L_WARNING);
        trigger_error('required theme "' . $themeName . '" does not exist', E_USER_WARNING);
        $output = $dispatcher->dispatch($requestedUrl, $dispatchConfig);
    }
} else {
    $output = $dispatcher->dispatch($requestedUrl, $dispatchConfig);
    if ($zula->getMode() == 'cli') {
        // Display a friendly message to stdout
        switch ($dispatcher->getStatusCode()) {
Exemplo n.º 8
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     Layout::find(1)->Elements()->detach();
     //$element_layout = Element_Layout::find($id);
     //$element_layout->delete();
     //return redirect('element_layout');
 }
Exemplo n.º 9
0
 public static function getLayoutName()
 {
     $id = AppHelper::getLayoutId();
     $layout_name = Layout::find($id);
     return $layout_name->name;
 }
Exemplo n.º 10
0
 /**
  * search 
  * 
  * @return Response
  */
 public function search()
 {
     $query = Input::get('q');
     $page = Input::get('page');
     $posts = [];
     if ($query) {
         $posts = Post::search($query);
     }
     if (count($posts)) {
         $url = sprintf('/search?q=%s&page=:page', rawurlencode($query));
         $paginator = Paginator::get($posts, $page, $url);
     } else {
         $paginator = null;
     }
     $html = Layout::find('search')->render(['search' => true, 'query' => $query, 'paginator' => $paginator]);
     return Response::make($html);
 }
Exemplo n.º 11
0
 public function edit($id = null)
 {
     if (is_null($id)) {
         redirect(get_url('page'));
     }
     $page = Page::findById($id);
     if (!$page) {
         Flash::set('error', __('Page not found!'));
         redirect(get_url('page'));
     }
     // check for protected page and editor user
     if (!AuthUser::hasPermission('administrator') && !AuthUser::hasPermission('developer') && $page->is_protected) {
         Flash::set('error', __('You do not have permission to access the requested page!'));
         redirect(get_url('page'));
     }
     // check if trying to save
     if (get_request_method() == 'POST') {
         return $this->_edit($id);
     }
     // find all page_part of this pages
     $page_parts = PagePart::findByPageId($id);
     if (empty($page_parts)) {
         $page_parts = array(new PagePart());
     }
     $tag_array = array();
     foreach ($page->tags() as $tag) {
         $tag_array[] = $tag->name();
     }
     // display things ...
     $this->setLayout('backend');
     $this->display('page/edit', array('action' => 'edit', 'page' => $page, 'tags' => $tag_array, 'filters' => Filter::findAll(), 'behaviors' => Behavior::findAll(), 'page_parts' => $page_parts, 'layouts' => Layout::find(array('order' => 'position'))));
 }
Exemplo n.º 12
0
 public function get_view()
 {
     $layout = Layout::find($this->layout_id);
     return View::make('user.pricing.view')->with('layout', $layout);
 }
Exemplo n.º 13
0
 /**
  * @expectedException NotFoundException
  */
 public function testFindNotFound()
 {
     Layout::find('xxx');
 }
Exemplo n.º 14
0
 public static function getAuthorName()
 {
     $id = AppHelper::getLayoutId();
     $layout = Layout::find($id);
     return $layout->author;
 }