Beispiel #1
0
 public function index()
 {
     $view = new View(url::location());
     $view->articles = orm::factory('news')->where('group', 'site')->where('status', 'approved')->find_all(6);
     $this->template->title = 'About Us › News & Updates';
     $this->template->content = $view;
 }
Beispiel #2
0
 public function login()
 {
     // Load the view
     $view = new view(url::location());
     // populate the post information if it exists
     $view->post = array();
     // assign the form post information, if it exists
     $view->post['unique'] = isset($this->post['unique']) ? $this->post['unique'] : '';
     // HAXXX
     $view->title = 'Spicers | Admin Login';
     $view->base_href = isset($this->base_href) ? $this->base_href : 'http://' . $_SERVER['HTTP_HOST'] . url::base();
     if ($this->notification->count()) {
         $view->notifications = View::factory('templates/notification_ajax', array('notifications' => $this->notification->get()));
     }
     $this->auth = new Security();
     if ($this->auth->logged_in()) {
         // note if they do not have access to the dashboard and they are signed in, this will
         // start an infinate loop. @todo fix this. maybe just a check to see if they have access
         // before the redirect - jpeake
         url::redirect('home');
         die;
     }
     echo $view;
     die;
 }
Beispiel #3
0
 public function index()
 {
     $view = new View(url::location());
     $this->template->title = 'Retail';
     $view->breadcrumbs = $this->breadcrumbs->cut();
     $this->template->content = $view;
 }
Beispiel #4
0
 /**
  * Used to display the index page but also uses a jquery and the pagination to do preload of next pages
  * of the news articles. Which are then displaye don scroll 
  * @param integer $page the page number  (Matt are you sure this is needed, the pagination is smart enough not to need this). 
  */
 public function index($page = 1)
 {
     $total = orm::factory('news')->where('group', 'site')->where('status', 'approved')->count_all();
     $paging = new Pagination(array('total_items' => $total, 'items_per_page' => 3));
     $articles = orm::factory('news')->where('group', 'site')->where('status', 'approved')->find_all($paging->items_per_page, $paging->sql_offset);
     $view = new View(url::location());
     $view->articles = $articles;
     $view->pagination = $paging->render();
     $view->page_number = $paging->page_number();
     // If the request is an ajax request, then the page is attempting to autoupdate
     // the items with in the news, so just send through the news items.
     if (request::is_ajax()) {
         // if the ajax is attempting to get a page which doesnt exist, send 404
         if ($page > $paging->total_pages) {
             Event::run('system.404');
         } else {
             $this->ajax['view'] = $view;
         }
     } else {
         // otherwise its a http request, send throught he entire page with template.
         $this->template->title = 'About Us › News & Updates Archive';
         $this->breadcrumbs->add()->url(false)->title('Archive');
         $view->breadcrumbs = $this->breadcrumbs->cut();
         $this->template->content = $view;
     }
 }
Beispiel #5
0
 public function parners()
 {
     $view = new View(url::location());
     $this->template->title = 'About Us › Global Alliances › Partners';
     $this->breadcrumbs->add()->url(false)->title('Partners');
     $view->breadcrumbs = $this->breadcrumbs->cut();
     $this->template->content = $view;
 }
Beispiel #6
0
 public function brochure()
 {
     $view = new View(url::location());
     $this->template->title = 'Pre-media Solutions › Request Brochure or Demo';
     $this->breadcrumbs->add()->url(false)->title('Request Brochure or Demo');
     $view->breadcrumbs = $this->breadcrumbs->cut();
     $this->template->content = $view;
 }
Beispiel #7
0
 public function contact()
 {
     $view = new View(url::location());
     $this->template->title = 'About Us › Contact Us';
     $this->breadcrumbs->add()->url(false)->title('Contact Us');
     $view->breadcrumbs = $this->breadcrumbs->cut();
     $this->template->content = $view;
 }
Beispiel #8
0
 public function faq()
 {
     $view = new View(url::location());
     $this->template->title = 'FAQ';
     $this->breadcrumbs->add()->url(false)->title('Education');
     $view->breadcrumbs = $this->breadcrumbs->cut();
     $this->template->content = $view;
 }
Beispiel #9
0
 /**
  * This is a place holder to be removed one we have a spec for the stick items, 
  * 
  * Thisis cause sticky ites are sreaiuly just papers, witha  flag of type set to sticky.
  * Also it would make sence for theis to eb with in the oparent item. 
  * 
  * As we may one day require that wer can edi tythis timem s. 
  * 
  */
 public function sticky()
 {
     $view = new View(url::location());
     $this->template->title = 'Products › Sticky Papers';
     $this->breadcrumbs->add()->url(false)->title('Sticky Papers');
     $view->breadcrumbs = $this->breadcrumbs->cut();
     $this->template->content = $view;
 }
Beispiel #10
0
 public function environmental()
 {
     $view = new View(url::location());
     $this->template->title = 'Resources › Icons › Environmental';
     $this->breadcrumbs->add()->url(false)->title('Environmental');
     $view->breadcrumbs = $this->breadcrumbs->cut();
     $this->template->content = $view;
 }
Beispiel #11
0
 public function brochure()
 {
     $view = new View(url::location());
     $this->template->title = 'Pre-Media';
     $this->breadcrumbs->add()->url(false)->title('Pre-Media');
     $view->breadcrumbs = $this->breadcrumbs->cut();
     $this->template->content = $view;
 }
Beispiel #12
0
 public function calculators()
 {
     $view = new View(url::location());
     $this->template->title = 'Resources › Calculators';
     $this->breadcrumbs->add()->url(false)->title('Calculators');
     $view->breadcrumbs = $this->breadcrumbs->cut();
     $this->template->content = $view;
 }
Beispiel #13
0
 public function glossary()
 {
     $view = new View(url::location());
     $this->template->title = 'Environmental › Glossary';
     $this->breadcrumbs->add()->url(false)->title('Glossary');
     $view->breadcrumbs = $this->breadcrumbs->cut();
     $view->glossaries = orm::factory('glossary')->where('status', 'approved')->find_all();
     $this->template->content = $view;
 }
Beispiel #14
0
 /** 
  * This page will display a page much like the page for the paper products. 
  * 
  * the expcetion will be it will have multiple images and missing some of the relationships that 
  * the papers have.
  * 
  * 
  * @param unknown_type $name
  */
 public function view($name)
 {
     // clean the input, remove and opf the escape characters
     $name = url::encode($name);
     $industrial = orm::factory('industrial')->where('name', $name)->find_all();
     //if ($industrial->loaded)
     //{
     $view = new view(url::location());
     $view->industrial = $industrial[0];
     $this->template->title = ucwords($name);
     $this->template->content = $view;
     //}
     //else
     //{
     // unable to find the industrial item
     //}
 }
Beispiel #15
0
 public static function header($form = array())
 {
     if (is_string($form) || is_numeric($form)) {
         $form = array('globalid' => $form);
     }
     if (is_array($form)) {
         $form += array('class' => 'form', 'method' => 'post', 'action' => url::location(), 'globalid' => 0);
     }
     $html[] = '';
     if (arr::take('valid', $form) !== false) {
         $html[] = html::script('$common/js/jquery.validate.js');
     }
     if (arr::take('ajax', $form) !== false) {
         $html[] = html::script('$common/js/jquery.form.js');
     }
     $icon = arr::take('icon', $form);
     $title = arr::take('title', $form);
     $description = arr::take('description', $form);
     $globalid = arr::take('globalid', $form);
     $template = arr::take('template', $form);
     if (!empty($template)) {
         form::$template = $template;
     }
     //加载表头
     $html[] = '<form' . html::attributes($form) . '>';
     $html[] = field::hidden(array('name' => '_REFERER', 'value' => url::referer()));
     $html[] = field::hidden(array('name' => '_FORMHASH', 'value' => form::hash()));
     $html[] = field::hidden(array('name' => '_GLOBALID', 'value' => empty($globalid) ? form::globalid() : $globalid));
     //表单头部
     if (isset($title) || isset($description)) {
         $html[] = '<div class="form-header clearfix">';
         if (isset($icon)) {
             $html[] = '<div class="form-icon"><div class="zotop-icon zotop-icon-' . $icon . '"></div></div>';
         }
         if (isset($title)) {
             $html[] = '	<div class="form-title">' . $title . '</div>';
         }
         if (isset($description)) {
             $html[] = '	<div class="form-description">' . $description . '</div>';
         }
         $html[] = '</div>';
     }
     $html[] = '<div class="form-body clearfix">';
     $html[] = '';
     echo implode("\n", $html);
 }
Beispiel #16
0
 public function add()
 {
     if ($this->access->allowed('inspirations', 'create')) {
         $this->template->title = 'Add Inspiration';
         $this->breadcrumbs->add()->url(FALSE)->title('Add Inspiration');
         $view = new view(url::location());
         $user = new User_Model(NULL, 'default');
         $user = $user->find_all();
         $view->users = $user;
         $view->applications = ORM::factory('application')->find_all();
         $view->industries = orm::factory('industry')->find_all();
         $view->post = $this->post;
         $this->template->content = $view;
     } else {
         url::failed();
     }
 }
Beispiel #17
0
 public function view($name)
 {
     $name = url::decode($name);
     // check it exists and is published
     $campaign = orm::factory('campaign')->where('name', $name)->where('status', 'approved')->find();
     if ($campaign->loaded) {
         $this->breadcrumbs->add()->url('campaigns')->title('Campaigns');
         $this->breadcrumbs->add()->url(false)->title($campaign->name);
         $this->template->title = 'Campaigns &rsaquo; ' . $campaign->name;
         $view = new view(url::location());
         $view->campaign = $campaign;
         $view->breadcrumbs = $this->breadcrumbs->cut();
         $this->template->content = $view;
     } else {
         $this->notification->add($this->i18n['system.campaign.invalid']);
         url::redirect(url::routes_area());
     }
 }
Beispiel #18
0
 public function actionInfo()
 {
     $user = zotop::model('system.user');
     $user->id = (int) zotop::user('id');
     if (form::isPostBack()) {
         $post = form::post();
         $update = $user->update($post, $user->id);
         if ($update) {
             msg::success('资料设置成功,正在刷新页面,请稍后……', url::location());
         }
         msg::error();
     }
     $data = $user->read();
     $page = new page();
     $page->title = zotop::t('个人中心');
     $page->set('navbar', $this->navbar());
     $page->set('globalid', $user->globalid());
     $page->set('data', $data);
     $page->display();
 }
Beispiel #19
0
 public function edit($id)
 {
     if ($this->access->allowed('glossaries', 'update')) {
         $glossary = orm::factory('glossary', $id);
         if ($glossary->loaded) {
             $this->breadcrumbs->add()->url(false)->title($glossary->name);
             $view = new view(url::location());
             $view->glossary = $glossary;
             $this->template->title = 'Edit Glossary Article';
             $this->template->content = $view;
         } else {
             // tell the user that the article doesnt exist
             // @todo add notification
             //$this->notification->add();
             url::redirect(url::routes_area());
         }
     } else {
         Kohana::log('debug', 'User failed method security check');
         url::failed();
     }
 }
Beispiel #20
0
 public function index($type = NULL)
 {
     //Event::add('system.post_controller', 'foo');
     if ($this->access->allowed('papers', 'read')) {
         $filtered = in_array($type, array('standard', 'digital', 'sticky'));
         $total = ORM::factory('paper')->where('status != ', 'deleted');
         if ($filtered) {
             $total->where('type', $type);
         }
         $total = $total->count_all();
         $paging = new Pagination(array('total_items' => $total));
         $view = new view(url::routes_area() . 'index');
         $list = new view(url::routes_area() . 'index_list');
         $list_papers = ORM::factory('paper')->orderby('name', 'asc')->where('status != ', 'deleted');
         if ($filtered) {
             $list_papers->where('type', $type);
         }
         $list->papers = $list_papers->find_all($paging->items_per_page, $paging->sql_offset);
         if (request::is_ajax()) {
             // ajax request return all the data the index will require to repopulate
             $this->ajax['list'] = $list->__toString();
             $this->ajax['page_number'] = $paging->page_number()->__toString();
             $this->ajax['pagination'] = $paging->render();
         } else {
             if ($filtered) {
                 // replace the last bread crumb
                 $this->breadcrumbs->add()->url(url::location())->title(ucwords($type));
             }
             $view->pagination = $paging->render();
             $view->page_number = $paging->page_number();
             $view->list = $list;
             $this->template->content = $view;
             $this->template->title = $filtered ? ucwords($type) . ' Papers' : 'Papers';
         }
     } else {
         Kohana::log('debug', 'User failed constructor security check');
         url::failed();
     }
 }
Beispiel #21
0
 public static function header($form = array())
 {
     if (is_string($form)) {
         $form['description'] = $form;
     }
     form::$template = isset($form['template']) ? $form['template'] : form::$template;
     form::$globalid = isset($form['globalid']) ? $form['globalid'] : form::$globalid;
     //form 标签
     $attrs['class'] = isset($form['class']) ? $form['class'] : 'form';
     $attrs['method'] = isset($form['method']) ? $form['method'] : 'post';
     $attrs['target'] = isset($form['target']) ? $form['target'] : '';
     $attrs['action'] = isset($form['action']) ? $form['action'] : url::location();
     if (isset($form['enctype']) || isset($form['upload'])) {
         $attrs['enctype'] = 'multipart/form-data';
     }
     //加载表头
     $html[] = '';
     $html[] = '<form' . html::attributes($attrs) . '>';
     $html[] = field::hidden(array('name' => '_REFERER', 'value' => request::referer()));
     $html[] = field::hidden(array('name' => '_FORMHASH', 'value' => form::hash()));
     $html[] = field::hidden(array('name' => '_GLOBALID', 'value' => form::globalid()));
     //加载常用js
     if ($form['valid'] !== false) {
         $html[] = html::script(ZOTOP_APP_URL_JS . '/jquery.validate.js');
     }
     if ($form['ajax'] !== false) {
         $html[] = html::script(ZOTOP_APP_URL_JS . '/jquery.form.js');
     }
     //表单头部
     if (isset($form['title']) || isset($form['description'])) {
         $html[] = '<div class="form-header clearfix">';
         $html[] = isset($form['title']) ? '		<div class="form-title">' . $form['title'] . '</div>' : '';
         $html[] = isset($form['description']) ? '		<div class="form-description">' . $form['description'] . '</div>' : '';
         $html[] = '</div>';
     }
     //表单body部分开始
     $html[] = '<div class="form-body">';
     echo implode("\n", $html);
 }
Beispiel #22
0
		$('button[name=options]').click(function(){
			location.href = "<?php 
echo zotop::url('site://');
?>
";
		});
	});
</script>
<div id="topbar">
	<a href="<?php 
echo zotop::url('site://');
?>
">网站首页</a>
	<b>|</b>
	<a href="javascript:void(0);" class="addFavorite">加入收藏夹</a>
	<b>|</b>
	<a href="<?php 
echo zotop::url('zotop/login/shortcut', array('title' => url::encode($title), 'url' => url::encode(url::location())));
?>
">设为桌面图标</a>		
</div>

<?php 
box::header(array('title' => $title, 'icon' => 'user', 'action' => ''));
form::header(array('title' => '', 'description' => '请输入您的帐户和密码登录', 'class' => 'small'));
form::field(array('type' => 'text', 'label' => zotop::t('帐 户'), 'name' => 'username', 'value' => zotop::cookie('username'), 'valid' => 'required:true'));
form::field(array('type' => 'password', 'label' => zotop::t('密 码'), 'name' => 'password', 'value' => '', 'valid' => 'required:true'));
form::buttons(array('type' => 'submit', 'value' => '登录'), array('type' => 'button', 'name' => 'options', 'value' => '取消'));
form::footer();
box::footer();
$this->footer();
Beispiel #23
0
 public function edit($id = NULL)
 {
     if ($this->access->allowed('billboards', 'update')) {
         if ($id != NULL) {
             $billboard = orm::factory('billboard')->find($id);
             if ($billboard->loaded) {
                 $view = new view(url::location());
                 $view->billboard = $billboard;
                 $this->template->title = 'Edit Billboard';
                 $this->template->content = $view;
             } else {
                 $this->notification->add($this->i18n['system.billboard.failed']);
                 url::redirect(url::routes_area());
             }
         } else {
             $this->notification->add($this->i18n['system.billboard.failed']);
             url::redirect(url::routes_area());
         }
     } else {
         url::failed();
     }
 }
Beispiel #24
0
 /**
  * Method for editing the locations, ie. display the information in text boxes to be edited by the end user. 
  * This will be moved into the main modules for the hive framework. 
  * 
  * @todo move to the framework. 
  * @param integer $id tghe id of the location to edit. 
  */
 public function edit($id)
 {
     if ($this->access->allowed('locations', 'update')) {
         $view = new view(url::location());
         $location = ORM::factory('location')->find($id);
         if ($location->loaded) {
             $this->template->title = ucwords($location->name);
             $this->breadcrumbs->add()->url('locations/index/' . $location->group)->title(ucwords($location->group));
             // add the group filter to the crumb
             $this->breadcrumbs->add()->url(false)->title($location->name);
             $view->location = $location;
             $this->template->content = $view;
         } else {
             $this->notification->add($this->i18n['system.location.invalid'], $name);
             url::redirect(url::area());
         }
     } else {
         url::failed();
     }
 }
Beispiel #25
0
 public function recover()
 {
     if (kohana::config('password_reset.enabled')) {
         $view = new View(url::location());
         $this->template->title = 'Reset User Password';
         // fill in the information and reshow the form
         $view->email = $this->input->post('email');
         $this->template->content = $view;
     } else {
         $this->notification->add($i18n['system.reset.disabled']);
         url::redirect(url::area() . 'login');
     }
 }
Beispiel #26
0
 public function edit($id = NULL)
 {
     if ($this->access->allowed('magazines', 'update')) {
         if ($id != NULL) {
             $magazine = orm::factory('magazine')->find($id);
             if ($magazine->loaded) {
                 $view = new view(url::location());
                 $view->magazine = orm::factory('magazine', $id);
                 $this->template->title = 'Stock Magazines';
                 $this->template->content = $view;
             } else {
                 $this->notification->add($this->i18n['system.magazine.failed']);
                 url::redirect(url::routes_area());
             }
         } else {
             $this->notification->add($this->i18n['system.magazine.failed']);
             url::redirect(url::routes_area());
         }
     } else {
         url::failed();
     }
 }
Beispiel #27
0
 public function join($params, $url = '')
 {
     if (empty($url)) {
         $url = url::location();
     }
     if (is_string($params)) {
         parse_str($params, $params);
     }
     $u = parse_url($url);
     if (isset($u['query'])) {
         parse_str($u['query'], $p);
         $params = array_merge($p, $params);
     }
     if (is_array($params)) {
         $query = http_build_query($params);
     }
     $scheme = empty($u['scheme']) ? '' : $u['scheme'] . '://';
     $user = empty($u['user']) ? '' : $u['user'] . ':';
     $pass = empty($u['pass']) ? '' : $u['pass'] . '@';
     $host = $u['host'];
     $port = empty($u['port']) ? '' : ':' . $u['port'];
     $path = $u['path'];
     $query = empty($query) ? '' : '?' . $query;
     $fragment = empty($u['fragment']) ? '' : '#' . $u['fragment'];
     return "{$scheme}{$user}{$pass}{$host}{$port}{$path}{$query}{$fragment}";
 }
Beispiel #28
0
    ?>
"><?php 
    echo html::image($img['path']);
    ?>
<span class="zotop-icon zotop-icon-ok"></span></div>
			<div class="title">
				<a href="<?php 
    echo zotop::url('zotop/image/preview', array('globalid' => $globalid, 'field' => $field, 'image' => url::encode($img['path'])));
    ?>
">预览</a>
				<a href="<?php 
    echo zotop::url('zotop/image/edit', array('image' => url::encode($img['path'])));
    ?>
" class="dialog">编辑</a>
				<a href="<?php 
    echo zotop::url('zotop/image/delete', array('image' => url::encode($img['path']), 'referer' => url::encode(url::location())));
    ?>
" class="confirm">删除</a>
			</div>
		</li>
	<?php 
}
?>
	</ul>
</div>
<div class="clearfix"><?php 
echo $pagination;
?>
</div>
<div class="buttons">
	<?php 
Beispiel #29
0
 public function samples()
 {
     $view = new View(url::location());
     $this->template->title = 'Samples';
     $this->breadcrumbs->add()->url(false)->title('Samples');
     $view->breadcrumbs = $this->breadcrumbs->cut();
     $this->template->content = $view;
 }
Beispiel #30
0
 public static function log($type = '', $data = array())
 {
     if (empty($type)) {
         return zotop::$logs;
     }
     if (is_array($type)) {
         $log = $type;
     }
     if (is_string($data)) {
         $log = array('type' => $type, 'content' => $data);
     }
     if (is_array($data)) {
         $log = array('type' => $type, 'content' => $data);
     }
     if (!empty($log) && is_array($log)) {
         $log = array('type' => $log['type'], 'title' => $log['title'], 'content' => $log['content'], 'description' => $log['description'], 'userid' => zotop::user('id'), 'url' => url::location(), 'createip' => ip::location(), 'createtime' => TIME);
         zotop::$logs[] = $log;
     }
     return zotop::$logs;
 }