Exemplo n.º 1
0
 /**
  * Initialize properties before running the controller methods (actions),
  * so they are available to our action.
  */
 public function before($template = NULL)
 {
     parent::before();
     Theme::checker();
     $this->maintenance();
     /**
      * selected category
      */
     if ($this->request->param('category', NULL) != 'all') {
         $slug_cat = new Model_Category();
         $seo_cat = $slug_cat->where('seoname', '=', $this->request->param('category'))->limit(1)->cached()->find();
         if ($seo_cat->loaded()) {
             self::$category = $seo_cat;
         }
     }
     /**
      * selected location
      */
     if ($this->request->param('location', NULL) != NULL || $this->request->param('location') != 'all') {
         $slug_loc = new Model_Location();
         $seo_loc = $slug_loc->where('seoname', '=', $this->request->param('location'))->limit(1)->cached()->find();
         if ($seo_loc->loaded()) {
             self::$location = $seo_loc;
         }
     }
     if ($this->auto_render === TRUE) {
         // Load the template
         if ($template !== NULL) {
             $this->template = $template;
         }
         $this->template = View::factory($this->template);
         // Initialize template values
         $this->template->title = core::config('general.site_name');
         $this->template->meta_keywords = '';
         $this->template->meta_description = '';
         $this->template->meta_copywrite = 'Open Classifieds ' . Core::version;
         $this->template->content = '';
         $this->template->styles = array();
         $this->template->scripts = array();
         //we can not cache this view since theres dynamic parts
         //$this->template->header  = View::factory('header');
         //setting inner views try to get from fragment
         // if (Auth::instance()->logged_in())
         //     $this->template->header  = View::fragment('header_front_login','header');
         // else
         $this->template->header = View::factory('header');
         //             $this->template->header  = View::fragment('header_front','header');
         //no fragment since CSRF gets cached :(
         $this->template->footer = View::fragment('footer_front', 'footer');
     }
 }
Exemplo n.º 2
0
 function login_post()
 {
     $user = $_POST['user'];
     $pass = $_POST['pass'];
     if (Auth::authorize($user, $pass)) {
         header('location: /');
         $content = View::fragment('<div id="login">Success</div><script type="text/javascript">location.href="/";</script>');
         die;
     } else {
         if (Config::get('open', false)) {
             Auth::add_user($user, $pass);
             Auth::authorize($user, $pass);
             header('location: /');
             $content = View::fragment('<div id="login">Success</div><script type="text/javascript">location.href="/";</script>');
             die;
         } else {
             header('location: ' . Config::get('Auth/path', '/auth') . (isset($_GET['path']) ? '?path=' . $_GET['path'] : ''));
             die;
         }
     }
     $v = new View(array('content' => $content, 'page_id' => 'loginpage'));
     echo $v->render('template');
 }
Exemplo n.º 3
0
 /**
  * Initialize properties before running the controller methods (actions),
  * so they are available to our action.
  */
 public function before($template = NULL)
 {
     parent::before();
     Theme::checker();
     $this->maintenance();
     //get category, deprecated, to keep backwards compatibility with themes
     self::$category = Model_Category::current();
     //Gets a coupon if selected
     self::$coupon = Model_Coupon::current();
     //get the affiliate if any
     Model_Affiliate::current();
     if ($this->auto_render === TRUE) {
         // Load the template
         if ($template !== NULL) {
             $this->template = $template;
         }
         $this->template = View::factory($this->template);
         // Initialize template values
         $this->template->title = core::config('general.site_name');
         $this->template->meta_keywords = '';
         $this->template->meta_description = '';
         $this->template->meta_copyright = 'Open eShop ' . Core::VERSION;
         $this->template->content = '';
         $this->template->styles = array();
         $this->template->scripts = array();
         //we can not cache this view since theres dynamic parts
         //$this->template->header  = View::factory('header');
         //setting inner views try to get from fragment
         // if (Auth::instance()->logged_in())
         //     $this->template->header  = View::fragment('header_front_login','header');
         // else
         $this->template->header = View::factory('header');
         //no fragment since CSRF gets cached :(
         $this->template->footer = View::fragment('footer_front', 'footer');
     }
 }
Exemplo n.º 4
0
}
?>
					
					<dl class="form-group">
						<dt></dt>
						<dd class="text-center"><?php 
echo FORM::button('submit', __('Contact Us'), array('type' => 'submit', 'class' => 'btn btn-success', 'action' => Route::url('contact')));
?>
</dd>
					</dl>
				</fieldset>
				<?php 
echo FORM::close();
?>
			</div>
		
			<?php 
if (Theme::get('sidebar_position') != 'none') {
    ?>
	            <?php 
    echo Theme::get('sidebar_position') == 'left' ? View::fragment('sidebar_front', 'sidebar') : '';
    ?>
	            <?php 
    echo Theme::get('sidebar_position') == 'right' ? View::fragment('sidebar_front', 'sidebar') : '';
    ?>
	        <?php 
}
?>
	    </div>
	</div>
</div>
Exemplo n.º 5
0
				<?php 
echo FORM::close();
?>

				<div class="modal modal-statc fade" id="processing-modal" data-backdrop="static" data-keyboard="false">
					<div class="modal-body">
						<div class="modal-dialog">
							<div class="modal-content">
								<div class="modal-header">
									<h4 class="modal-title"><?php 
echo _e('Processing...');
?>
</h4>
								</div>
								<div class="modal-body">
									<div class="progress progress-bar-success progress-striped active">
										<div class="progress-bar" style="width: 100%"></div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		<?php 
echo View::fragment('sidebar_front', 'sidebar');
?>
        </div>

	</div>
</div>