Exemple #1
0
 /**
  *
  * Display single page
  * @throws HTTP_Exception_404
  */
 public function action_view()
 {
     $seotitle = $this->request->param('seotitle', NULL);
     if ($seotitle !== NULL) {
         $page = Model_Content::get($seotitle);
         if ($page->loaded()) {
             Breadcrumbs::add(Breadcrumb::factory()->set_title(__('Home'))->set_url(Route::url('default')));
             Breadcrumbs::add(Breadcrumb::factory()->set_title($page->title));
             $this->template->title = $page->title;
             $this->template->meta_description = $page->description;
             $this->template->bind('content', $content);
             $this->template->content = View::factory('page', array('page' => $page));
         } else {
             //throw 404
             throw new HTTP_Exception_404();
         }
     } else {
         //throw 404
         throw new HTTP_Exception_404();
     }
 }
Exemple #2
0
<?php

defined('SYSPATH') or die('No direct script access.');
?>

<div id="accept_terms_modal" class="modal fade" data-backdrop="static">
	<?php 
$content = Model_Content::get(core::config('general.alert_terms'));
?>
	<div class="modal-dialog">
	    <div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" onclick='location.href="http://www.google.com"' aria-hidden="true">&times;</button>
				<h1><?php 
echo $content->title;
?>
</h1>
			</div>
			<div class="modal-body">
				<p><?php 
echo Text::bb2html($content->description, TRUE);
?>
</p>
			</div>
			<div class="modal-footer">
				<a name="decline_terms" class="btn btn-default" onclick='location.href="http://www.google.com"' ><?php 
echo __('No');
?>
</a>
				<a name="accept_terms" class="btn btn-success" onclick='setCookie("accept_terms",1,10000)' data-dismiss="modal" aria-hidden="true"><?php 
echo __('I accept');
Exemple #3
0
 /**
  * sends an email using content from model_content
  * @param  string $to        
  * @param  string $to_name   
  * @param  string $from      
  * @param  string $from_name 
  * @param  string $content   seotitle from Model_Content
  * @param  array $replace   key value to replace at subject and body
  * @param  array $file      file to attach to email
  * @return boolean            s
  */
 public static function content($to, $to_name = '', $from = NULL, $from_name = NULL, $content, $replace, $file = NULL)
 {
     $email = Model_Content::get($content, 'email');
     $ad_obj = new Model_Ad();
     //content found
     if ($email->loaded()) {
         if ($replace === NULL) {
             $replace = array();
         }
         if ($from === NULL) {
             $from = $email->from_email;
         }
         if ($from_name === NULL) {
             $from_name = core::config('general.site_name');
         }
         if (isset($file) and $ad_obj->is_valid_file($file)) {
             $file_upload = $file;
         } else {
             $file_upload = NULL;
         }
         //adding extra replaces
         $replace += array('[SITE.NAME]' => core::config('general.site_name'), '[SITE.URL]' => core::config('general.base_url'), '[USER.NAME]' => $to_name, '[USER.EMAIL]' => $to);
         //adding anchor tags to any [URL.* match
         foreach ($replace as $key => $value) {
             if (strpos($key, '[URL.') === 0 or $key == '[SITE.URL]') {
                 $replace[$key] = '[url=' . $value . ']' . $value . '[/url]';
             }
         }
         $subject = str_replace(array_keys($replace), array_values($replace), $email->title);
         $body = str_replace(array_keys($replace), array_values($replace), $email->description);
         return Email::send($to, $to_name, $subject, $body, $from, $from_name, $file_upload);
     } else {
         return FALSE;
     }
 }