public function results()
 {
     $keywords = Input::get('words');
     $this->data['words'] = strip_tags($keywords);
     $this->data['results'] = Post::search($keywords);
     if (count($this->data['results']) === 1) {
         return Illuminate\Support\Facades\Redirect::to(WebAPL\Language::url('topost/' . $this->data['results'][0]->id));
     }
     WebAPL\Template::setPageTitle("Search: {$this->data['words']}", true);
     PageController::loadGeneralResources();
     $this->layout->content = View::make('sections.search.results', $this->data);
 }
Beispiel #2
0
            </li>
            <li>
                <p><?php 
echo varlang('fax');
?>
</p>
                <p><?php 
echo varlang('nr-fax');
?>
</p>
            </li>
            <div class="clearfix"></div>
        </ul>
        <div class="prp">
            <a href="<?php 
echo WebAPL\Language::url('topropr/more_contacts');
?>
"><?php 
echo varlang('all-nr-phone');
?>
</a>
        </div>
        <div class="prp">
            <a href="<?php 
echo varlang('orar-link');
?>
"><?php 
echo varlang('orar-autobus');
?>
</a>
        </div>
Beispiel #3
0
    foreach ($item['list'] as $sitem) {
        ?>
        <li>
            <p><a href='<?php 
        echo WebAPL\Language::url('topost/' . $sitem->id);
        ?>
'><?php 
        echo $sitem->title;
        ?>
</a></p>
            <ul>
                <?php 
        foreach ($sitem['list'] as $titem) {
            ?>
                <li><a href='<?php 
            echo WebAPL\Language::url('topost/' . $titem->id);
            ?>
'><?php 
            echo $titem->title;
            ?>
</a></li>
                <?php 
        }
        ?>
            </ul>
        </li>
        <?php 
    }
    ?>
    </ul>
    <?php 
Beispiel #4
0
 public static function getURL($uri)
 {
     return WebAPL\Language::url("page/" . $uri);
 }
Beispiel #5
0
 public function route($query = '')
 {
     $parts = explode('/', $query);
     if ($parts) {
         $uri = end($parts);
         $this->data['page'] = Post::findURI($uri, 1);
         if ($this->data['page']) {
             PostResources::init();
             // Verify if page is redirectable
             if ($this->data['page']->redirect_to) {
                 $redirect_url = Post::getFullURI($this->data['page']->redirect_to);
                 if ($redirect_url) {
                     return Redirect::to($redirect_url);
                 }
             }
             // Verify if page is redirectable
             if ($this->data['page']->redirect_to) {
                 $redirect_url = Post::getFullURI($this->data['page']->redirect_to);
                 if ($redirect_url) {
                     return Redirect::to($redirect_url);
                 }
             }
             Template::clearBreadCrumbs();
             Template::addBreadCrumb("/", varlang('acasa'));
             // Get pages resources
             $this->data['parents'] = Post::getParents($this->data['page']['parent'], 1);
             $this->data['parent'] = Post::findID($this->data['page']['parent'], 1);
             $this->data['colevels'] = Post::findWithParent($this->data['page']['parent']);
             $this->data['super_parent'] = array_first($this->data['parents'], function ($key, $item) {
                 return $item['parent'] == 0;
             });
             // get real page URI
             $segments = array();
             $parrents_ids = array($this->data['page']->id);
             foreach (array_reverse($this->data['parents']) as $parrent) {
                 $segments[] = $parrent['uri'];
                 $parrents_ids[] = $parrent['id'];
                 Template::addBreadCrumb(Post::getURL(implode('/', $segments)), $parrent['title']);
             }
             $segments[] = $this->data['page']['uri'];
             Template::addBreadCrumb(Post::getURL($query), $this->data['page']['title']);
             $realURI = implode('/', $segments);
             // Verify if real uri is correct
             if ($realURI === $query) {
                 // get global data
                 View::share(array('active_page_id' => $this->data['page']->id, 'parrents_ids' => $parrents_ids, 'super_parent' => $this->data['super_parent']));
                 // Verify if this page is clone
                 if ($this->data['page']->clone_id) {
                     $clone = Post::findID($this->data['page']->clone_id, 1);
                     if ($clone) {
                         $this->data['page'] = $clone;
                     }
                 }
                 // Set page title
                 $this->data['top_title'] = $this->data['page']['title'];
                 WebAPL\Template::setPageTitle($this->data['page']['title']);
                 $this->data['page_url'] = WebAPL\Language::url("page/" . $realURI);
                 // Get page files
                 if ($this->data['page']->show_files) {
                     $this->data['page']['files'] = Files::where(array('module_name' => 'page', 'module_id' => $this->data['page']->id, 'type' => 'document'))->remember(SettingsModel::one('cachelife'))->get();
                 } else {
                     $this->data['page']['files'] = array();
                 }
                 // register one view
                 Post::oneView($this->data['page']['id']);
                 Template::setMetaMultiple(array('og:title' => $this->data['page']->title, 'description' => $this->data['page']->text, 'og:description' => $this->data['page']->text), true);
                 // load page
                 PageController::loadGeneralResources();
                 View::share('page', $this->data['page']);
                 if ($this->data['page']->general_node) {
                     return $this->loadHome();
                 } else {
                     return $this->loadPage();
                 }
             } else {
                 throw new Exception("Query '{$query}' is not valid", 404);
             }
         } else {
             throw new Exception("Page with uri '{$uri}' not found", 404);
         }
     } else {
         throw new Exception("No valid page URI", 404);
     }
 }
Beispiel #6
0
                    $(".firechat-person").text(data.person.first_name + " " + data.person.last_name + " " + data.person.function);
                    $(".firechat-photo img").attr('src', data.person.photo);

                    $(".firechat-photo, .firechat-name").show();

                    current_person = data.person.id;
                } else {
                    alert('Chat error!');
                    //window.location.reload();
                }
            }, 'json');

            return false;
        });

        $("body").on('click', '.firechat-inactive', function() {
            $(".firechat-photo, .firechat-name").hide();
            $("#firechat .content").html('<center><br><br><br><?php 
echo varlang('chat-erro');
?>
 <a href="<?php 
echo WebAPL\Language::url('topage/page_calendar');
?>
" style="color:#673167"><?php 
echo varlang('chat-erro-no');
?>
</a></center>').show();
            $("#firechat").stop().slideToggle(500).animate({height: 535}, 500);
        });
    });
</script>