code
stringlengths
1
2.01M
repo_name
stringlengths
3
62
path
stringlengths
1
267
language
stringclasses
231 values
license
stringclasses
13 values
size
int64
1
2.01M
<div id="products"><!--start products--> <div class="box"> <div class="box_left"> <div class="box_right"><a href="#">Kết quả tìm kiếm bất động sản</a></div> </div> </div> <?php echo $list->render(); ?> </div>
12-05-2011-wharfland-project
trunk/modules/land/views/client/land/search.php
PHP
mit
233
<div id="products"><!--start products--> <div class="box"> <div class="box_left"> <div class="box_right"><a href="#">Danh sách bất động sản đang giao dịch</a></div> </div> </div> <?php echo $list->render(); ?> </div>
12-05-2011-wharfland-project
trunk/modules/land/views/client/land/page.php
PHP
mit
237
<div id="products"><!--start products--> <div class="box"> <div class="box_left"> <div class="box_right"><a href="#">Các tin rao bán đuợc đăng bởi <?php echo $user->username; ?></a></div> </div> </div> <?php echo $list_land->render(); ?> </div>
12-05-2011-wharfland-project
trunk/modules/land/views/client/land/by.php
PHP
mit
263
<div id="products"><!--start products--> <div class="box"> <div class="box_left"> <div class="box_right"><a href="#">Thông tin rao bán</a></div> </div> </div> <?php if($land): ?> <div id="bg_products"> <p><strong>Thông tin liên hệ: <?php echo $land->contact_name .' - '. $land->contact_phone; ?></strong></p> <p><strong>Hướng: </strong><?php if(empty($land->direction)){echo "Bất kỳ";}else{echo __($land->direction);} ?></p> <p><strong>Loại giao dịch: </strong><?php echo __($land->transaction_type); ?></p> <p><strong>Giá: </strong><?php echo number_format((float)$land->price,0,',','.'); ?><em> ₫</em></p> <p><strong>Loại bất động sản: </strong><?php echo $land->Type->name; ?></p> <p><strong>Diện tích: </strong><?php echo $land->area; ?><em> m&sup2;</em></p> <br/> <p><strong><u>Thêm thông tin:</u></strong></p> <div> <?php if($land): ?> <?php echo html_entity_decode($land->description); ?> <?php else: ?> Dự án bạn yêu cầu không được tìm thấy <?php endif; ?> </div> </div> <?php endif; ?> <div class="clear"></div> <?php if($user_land): ?> <div class="box"> <div class="box_left"> <div class="box_right"><a href="#">Tin cùng người đăng</a></div> </div> </div> <div id="bg_products"> <ul> <?php foreach($user_land as $land): ?> <li> <span class="img_products"><a href="#"><img width="110px" height="90px" src="<?php echo Tools::get_land_image($land->image); ?>"></a></span> <span class="text_project" style="width: 555px"> <a href="<?php echo Route::url('default',array('controller' => 'land','action' => 'detail', 'id' => $land->id))?>"><?php echo $land->title; ?></a> <p><?php echo $land->short_description; ?></p> <span class="details"><a href="<?php echo Route::url('default',array('controller' => 'land','action' => 'detail', 'id' => $land->id))?>">[Chi tiết]</a></span> </span> <span class="underline_project"><!----></span> </li> <?php endforeach; ?> </ul> <div class="clear"></div> <div class="more" style="text-align: right; padding-top: 5px;"> <?php if($user): ?> <a href="<?php echo Route::url('default',array('controller' => 'land','action' => 'by','id' => $user->username)) ?>" style="color: red">Xem thêm</a> <?php endif; ?> </div> </div> <?php endif; ?> <?php if($related_land): ?> <div class="clear"></div> <div class="box"> <div class="box_left"> <div class="box_right"><a href="#">Tin liên quan</a></div> </div> </div> <div id="bg_products"> <ul> <?php foreach($related_land as $land): ?> <li> <span class="img_products"><a href="#"><img width="110px" height="90px" src="<?php echo Tools::get_land_image($land->image); ?>"></a></span> <span class="text_project" style="width: 555px"> <a href="<?php echo Route::url('default',array('controller' => 'land','action' => 'detail', 'id' => $land->id))?>"><?php echo $land->title; ?></a> <p><?php echo $land->short_description; ?></p> <span class="details"><a href="<?php echo Route::url('default',array('controller' => 'land','action' => 'detail', 'id' => $land->id))?>">[Chi tiết]</a></span> </span> <span class="underline_project"><!----></span> </li> <?php endforeach; ?> </ul> <div class="clear"></div> <div class="more" style="text-align: right; padding-top: 5px;"> <a href="#" style="color: red">Xem thêm</a> </div> </div> <?php endif; ?> </div>
12-05-2011-wharfland-project
trunk/modules/land/views/client/land/detail.php
PHP
mit
3,980
<div class="search"><!--start search--> <div class="search_1"><img src="<?php echo Url::client_assets() ?>/images/tim.jpg" width="30" height="30" border="0"></div> <div class="search_2" align="left">Tìm kiếm năng cao</div> <div class="search_3"><!--start search_3--> <form method="post" action="<?php echo Route::url('client-land-list',array('action' => 'search')) ?>"> <table id="search" cellpadding="0" cellspacing="0"> <tr> <td> <span>Địa điểm:</span><br/> <select name="location" style="color:#000099; width:90px; height:20px; font-size:12px;"> <option value="">Bất kỳ</option> <?php foreach(Libs_Land::getInstance()->get_location() as $l): ?> <option value="<?php echo $l->id; ?>"><?php echo $l->name; ?></option> <?php endforeach; ?> </select> </td> <td> <span>Giao dịch</span><br/> <select name="transaction_type" style="color:#000099; width:90px; height:20px; font-size:12px;"> <option value="">Bất kỳ</option> <option value="rent">Cho thuê</option> <option value="lease">Cần mua</option> <option value="sold">Cần bán</option> </select> </td> </tr> <tr> <td> <span>Giá từ</span><br/> <input style="width:90px; height:15px; font-size:12px;" name="from_price"/> </td> <td> <span>Đến</span><br/> <input style="width:90px; height:15px; font-size:12px;" name="to_price"/> </td> </tr> <tr> <td> <span>Diện tích</span><br/> <select name="operator" style="width: 40px"> <option value=">=">>=</option> <option value="<="><=</option> <option value="=">=</option> </select> <input style="width:50px; height:15px; font-size:14px;" name="area"/> </td> <td> <span>Hướng</span> <select name="direction" style="color:#000099; width:90px; height:20px; font-size:12px;"> <option value="">Bất kỳ</option> <?php foreach(Direction::get_direction() as $key => $item): ?> <option value="<?php echo $key; ?>"><?php echo $item; ?></option> <?php endforeach; ?> </select> </td> </tr> <tr> <td> <span>Loại BĐS</span> <select name="land_type" style="color:#000099; width:90px; height:20px; font-size:12px;"> <?php foreach(Libs_Land::getInstance()->get_land_type() as $type): ?> <option value="<?php echo $type['id']; ?>"><?php echo $type['name']; ?></option> <?php endforeach; ?> </select> </td> <td><input style="margin-top: 10px" class="submit" type="submit" value="" name="btnNewsLetterSubmit"></td> </tr> </table> </form> </div><!--end search_3--> </div>
12-05-2011-wharfland-project
trunk/modules/land/views/client/land/box_search.php
PHP
mit
3,858
<div id="products"><!--start products--> <div class="box"> <div class="box_left"> <div class="box_right"><a>Đăng tin rao bán bất động sản</a></div> </div> </div> <div id="bg_products" style="width: 97%"> <div> <h4>Nhập thông tin bất động sản cho bán hoặc cho thuê</h4> <?php echo FlashMessage::getInstance()->display('flashmessage/warning'); ?> <form method="post"> <p> <label>Tiêu đề</label> <input type="text" name="title" value="<?php echo $data['title']; ?>" /> </p> <p> <label>Mô tả ngắn</label> <textarea class="text-input textarea" name="short_description" cols="79" rows="5"><?php echo $data['short_description']; ?></textarea> </p> <p> <label> Hướng <select name="direction"> <option>Bất kỳ</option> <?php foreach(Direction::get_direction() as $key => $direc): ?> <option <?php if($data['direction'] == $key){echo 'selected';} ?> value="<?php echo $key; ?>"><?php echo $direc; ?></option> <?php endforeach; ?> </select> Loại giao dịch <select name="transaction_type"> <option <?php if($data['transaction_type'] == 'rend'){echo 'selected';} ?> value="rent">Cho thuê</option> <option <?php if($data['transaction_type'] == 'lease'){echo 'selected';} ?> value="lease">Cần mua</option> </select> </label> </p> <div class="clear"></div> <p> <label style="display:initial;float: left" class="w200"> Tên liên hệ </label> <input class="text-input w250" type="text" name="contact_name" value="<?php echo $data['contact_name']; ?>" /> </p> <p> <label style="display:initial; float: left" class="w200"> Điện thoại liên hệ </label> <input class="text-input w200" type="text" name="contact_phone" value="<?php echo $data['contact_phone']; ?>" /> </p> <p> <label style="display:initial;float: left" class="w200"> Giá </label> <input class="auto w200" size="25" id="price" type="text" name="price" value="<?php echo $data['price']; ?>"/><em> ₫</em> </p> <p> <label style="display:initial;float: left" class="w200"> Diện tích </label> <input class="text-input w200" type="text" name="area" value="<?php echo $data['area']; ?>" /><em> m&sup2;</em> </p> <p> <label style="display:initial;float: left" class="w200">Địa điểm</label> <select name="location_id"> <?php foreach($location as $l):?> <option <?php if($data['location_id'] == $l->id){echo 'selected';} ?> value="<?php echo $l->id; ?>"><?php echo $l->name; ?></option> <?php endforeach;?> </select> </p> <p> <label style="display:initial;float: left" class="w200">Loại bất động sản</label> <select name="land_type"> <?php foreach(Libs_Land::getInstance()->get_land_type() as $type): ?> <option <?php if($data['land_type'] == $type['id']){echo 'selected';} ?> value="<?php echo $type['id'] ?>"><?php echo $type['name'] ?></option> <?php endforeach; ?> </select> </p> <p> <label>Mô tả</label> <textarea class="text-input textarea tinymce" style="height: 400px" name="description" cols="79" rows="15"><?php echo $data['description']; ?></textarea> </p> <p> <input class="button" type="submit" value="Đăng tin" /> </p> </form> </div> </div> </div> <script type="text/javascript"> $(function(){ $('input.auto').autoNumeric({aSep: '.', aDec: ',', aPad: false, mNum : 12}); }); </script>
12-05-2011-wharfland-project
trunk/modules/land/views/client/land/post.php
PHP
mit
3,817
<div id="bg_products"> <ul> <?php foreach($lands as $land):?> <li> <span class="img_products"><a href="<?php echo Route::url('default',array('controller' => 'land','action' => 'detail', 'id' => $land->id))?>"><img width="110px" height="90px" src="<?php echo Tools::get_land_image($land->image); ?>"></a></span> <span class="text_products"> <a href="<?php echo Route::url('default',array('controller' => 'land','action' => 'detail', 'id' => $land->id))?>"> <?php echo $land->title; ?> </a> <span><?php echo ' ('.date('d/m',$land->created).') '; ?></span> <p> <?php echo $land->short_description; ?> </p> </span> <span class="contact"> <p>Liên hệ</p> <p><?php echo $land->contact_name; ?></p> <?php echo $land->contact_phone; ?> <p>Giá :</p> <?php echo number_format((float)$land->price,0,',','.'); ?><em>₫</em> <p><a href="<?php echo Route::url('default',array('controller' => 'land','action' => 'detail', 'id' => $land->id))?>">[ Chi tiết ]</a></p> </span> <span class="underline_products"><!----></span> </li> <?php endforeach;?> </ul> <!-- Pagination --> <?php echo $pagination; ?> <!-- End pagination --> <div class="clear"></div> </div>
12-05-2011-wharfland-project
trunk/modules/land/views/client/land/list.php
PHP
mit
1,580
<?php echo FlashMessage::getInstance()->display(); ?> <div class="content-box"><!-- Start Content Box --> <div class="content-box-header"> <h3>Sửa thông tin dự án</h3> <div class="clear"></div> </div> <!-- End .content-box-header --> <div class="content-box-content"> <?php echo $form->render(); ?> </div> </div>
12-05-2011-wharfland-project
trunk/modules/land/views/admin/land/edit.php
PHP
mit
349
<?php echo FlashMessage::getInstance()->display(); ?> <div class="content-box"><!-- Start Content Box --> <div class="content-box-header"> <h3>Quản lý dự án</h3> <ul class="content-box-tabs"> <li><a href="#tab1" class="default-tab">Danh sách dự án</a></li> <!-- href must be unique and match the id of target div --> <li><a href="#tab2">Thêm dự án</a></li> </ul> <div class="clear"></div> </div> <!-- End .content-box-header --> <div class="content-box-content"> <div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab --> <form action="<?php echo Route::url('admin-land-list',array('controller' => 'land', 'action' => 'search'))?>"> <fieldset> <p> Từ khóa <input type="text" name="q" class="text-input small-input"/> Địa điểm <select name="location"> <option value="">Tất cả</option> <?php foreach($location as $l):?> <option value="<?php echo $l->id; ?>"><?php echo $l->name; ?></option> <?php endforeach;?> </select> Loại giao dịch <select name="transaction_type"> <option value="">Tất cả</option> <option value="rent">Cho thuê</option> <option value="lease">Cần mua</option> </select> <input class="button" type="submit" value="Tìm kiếm" /> </p> </fieldset> </form> <?php echo $list->render(); ?> </div> <!-- End #tab1 --> <div class="tab-content" id="tab2"> <?php if(isset($form)): ?> <?php echo $form->set('location' , $location)->render(); ?> <?php endif; ?> </div> <!-- End #tab2 --> </div> <!-- End .content-box-content --> </div> <!-- End .content-box --> <script type="text/javascript"> $(function(){ var index = <?php if(Request::current()->action() == 'manage'){ echo 0; }else{ echo 1 ; } ?>; Sidebar.setActive(Sidebar.menu.project,index); }); </script>
12-05-2011-wharfland-project
trunk/modules/land/views/admin/land/manage.php
PHP
mit
2,063
<form action="<?php echo Route::url('admin',array('controller' => 'land', 'action' => 'manage')); ?>" method="post"> <fieldset> <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns --> <p> <?php if($land->state() == Doctrine_Record::STATE_CLEAN):?> <input type="hidden" name="id" value="<?php echo $land->id; ?>" /> <?php endif;?> </p> <p> <label>Tiêu đề</label> <input class="text-input large-input" type="text" name="title" value="<?php echo $land->title; ?>" /> </p> <p> <label>Trạng thái</label> <select name="status"> <?php foreach(Libs_Land::getInstance()->get_land_status_as_array() as $key => $value): ?> <option <?php if($land->status == $key){ echo 'selected'; } ?> value="<?php echo $key; ?>"><?php echo $value; ?></option> <?php endforeach; ?> </select> </p> <p> <label>Mô tả ngắn</label> <textarea class="text-input textarea" name="short_description" cols="79" rows="5"><?php echo $land->short_description; ?></textarea> </p> <p> <label> Hướng <select name="direction"> <option>Bất kỳ</option> <?php foreach(Direction::get_direction() as $key => $direc): ?> <option <?php if($land->direction == $key){echo 'selected';}?> value="<?php echo $key; ?>"><?php echo $direc; ?></option> <?php endforeach; ?> </select> Loại giao dịch <select name="transaction_type"> <option value="">Bất kỳ</option> <option <?php if($land->transaction_type == 'rent'){ echo "selected"; }?> value="rent">Cho thuê</option> <option <?php if($land->transaction_type == 'lease'){ echo "selected"; }?> value="lease">Cần mua</option> <option <?php if($land->transaction_type == 'sold'){ echo "selected"; }?> value="sold">Cần bán</option> </select> </label> </p> <p> <label style="float:left; width:50%">Tên liên hệ <input class="text-input" style="width: 50%; float: right; margin-right: 10px" type="text" name="contact_name" value="<?php echo $land->contact_name; ?>" /></label> <label style="float:left; width: 50%">Điện thoại liên hệ <input class="text-input" style="width: 50%; float: right" type="text" name="contact_phone" value="<?php echo $land->contact_phone; ?>" /></label> </p> <div class="clear"></div> <p> <label style="float:left; width: 50%"> Giá <input class="text-input" style="width: 50%; float: right; margin-right: 10px" type="text" name="price" value="<?php echo $land->price; ?>"/><em>(₫)</em>&nbsp; </label> <label style="float:left; width: 50%"> Diện tích <input class="text-input" style="width: 50%; float: right" type="text" name="area" value="<?php echo $land->area; ?>" /><em>(m&sup2;)</em> </label> </p> <p> <label>Địa điểm</label> <select name="location_id"> <?php foreach($location as $l):?> <option value="<?php echo $l->id; ?>" <?php if($land->Location->id == $l->id){ echo "selected"; } ?>><?php echo $l->name; ?></option> <?php endforeach;?> </select> </p> <p> <label>Loại bất động sản</label> <select name="land_type"> <?php foreach(Libs_Land::getInstance()->get_land_type() as $type): ?> <option <?php if($land->land_type_id == $type['id']){echo 'selected';} ?> value="<?php echo $type['id'] ?>"><?php echo $type['name'] ?></option> <?php endforeach; ?> </select> </p> <p> <label>Mô tả</label> <textarea class="text-input textarea tinymce" style="height: 400px" name="description" cols="79" rows="15"><?php echo $land->description; ?></textarea> </p> <p> <input class="button" type="submit" value="Lưu" /> <?php if($land->state() == Doctrine_Record::STATE_CLEAN):?> <input class="button" type="button" onclick="javascript:history.go(-1)" value="Hủy" /> <?php endif;?> </p> </fieldset> <div class="clear"></div><!-- End .clear --> </form> <script type="text/javascript"> $(document).ready(function(){ }); </script>
12-05-2011-wharfland-project
trunk/modules/land/views/admin/land/form/land.php
PHP
mit
4,470
<table> <thead> <tr> <th><input class="check-all" type="checkbox" /></th> <th style="width:50%">Tiêu đề</th> <th>Địa điểm</th> <th>Loại giao dịch</th> <th>Liên hệ</th> <th>&nbsp;</th> </tr> </thead> <tfoot> <tr> <td colspan="6"> <?php echo $pagination; ?> <div class="clear"></div> </td> </tr> </tfoot> <tbody> <?php foreach($lands as $land): ?> <tr> <td><input type="checkbox" /></td> <td><a href="<?php echo Route::Url('admin',array('controller' => 'land', 'action' => 'edit', 'id' => $land->id)); ?>"><?php echo $land->title; ?></a></td> <td><?php echo $land->Location->name; ?></td> <td><?php echo __($land->transaction_type); ?></td> <td><?php echo $land->contact_name. ' - '. $land->contact_phone; ?></td> <td> <!-- Icons --> <a href="<?php echo Route::Url('admin',array('controller' => 'land', 'action' => 'edit', 'id' => $land->id)); ?>" title="Edit"><img src="<?php echo $assets_image . '/icons/pencil.png'; ?>" alt="Edit" /></a> <a href="<?php echo Route::Url('admin',array('controller' => 'land', 'action' => 'delete', 'id' => $land->id)); ?>" title="Delete"><img src="<?php echo $assets_image . '/icons/cross.png'; ?>" alt="Delete" rel="delete" /></a> </td> </tr> <?php endforeach;?> </tbody> </table>
12-05-2011-wharfland-project
trunk/modules/land/views/admin/land/list.php
PHP
mit
1,371
<?php Route::set('admin-land-list','admin/land(/<action>(/<page>(?<query>)))',array( 'action' => '(manage|search)', 'page' => '[0-9]+' ))->defaults(array( 'directory' => 'admin', 'controller' => 'land', 'action' => 'manage', 'page' => 1 )); Route::set('client-land-list','land(/<action>(/<page>(?<query>)))',array( 'page' => '[0-9]+' ))->defaults(array( 'controller' => 'land', 'action' => 'page', 'page' => 1 ));
12-05-2011-wharfland-project
trunk/modules/land/init.php
PHP
mit
442
<?php class Controller_Land extends Controller_Client_Layout { public function __construct(Request $request, Response $response) { parent::__construct($request, $response); if(Request::current()->action() === 'post') { // required login if(!Api::load('user')->is_logged()) { FlashMessage::getInstance()->add('Bạn cần đăng nhập để đăng tin trên Wharfland.'); // Should be redirect to login page $this->request->redirect('/'); } } } function action_detail($id = null) { if(is_null($id)){ $this->response->status(404); }else{ $land = Libs_Land::getInstance()->getLandById($id); if($land) { $user_land = Doctrine_Query::create() ->from('Land l') ->where('l.created_by = ?',$land->created_by) ->whereNotIn('l.id',array($id))->limit(5)->execute(); $related_land = Doctrine_Query::create() ->from('Land l') ->where('l.land_type_id = ?',$land->land_type_id) ->whereNotIn('l.id',array($land->id)) ->limit(5)->execute(); } $this->set_main_right(null); $this->set_contents(View::client('land/detail')->set(array( 'land' => $land, 'user_land' => isset($user_land) && count($user_land) > 0 ? $user_land : false, 'related_land' => isset($related_land) && count($related_land) > 0 ? $related_land : false, 'user' => UserTable::getInstance()->findOneById($land->created_by) ))); } } function action_post() { $data = Arr::extract($_POST, array( 'title','short_description','direction', 'transaction_type','contact_name','contact_title','contact_phone', 'price','area','description','location_id','land_type' )); if(Request::current()->method() === 'POST') { $valid = Validation::factory($data) ->rule('title','not_empty') ->rule('title','max_length',array('title',255)) ->rule('contact_name','not_empty') ->rule('contact_phone','not_empty') ->rule('area','numeric'); if($valid->check()){ $saved = Libs_Land::getInstance()->saveLand($data); if(!$saved) FlashMessage::getInstance ()->add('Đăng tin thất bại. Bạn vui lòng thử lại'); else FlashMessage::getInstance ()->add('Tin của bạn đã đuợc đăng thành công.', FlashMessage::SUCCESS); $this->request->redirect('/'); }else{ FlashMessage::getInstance()->add($valid->errors('land',true)); } } $this->add_scripts(Url::client_assets().'js/autoNumeric.js'); $this->add_scripts(Url::vendors().'tiny_mce/jquery.tinymce.js'); $this->add_scripts(Url::client_assets().'js/tinymce.js'); $this->set_main_right(); //disable main_right column $this->set_contents(View::client('land/post')->set(array( 'location' => Libs_Land::getInstance()->get_location(), 'data' => $data ))); } public function action_page($page = null) { $this->set_contents(View::client('land/page')->set(array( 'list' => Libs_Land::getInstance()->get_list('client/land/list') ))); } /** * View list land by user * @param type $user */ public function action_by($user = null) { if(!is_null($user)){ $user = UserTable::getInstance()->findOneByUsername($user); if($user){ $this->set_contents(View::client('land/by')->set(array( 'list_land' => Libs_Land::getInstance()->get_list('client/land/list'), 'user' => $user ))); } else{ $this->response->status(404); } }else{ $this->response->status(404); } } public function action_search() { $params = $this->get_search_query_params(); $this->set_contents(View::client('land/search')->set(array( 'list' => Libs_Land::getInstance()->get_list('client/land/list',$params) ))); } /** * @todo get current query param from search form with xss clean * @return type */ private function get_search_query_params() { $query_params = array( 'direction','location','transaction_type','from_price', 'to_price','area','land_type','operator' ); $post = array(); if(Request::current()->method() === "POST") { foreach($query_params as $param) { $post[$param] = Security::xss_clean(Arr::get($_POST,$param)); } Session::instance()->set('query', serialize($post)); }else { if(!is_null($query = Session::instance()->get('query'))){ $post = unserialize($query); } } return $post; } }
12-05-2011-wharfland-project
trunk/modules/land/classes/controller/land.php
PHP
mit
5,670
<?php defined('SYSPATH') or die('No direct script access.'); /** * @author thanh.dang * @todo Land Controller */ class Controller_Admin_Land extends Controller_Admin_Layout { function action_manage() { if(Request::current()->method() === 'POST'){ $valid = Validation::factory($_POST) ->rule('title','not_empty') ->rule('title','max_length',array('title',255)) ->rule('contact_name','not_empty') ->rule('contact_phone','not_empty'); if($valid->check()){ if(isset($_POST['id'])){ //update land $saved = Libs_Land::getInstance()->saveLand($_POST,false); }else{ //create new land $saved = Libs_Land::getInstance()->saveLand($_POST); } if(!$saved) FlashMessage::getInstance()->add("An error occured. Please try again"); }else{ FlashMessage::getInstance()->add($valid->errors('land',true)); } } $this->add_scripts(Url::vendors().'tiny_mce/jquery.tinymce.js'); $this->add_scripts(Url::admin_assets().'js/tinymce.js'); $this->set_content(View::admin('land/manage')->set(array( 'list' => Libs_Land::getInstance()->get_list('admin/land/list',array('status' => Libs_Land::STATUS_APPROVAL)), 'form' => View::admin('land/form/land')->set(array( 'land' => new Land(), )), 'location' => Libs_Land::getInstance()->get_location() ))); } function action_pending() { $this->set_content(View::admin('land/manage')->set(array( 'list' => Libs_Land::getInstance()->get_list('admin/land/list',array('status' => Libs_Land::STATUS_PENDING)), 'location' => Libs_Land::getInstance()->get_location() ))); } function action_edit($id = null) { if(is_null($id)){ $this->response->status(404); }else{ $land = LandTable::getInstance()->findOneById($id); if(!$land) FlashMessage::getInstance()->add('Land not found !'); $this->add_scripts(Url::vendors().'tiny_mce/jquery.tinymce.js'); $this->add_scripts(Url::admin_assets().'js/tinymce.js'); $this->set_content(View::admin('land/edit')->set(array( 'form' => View::admin('land/form/land')->set(array( 'land' => !$land ? new Land() : $land, 'location' => Libs_Land::getInstance()->get_location() )) ))); } } function action_delete($id) { if(is_numeric($id)){ $row = Doctrine_Query::create() ->delete('Land l') ->where('l.id = ?',$id)->execute(); if($row == 1){ FlashMessage::getInstance()->add("Xóa dự án thành công.",FlashMessage::SUCCESS, true); }else{ FlashMessage::getInstance()->add("Đã có lỗi xảy ra. Hãy thử lại lần nữa.",FlashMessage::ATTENTION, true); } $this->request->redirect(Route::url('admin',array('controller' => 'land','action' => 'manage'))); } } function action_search() { $params = $this->request->query(); $this->set_content(View::admin('land/manage')->set(array( 'list' => Libs_Land::getInstance()->get_list('admin/land/list', $params), 'form' => View::admin('land/form/land')->set(array( 'land' => new Land(), )), 'location' => Libs_Land::getInstance()->get_location() ))); } }
12-05-2011-wharfland-project
trunk/modules/land/classes/controller/admin/land.php
PHP
mit
3,214
<?php class Libs_Land { /** * Land status for active */ const STATUS_APPROVAL = 1; /** * Land status for pending */ const STATUS_PENDING = 2; private static $instance; private function __construct(){ } /** * * @return Libs_Land */ public static function getInstance(){ if(!isset(self::$instance)){ self::$instance = new Libs_Land(); } return self::$instance; } public function getLandById($id) { return LandTable::getInstance()->findOneById($id); } /** * get current page from request url */ public function get_page() { return Request::current()->param('page',1); } /** * return current list location */ public function get_location() { return Doctrine_Query::create() ->from('Location l') ->where('l.parent_id = ?',0) ->orderBy('l.name ASC')->execute(); } public function get_list($view,$params = null) { $query = Doctrine_Query::create() ->from('Land l'); if(!is_null($params)){ if(isset($params['location']) && is_numeric($params['location'])){ $query->addWhere('l.location_id = ?',$params['location']); } if(isset($params['transaction_type']) && !empty($params['transaction_type'])){ $query->addWhere('l.transaction_type = ?',$params['transaction_type']); } if(isset($params['q']) && strlen(trim($params['q'])) > 0){ $query->addWhere('l.title LIKE ?',"%{$params['q']}%"); } if(isset($params['direction']) && strlen(trim($params['direction'])) > 0){ $query->addWhere('l.direction = ?',$params['direction']); } if(isset($params['from_price']) &&is_numeric($params['from_price'])){ $query->addWhere('l.price >= ?',$params['from_price']); } if(isset($params['to_price']) && is_numeric($params['to_price'])){ $query->addWhere('l.price <= ?',$params['to_price']); } if(!isset($params['status'])){ $params['status'] = Libs_Land::STATUS_APPROVAL; } $query->addWhere('l.status = ?', $params['status']); if(isset($params['area']) && is_numeric($params['area'])){ $operators = array('>=','<=','='); $operator = in_array($params['operator'],$operators) ? $params['operator'] : '>='; $query->addWhere('l.area '.$operator.' ?',$params['area']); } } $query->orderBy('l.created DESC'); $pager = new Doctrine_Pager($query, $this->get_page(),Tools::get_admin_item_page()); $pagerRange = new Doctrine_Pager_Range_Sliding(array('chunk' => 5),$pager); if(Request::current()->directory() == 'admin'){ $urlMask = Route::url('admin-land-list',array('action' => Request::current()->action(),'page' => '{%page_number}','query' => '{%query}')); }else{ $action = (Request::current()->action() == 'search') ? 'search': 'page'; $urlMask = Route::url('client-land-list',array('action' => $action,'page' => '{%page_number}','query' => '{%query}')); } $pagination = new CustomPagerLayout($pager, $pagerRange,$urlMask); $pagination->setTemplate('<a href="{%url}" class="number" title="Trang {%page}">{%page}</a>'); $pagination->setSelectedTemplate('<a href="{%url}" class="number current" title="Trang {%page}">{%page}</a>'); return View::factory($view)->set(array( 'lands' => $pager->execute(), 'pagination' => $pagination->display(array( 'query' => http_build_query(Request::current()->query()) ),true) )); } public function saveLand(array $post,$isNew = true) { if(!Api::load('user')->is_logged()) { FlashMessage::getInstance()->add('Bạn cần đăng nhập để đăng tin trên Wharfland.'); return false; } if($isNew){ return $this->addNewLand($post); }else{ return $this->updateLand($post); } } public function addNewLand(array $formData) { try{ $land = new Land(); if(isset($formData['price'])){ //format my price $formData['price'] = str_replace('.','', $formData['price']); } $land->fromArray(Arr::extract($formData, array('title','direction','short_description','transaction_type', 'contact_name','contact_phone','location_id', 'price','area','description','status'))); $user_info = Api::load('user')->get_user_info(); /** * if user not login with admin role, and then set land status to pending */ if(!Api::load('user')->has_role($user_info['id'],'admin')) { $land->status = Libs_Land::STATUS_PENDING; } //get first image from description content preg_match('/<\s*img [^\>]*src\s*=\s*(["\'])(.*?)\1/',Arr::get($formData,'description'),$matches); if(is_array($matches) && !empty($matches)){ $land->image = $matches[2]; }else{ $land->image = null; } //remove invalid html tag in your description $land->description = Security::xss_clean(Arr::get($formData,'description')); $land->created_by = $user_info['id']; $land->land_type_id = Arr::get($formData, 'land_type'); $land->save(); return true; }catch (Doctrine_Validator_Exception $ex){ FlashMessage::getInstance()->add($ex->getMessage()); } return false; } public function updateLand(array $formData) { $land_id = Arr::get($formData,'id'); if(!is_numeric($land_id)){ FlashMessage::getInstance()->add("Land not found",FlashMessage::WARNING); }else{ $land = LandTable::getInstance()->findOneById($land_id); if(!$land){ FlashMessage::getInstance()->add("Land not found",FlashMessage::WARNING); }else{ try{ if(isset($formData['price'])){ //format my price $formData['price'] = str_replace('.','', $formData['price']); } $land->setArray(Arr::extract($formData,array( 'title','direction','short_description','transaction_type', 'contact_name','contact_phone','location_id', 'price','area','description','status' ))); $user_info = Api::load('user')->get_user_info(); /** * if user not login with admin role, and then set land status to pending */ if(!Api::load('user')->has_role($user_info['id'],'admin')) { $land->status = Libs_Land::STATUS_PENDING; } //get first image from description content preg_match('/<\s*img [^\>]*src\s*=\s*(["\'])(.*?)\1/',Arr::get($formData,'description'),$matches); if(is_array($matches) && !empty($matches)){ $land->image = $matches[2]; }else{ $land->image = null; } //remove invalid html tag in your description $land->description = Security::xss_clean(Arr::get($formData,'description')); $land->land_type_id = Arr::get($formData, 'land_type'); $land->save(); return true; }catch (Doctrine_Validator_Exception $ex){ //only for debug die($ex->getMessage()); FlashMessage::getInstance()->add($ex->getMessage()); } } } return false; } public function get_land_type(){ if ($landType = LandTypeTable::getInstance()->findAll()) { return $landType->toArray(); } return array(); } /** * Get Five Land by User id * @param type $id * @return type */ public function get_land_by_user($id) { if(!is_numeric($id)){ return false; } return Doctrine_Query::create() ->from('Land l') ->where('l.created_by = ?',$id) ->limit(5)->execute(); } public function get_land_status_as_array() { return array( self::STATUS_APPROVAL => 'Đã duyệt', self::STATUS_PENDING => 'Chờ duyệt' ); } }
12-05-2011-wharfland-project
trunk/modules/land/classes/libs/land.php
PHP
mit
8,679
<?php class Direction { const N = 'Bắc'; const E = 'Đông'; const W = 'Tây'; const S = 'Nam'; const ES = 'Đông nam'; const EN = 'Đông bắc'; const WN = 'Tây bắc'; const WS = 'Tây nam'; public static function get_direction() { return array( 'N' => self::N, 'E' => self::E, 'W' => self::W, 'S' => self::S, 'ES'=> self::ES, 'EN'=> self::EN, 'WN'=> self::WN, 'WS'=> self::WS ); } }
12-05-2011-wharfland-project
trunk/modules/land/classes/direction.php
PHP
mit
551
This will not erase any data in your base models<br /> <form action="" method="POST"> <input type="submit" name="schema" value="Load Schema"><br /> </form> Reminder: Make sure the tables do not exist already.<br /> <form action="" method="POST"> <input type="submit" name="tables" value="Create Tables"><br /> </form> This may cause duplication if you already have data in your tables!<br /> <form action="" method="POST"> <input type="submit" name="data" value="Load Fixtures"><br /> </form>
12-05-2011-wharfland-project
trunk/modules/doctrine/views/doctrine/doctrine.php
Hack
mit
497
<?php /* Doctrine integration */ require Kohana::find_file('classes', 'vendor/doctrine/Doctrine'); spl_autoload_register(array('Doctrine', 'autoload')); // Getting kohana configurations for doctrine $db = Kohana::config('database'); // initializing manager $Manager = Doctrine_Manager::getInstance(); // we load our database connections into Doctrine_Manager // this loop allows us to use multiple connections later on foreach ($db as $connection_name => $dbconf) { //PDO doesn't have hostname and database in the connection array. Extract from DSN string if ( $dbconf['type'] == 'pdo' ) { preg_match('/host=([^;]+)/', $dbconf['connection']['dsn'], $dbconf['connection']['hostname']); preg_match('/dbname=([^;]+)/', $dbconf['connection']['dsn'], $dbconf['connection']['database']); $dbconf['connection']['hostname'] = $dbconf['connection']['hostname'][1]; $dbconf['connection']['database'] = $dbconf['connection']['database'][1]; } $dsn = $dbconf['type'] . '://' . $dbconf['connection']['username'] . ':' . $dbconf['connection']['password'] . '@' . $dbconf['connection']['hostname'] . '/' . $dbconf['connection']['database'] . '?charset=utf8'; $conn = Doctrine_Manager::connection($dsn, $connection_name); $conn->setCharset('utf8'); $conn->setCollate('utf8_unicode_ci'); } // telling Doctrine where our models are located if ( is_dir(APPPATH.'models') ) { if ( is_dir(APPPATH.'models/base') ) Doctrine_Core::loadModels(APPPATH.'models/base'); Doctrine::loadModels(APPPATH.'models'); } // (OPTIONAL) CONFIGURATION BELOW $Manager->setAttribute(Doctrine::ATTR_DEFAULT_TABLE_CHARSET, 'utf8'); $Manager->setAttribute(Doctrine::ATTR_DEFAULT_TABLE_COLLATE, 'utf8_unicode_ci'); $Manager->setAttribute(Doctrine_Core::ATTR_QUOTE_IDENTIFIER, true); // this will allow us to use "mutators" $Manager->setAttribute(Doctrine_Core::ATTR_AUTO_ACCESSOR_OVERRIDE, true ); // Automatically free queries $Manager->setAttribute(Doctrine_Core::ATTR_AUTO_FREE_QUERY_OBJECTS, true ); // Enable validation $Manager->setAttribute(Doctrine::ATTR_VALIDATE, Doctrine::VALIDATE_TYPES); $Manager->setAttribute(Doctrine::ATTR_VALIDATE, Doctrine::VALIDATE_TYPES); // this sets all table columns to notnull and unsigned (for ints) by default $Manager->setAttribute( Doctrine_Core::ATTR_DEFAULT_COLUMN_OPTIONS, array('notnull' => false, 'unsigned' => false) ); $Manager->setAttribute(Doctrine_Core::ATTR_USE_NATIVE_ENUM,true); // set the default primary key to be named 'id', integer, 4 bytes $Manager->setAttribute( Doctrine_Core::ATTR_DEFAULT_IDENTIFIER_OPTIONS, array('name' => 'id', 'type' => 'integer', 'length' => 4) ); //We want table with MYISAM Type //$Manager->setAttribute(Doctrine::ATTR_DEFAULT_TABLE_TYPE,'MYISAM'); //We want UTF8 $Manager->setCollate('utf8_unicode_ci'); $Manager->setCharset('utf8'); //Load custom hydrators foreach( glob(dirname(__FILE__).'/classes/doctrine/hydrators/DoctrineHydrator_*.php') as $file ) require_once( $file ); //Load custom behaviours foreach( glob(dirname(__FILE__).'/classes/doctrine/behaviours/*.php') as $file ) require_once( $file );
12-05-2011-wharfland-project
trunk/modules/doctrine/init.php
PHP
mit
3,188
<?php defined('SYSPATH') or die('No direct access allowed.'); /** * ORM Doctrine driver. * * @package Auth * @author Flynsarmy * @copyright (c) 2009 Flynsarmy * @license Teh FREEZ!! //http://kohanaphp.com/license.html */ class Auth_Doctrine extends Auth { /** * Checks if a session is active. * * @param mixed role name string, role ORM object, or array with role names * @return boolean */ public function logged_in($role = NULL) { $status = FALSE; // Get the user from the session $user = $this->get_user(); if (is_object($user) /*AND $user instanceof Model_User AND $user->loaded()*/) { // Everything is okay so far $status = TRUE; if ( !empty($role) ) { // Multiple roles to check if (is_array($role)) { // Check each role foreach ($role as $_role) { if ( ! is_object($_role)) $_role = Doctrine_Core::getTable('Role')->findOneByName( $_role ); if ( !$this->_is_in_db($_role->id, $user->Roles, 'id') ) //if ( !$user->has('roles', $_role) ) { // Set the status false and get outta here $status = FALSE; break; } } } // Single role to check else { if ( !is_object($role) ) { // Load the role $role = Doctrine_Core::getTable('Role')->findOneByName( $role ); //$role = ORM::factory('role', array('name' => $role)); } // Check that the user has the given role //$status = $user->has('roles', $role); $status = $this->_is_in_db($role->id, $user->Roles, 'id'); } } } return $status; } /** * Logs a user in. * * @param string username * @param string password * @param boolean enable autologin * @return boolean */ protected function _login($user, $password, $remember) { if ( !is_object( $user ) ) $user = Doctrine_Query::create() ->from('User u, u.Roles r') ->addWhere('u.username=?', $user) ->addWhere('u.password=?', $password) ->fetchOne(); if ( $user && $this->_is_in_db('login', $user->Roles, 'name') ) { if ( $remember ) { //Delete old tokens for user $user->Tokens->delete(); // Create a new autologin token $token = new UserToken(); $token = $this->update_token( $token, $user ); $token->save(); // Set the autologin cookie Cookie::set('authautologin', $token->token, $this->_config['lifetime']); } // Finish the login $this->complete_login( $user ); return TRUE; } // Login failed return FALSE; } /** * Forces a user to be logged in, without specifying a password. * * @param mixed username string, or user ORM object * @return boolean */ public function force_login($user) { if ( ! is_object($user)) $user = Doctrine_Query::create() ->from('User u, u.Roles r') ->addWhere('u.username=?', $user) ->fetchOne(); // Mark the session as forced, to prevent users from changing account information $this->_session->set('auth_forced', TRUE); // Run the standard completion $this->complete_login($user); } /** * Logs a user in, based on the authautologin cookie. * * @return mixed */ public function auto_login() { if ($token = Cookie::get('authautologin')) { $this->delete_expired_tokens(); // Load the token and user //$token = ORM::factory('user_token', array('token' => $token)); $token = Doctrine_Core::getTable('UserToken')->findOneByToken($token); //if ($token->loaded() AND $token->user->loaded()) if ( $token ) { if ($token->user_agent === sha1(Request::$user_agent)) { // Save the token to create a new unique token //$token->save(); // Set the new token Cookie::set('authautologin', $token->token, $token->expires - time()); // Automatic login was successful $user = Doctrine_Query::create() ->from( $token->tbl ) ->addWhere('id=?', $token->user_id) ->fetchOne(); // Complete the login with the found data $this->complete_login( $user ); return $user; } // Token is invalid $token->delete(); } } return FALSE; } /** * Gets the currently logged in user from the session (with auto_login check). * Returns FALSE if no user is currently logged in. * * @return mixed */ public function get_user() { $user = parent::get_user(); if ($user === FALSE) { // check for "remembered" login $user = $this->auto_login(); } return $user; } /** * Log a user out and remove any autologin cookies. * * @param boolean completely destroy the session * @param boolean remove all tokens for user * @return boolean */ public function logout($destroy = FALSE, $logout_all = FALSE) { // Set by force_login() $this->_session->delete('auth_forced'); if ($token = Cookie::get('authautologin')) { // Delete the autologin cookie to prevent re-login Cookie::delete('authautologin'); Doctrine_Query::create() ->delete('UserToken') ->where('token=?', $token) ->execute(); /* // Clear the autologin token from the database $token = Doctrine_Core::getTable('UserToken')->findOneByToken( $token ); if ($token->loaded() AND $logout_all) { //ORM::factory('user_token')->where('user_id', '=', $token->user_id)->delete_all(); Doctrine_Query::create() ->delete('UserToken') ->where('user_id=?', $token->user_id) ->execute(); } elseif ($token->loaded()) { $token->delete(); } */ } return parent::logout($destroy); } /** * Get the stored password for a username. * * @param mixed username string, or user ORM object * @return string */ public function password($user) { if ( !is_object($user)) $user = Doctrine_Query::create() ->select('password') ->from('User u') ->addWhere('u.username=?', $user) ->fetchOne(); return $user ? $user->password : ''; } /** * Complete the login for a user by incrementing the logins and setting * session data: user_id, username, roles. * * @param object user ORM object * @return void */ protected function complete_login($user) { //$user->complete_login(); return parent::complete_login($user); } /** * Compare password with original (hashed). Works for current (logged in) user * * @param string $password * @return boolean */ public function check_password($password) { $user = $this->get_user(); if ($user === FALSE) { // nothing to compare return FALSE; } $hash = $this->hash_password($password, $this->find_salt($user->password)); return $hash == $user->password; } public function delete_expired_tokens() { Doctrine_Query::create() ->delete('UserToken') ->where('expires<?', time()) ->execute(); } public function update_token( $Token, $User ) { // Set token data $Token->User = $User; $Token->created = time(); $Token->expires = time() + $this->_config['lifetime']; $Token->user_agent = sha1(Request::$user_agent); while ( true ) { $unique_tok = Text::random('alnum', 32); if ( !Doctrine_Core::getTable( 'UserToken' )->findOneByToken( $unique_tok ) ) break; } $Token->token = $unique_tok; return $Token; } /** * Checks if a specified val is in a doctrine result set * * @param string $val * @param Doctrine_Resultset $db * @param string $field * @return boolean */ private function _is_in_db($val, $db, $field) { foreach ( $db as $row ) if ( $row->$field == $val ) return true; return false; } /** * Determines if specified user has a specified role * * @param id userid * @param string role name * @return boolean */ public function has_role( $user_id, $role ) { $Role = Doctrine_Core::getTable('Role')->findOneByName( $role ); if ( !$Role ) return false; $result = Doctrine_Query::create() ->select('*') ->from('UserRole') ->addWhere('user_id=?', $user_id) ->addWhere('role_id=?', $Role->id) ->execute(array(), Doctrine_Core::HYDRATE_ASSOC); return sizeof($result) > 0; } } // End Auth ORM
12-05-2011-wharfland-project
trunk/modules/doctrine/classes/auth/doctrine.php
PHP
mit
8,140
<?php /* * $Id$ * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see * <http://www.doctrine-project.org>. */ /** * Builds result sets in to a scalar php array * * @package Doctrine * @subpackage Hydrate * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link www.doctrine-project.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen <kvesteri@cc.hut.fi> */ class DoctrineHydrator_Assoc extends Doctrine_Hydrator_Abstract { public function hydrateResultSet($stmt) { $cache = array(); $result = array(); while ($data = $stmt->fetch(Doctrine_Core::FETCH_ASSOC)) { $result[] = $this->_gatherRowData($data, $cache); } return $result; } protected function _gatherRowData($data, &$cache, $aliasPrefix = false) { $rowData = array(); foreach ($data as $key => $value) { // Parse each column name only once. Cache the results. if ( ! isset($cache[$key])) { if ($key == 'DOCTRINE_ROWNUM') { continue; } // cache general information like the column name <-> field name mapping $e = explode('__', $key); $columnName = strtolower(array_pop($e)); $cache[$key]['dqlAlias'] = $this->_tableAliases[strtolower(implode('__', $e))]; $table = $this->_queryComponents[$cache[$key]['dqlAlias']]['table']; // check whether it's an aggregate value or a regular field if (isset($this->_queryComponents[$cache[$key]['dqlAlias']]['agg'][$columnName])) { $fieldName = $this->_queryComponents[$cache[$key]['dqlAlias']]['agg'][$columnName]; $cache[$key]['isAgg'] = true; } else { $fieldName = $table->getFieldName($columnName); $cache[$key]['isAgg'] = false; } $cache[$key]['fieldName'] = $fieldName; // cache type information $type = $table->getTypeOfColumn($columnName); if ($type == 'integer' || $type == 'string') { $cache[$key]['isSimpleType'] = true; } else { $cache[$key]['type'] = $type; $cache[$key]['isSimpleType'] = false; } } $table = $this->_queryComponents[$cache[$key]['dqlAlias']]['table']; $dqlAlias = $cache[$key]['dqlAlias']; $fieldName = $cache[$key]['fieldName']; $rowDataKey = $aliasPrefix ? $dqlAlias . '_' . $fieldName:$fieldName; if ($cache[$key]['isSimpleType'] || $cache[$key]['isAgg']) { $rowData[$rowDataKey] = $value; } else { $rowData[$rowDataKey] = $table->prepareValue( $fieldName, $value, $cache[$key]['type']); } } return $rowData; } } Doctrine_Manager::getInstance()->registerHydrator('Assoc', 'DoctrineHydrator_Assoc');
12-05-2011-wharfland-project
trunk/modules/doctrine/classes/doctrine/hydrators/DoctrineHydrator_Assoc.php
PHP
mit
4,009
<?php /** * Fetchs a flat array of values from the first column of the result set. */ class DoctrineHydrator_SingleColumn extends Doctrine_Hydrator_Abstract { public function hydrateResultSet($stmt) { return $stmt->fetchAll(PDO::FETCH_COLUMN); } } Doctrine_Manager::getInstance()->registerHydrator('SingleColumn', 'DoctrineHydrator_SingleColumn'); /* $setIds = Doctrine_Query::Create() ->from('MediaSet mset') ->select('mset.id') ->where('mset.publishdate BETWEEN ? AND ?', array($nowTime->mysql(), $laterTime->mysql())) ->orderBy('mset.publishdate asc') ->limit($num_items) ->execute(array(), 'SingleColumn'); */
12-05-2011-wharfland-project
trunk/modules/doctrine/classes/doctrine/hydrators/DoctrineHydrator_SingleColumn.php
PHP
mit
644
<?php class UnixTimestampable extends Doctrine_Template_Timestampable { protected $_options = array( 'created' => array('name' => 'created_at', 'alias' => null, 'type' => 'int(10) unsigned', 'disabled' => false, 'expression' => false, 'options' => array('notnull' => true)), 'updated' => array('name' => 'updated_at', 'alias' => null, 'type' => 'int(10) unsigned', 'disabled' => false, 'expression' => false, 'onInsert' => true, 'options' => array('notnull' => true))); }
12-05-2011-wharfland-project
trunk/modules/doctrine/classes/doctrine/behaviours/UnixTimestampable.php
PHP
mit
900
<?php defined('SYSPATH') or die('No direct script access.'); class Controller_Doctrine extends Controller { public function before() { parent::before(); //Restrict controller to localhost if ( !in_array($_SERVER['REMOTE_ADDR'], array('::1', '127.0.0.1')) ) { echo "DENIED!"; exit; } } function action_index() { $this->response->body(View::factory('doctrine/doctrine')->render()); if ( !empty($_POST['schema']) ) { Doctrine_Core::generateModelsFromYaml( APPPATH . DIRECTORY_SEPARATOR . 'models/yml', APPPATH . DIRECTORY_SEPARATOR . 'models', array( 'generateBaseClasses'=>true, 'generateTableClasses' => true, 'baseClassesDirectory' => 'base', 'phpDocName' => 'thanh.dang', 'phpDocEmail' => 'clgt@clgt.vn' ) ); $this->response->body("Done!"); } elseif ( !empty($_POST['tables']) ) { Doctrine::createTablesFromModels(array( APPPATH.DIRECTORY_SEPARATOR.'models'.DIRECTORY_SEPARATOR.'base', APPPATH.DIRECTORY_SEPARATOR.'models' )); $this->response->body("Done!"); } elseif ( !empty($_POST['data']) ) { Doctrine_Manager::connection()->execute(" SET FOREIGN_KEY_CHECKS = 0 "); Doctrine::loadData(APPPATH . DIRECTORY_SEPARATOR . 'models/yml/data'); $this->response->body("Done!"); } } }
12-05-2011-wharfland-project
trunk/modules/doctrine/classes/controller/doctrine.php
PHP
mit
1,617
<?php defined('SYSPATH') or die('No direct script access.'); /** * Doctrine Session Driver * * Sample schema: * * CREATE TABLE `sessions` ( * `session_id` VARCHAR( 24 ) NOT NULL, * `last_active` INT UNSIGNED NOT NULL, * `contents` TEXT NOT NULL, * PRIMARY KEY ( `session_id` ), * INDEX ( `last_active` ) * ) ENGINE = MYISAM ; * * @author Flynsarmy (http://www.flynsarmy.com) * @version 1.01 * @license http://creativecommons.org/licenses/by/3.0/ */ class Session_Doctrine extends Session { // Database instance protected $_db; /* * Database table name * Note: In doctrine this is the name of the class, not the table name * Note 2: Had to use 'Sessions' instead of 'Session' to stop clash with Kohana Session class */ protected $_table = 'Sessions'; // Database column names protected $_columns = array( 'session_id' => 'session_id', 'last_active' => 'last_active', 'contents' => 'contents' ); // Garbage collection requests protected $_gc = 500; // The current session id protected $_session_id; // The old session id protected $_update_id; public function __construct(array $config = NULL, $id = NULL) { /* // Use the default group if ( !isset($config['group']) ) $config['group'] = 'default'; // Load the database $this->_db = Database::instance($config['group']); */ // Set the table name if (isset($config['table'])) $this->_table = (string) $config['table']; // Set the gc chance if (isset($config['gc'])) $this->_gc = (int) $config['gc']; // Overload column names if (isset($config['columns'])) $this->_columns = $config['columns']; parent::__construct($config, $id); // Run garbage collection // This will average out to run once every X requests if (mt_rand(0, $this->_gc) === $this->_gc) $this->_gc(); } public function id() { return $this->_session_id; } protected function _read($id = NULL) { if ($id OR $id = Cookie::get($this->_name)) { $contents = Doctrine_Query::create() ->select( $this->_columns['contents'] ) ->from( $this->_table ) ->where( $this->_columns['session_id'].'=?', $id ) ->fetchOne(array(), Doctrine_Core::HYDRATE_SINGLE_SCALAR); if ( $contents !== false ) { // Set the current session id $this->_session_id = $this->_update_id = $id; // Return the contents return $contents; } } // Create a new session id $this->_regenerate(); return NULL; } protected function _regenerate() { $query = Doctrine_Query::create() ->select( $this->_columns['session_id'] ) ->from( $this->_table ); do { // Create a new session id $id = str_replace('.', '-', uniqid(NULL, TRUE)); $result = $query ->where( $this->_columns['session_id'].'=?', $id ) ->fetchOne(array(), Doctrine_Core::HYDRATE_SINGLE_SCALAR); } while( $result !== false ); return $this->_session_id = $id; } protected function _write() { $cols =& $this->_columns; if ($this->_update_id === NULL) { $Session = new $this->_table(); $Session->$cols['session_id'] = $this->_session_id; } else { $Session = Doctrine_Core::getTable( $this->_table ) ->findOneBySession_id( $this->_update_id ); // Also update the session id if ( $this->_update_id !== $this->_session_id ) $Session->$cols['session_id'] = $this->_session_id; } $Session->$cols['last_active'] = $this->_data['last_active']; $Session->$cols['contents'] = $this->__toString(); // Execute the query $Session->save(); // The update and the session id are now the same $this->_update_id = $this->_session_id; // Update the cookie with the new session id Cookie::set($this->_name, $this->_session_id, $this->_lifetime); return TRUE; } protected function _destroy() { // Session has not been created yet if ( $this->_update_id === NULL ) return TRUE; // Delete the current session Doctrine_Query::create() ->delete( $this->_table ) ->where( $this->_columns['session_id'].'=?', $this->_update_id ) ->execute(); try { // Delete the cookie Cookie::delete($this->_name); } catch ( Exception $e ) { // An error occurred, the session has not been deleted return FALSE; } return TRUE; } protected function _gc() { // Expire sessions when their lifetime is up if ($this->_lifetime) $expires = $this->_lifetime; // Expire sessions after one month else $expires = Date::MONTH; // Delete all sessions that have expired Doctrine_Query::create() ->delete( $this->_table ) ->where( $this->_columns['last_active'].' < ?', time()-$expires ) ->execute(); } }
12-05-2011-wharfland-project
trunk/modules/doctrine/classes/session/doctrine.php
PHP
mit
4,705
<?php defined('SYSPATH') or die('No direct script access.'); class Security extends Purifier_Security { }
12-05-2011-wharfland-project
trunk/modules/purifier/classes/security.php
PHP
mit
108
<?php defined('SYSPATH') or die('No direct script access.'); /** * Modifies Kohana to use [HTML Purifier](http://htmlpurifier.org/) for the * [Security::xss_clean] method. * * @package Purifier * @category Security * @author Kohana Team * @copyright (c) 2010 Woody Gilk * @license BSD */ class Purifier_Security extends Kohana_Security { /** * @var HTMLPurifier singleton instance of the HTML Purifier object */ protected static $htmlpurifier; /** * Returns the singleton instance of HTML Purifier. If no instance has * been created, a new instance will be created. Configuration options * for HTML Purifier can be set in `APPPATH/config/purifier.php` in the * "settings" key. * * $purifier = Security::htmlpurifier(); * * @return HTMLPurifier */ public static function htmlpurifier() { if ( ! Security::$htmlpurifier) { if (Kohana::config('purifier.preload')) { // Load the all of HTML Purifier right now. // This increases performance with a slight hit to memory usage. require_once Kohana::find_file('vendor', 'htmlpurifier/library/HTMLPurifier.includes'); } // Load the HTML Purifier auto loader require_once Kohana::find_file('vendor', 'htmlpurifier/library/HTMLPurifier.auto'); // Create a new configuration object $config = HTMLPurifier_Config::createDefault(); if (is_array($settings = Kohana::config('purifier.settings'))) { // Load the settings $config->loadArray($settings); } // Create the purifier instance Security::$htmlpurifier = new HTMLPurifier($config); } return Security::$htmlpurifier; } /** * Removes broken HTML and XSS from text using [HTMLPurifier](http://htmlpurifier.org/). * * $text = Security::xss_clean(Arr::get($_POST, 'message')); * * The original content is returned with all broken HTML and XSS removed. * * @param mixed text to clean, or an array to clean recursively * @return mixed */ public static function xss_clean($str) { if (is_array($str)) { foreach ($str as $i => $s) { // Recursively clean arrays $str[$i] = Security::xss_clean($s); } return $str; } // Load HTML Purifier $purifier = Security::htmlpurifier(); // Clean the HTML and return it return $purifier->purify($str); } } // End Purifier Security
12-05-2011-wharfland-project
trunk/modules/purifier/classes/purifier/security.php
PHP
mit
2,346
<?php if(isset($message) == TRUE) : ?> <div class="notification <?php echo $message['type'] ?> png_bg"> <a class="close" href="#"><img alt="close" title="Đóng" src="<?php echo Url::site('assets/admin/images/icons/cross_grey_small.png') ?>"></a> <div><?php echo $message['content'] ?></div> </div> <?php endif; ?> <div class="clear"></div> <div class="content-box"><!-- Start Content Box --> <div class="content-box-header"> <h3>Thiết Lập Hệ Thống</h3> <div class="clear"></div> </div> <!-- End .content-box-header --> <div class="content-box-content"> <form method="post" action="<?php echo Url::site('admin/setting') ?>"> <fieldset> <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns --> <?php if(isset ($settings) == TRUE && count($settings) > 0) : foreach($settings as $obj) : ?> <p> <label><?php echo $obj->description ?></label> <input type="text" name="setting[<?php echo $obj->id ?>][<?php echo $obj->key ?>]" class="text-input medium-input" value="<?php echo $obj->value ?>" /> </p> <?php endforeach; endif; ?> <p> <input type="submit" name="submit" value="Lưu" class="button"> </p> </fieldset> <div class="clear"></div><!-- End .clear --> </form> </div> <!-- End .content-box-content --> </div> <script type="text/javascript"> $(function(){ Sidebar.setActive(Sidebar.menu.setting, 0); }); </script>
12-05-2011-wharfland-project
trunk/modules/setting/views/admin/setting.php
PHP
mit
1,591
<?php class Controller_Admin_Setting extends Controller_Admin_Layout { /** * Show the main page */ public function action_index() { // Get all settings if($this->request->method() === 'POST') { $post = Arr::extract($_POST, array('setting')); foreach($post['setting'] as $id => $row) { $obj = ConfigurationTable::getInstance()->find($id); foreach ($row as $key => $value) { $obj->key = $key; $obj->value = $value; } $obj->save(); } } $settings = Doctrine_Query::create()->from('Configuration c') ->execute(); $this->template->main = View::factory('admin/setting', array( 'settings' => $settings )); } }
12-05-2011-wharfland-project
trunk/modules/setting/classes/controller/admin/setting.php
PHP
mit
888
<?php class Lib_Setting { private static $instance; private static $setting = NULL; private function __construct() { $this->load_data(); } public static function getInstance() { if(!isset(self::$instance)) { self::$instance = new Lib_Setting(); } return self::$instance; } public static function get($key) { if(self::$setting == NULL) { $data = ConfigurationTable::getInstance()->findAll(); if($data !== NULL) { foreach($data as $obj) { self::$setting[$obj->key] = $obj->value; } } } if(isset(self::$setting[$key]) == TRUE) { return self::$setting[$key]; } return FALSE; } }
12-05-2011-wharfland-project
trunk/modules/setting/classes/lib/setting.php
PHP
mit
876
<div id="products"><!--start products--> <?php if(isset ($articles) == TRUE && count($articles) > 0) : ?> <div class="box"> <div class="box_left"> <div class="box_right"><a href="#" title="">Tin tức</a></div> </div> </div> <div class="article"> <div> <form id="form-filter" method="post"> <p> <label>Xem theo danh mục:</label> <select name="category"> <option value="">Chọn danh mục</option> <?php if($category && $category->getNode()->getChildren()): ?> <?php foreach($category->getNode()->getChildren() as $child): ?> <option value="<?php echo Route::url('news-category',array('id' => $child->id, 'slug' => $child->slug)) ?>"><?php echo $child->name ?></option> <?php endforeach; ?> <?php endif; ?> </select> <label>Sắp xếp:</label> <select name="order"> <option value="desc" <?php if(Session::instance()->get('order','desc') == 'desc'){ echo 'selected';} ?>>Gần đây</option> <option value="asc" <?php if(Session::instance()->get('order','desc') == 'asc'){ echo 'selected';} ?>>Cũ nhất</option> </select> </p> </form> </div> <ul class="others"> <?php foreach($articles as $obj) : preg_match('/<\s*img [^\>]*src\s*=\s*(["\'])(.*?)\1/', $obj->content, $matches); if (is_array($matches) && !empty($matches)) { $image = $matches[2]; } else { $image = Url::site('assets/client/images/no-image.jpg'); } ?> <li> <p class="img"> <span> <img src="<?php echo $image ?>" alt="" width="100" height="100" /> </span> </p> <p class="title"> <a href="<?php echo Route::url($route,array('id' => $obj->id,'slug' => $obj->slug)); ?>"><?php echo $obj->title ?></a> <span>(26/05)</span> <br /> <?php echo $obj->summary ?> </p> </li> <?php endforeach; ?> </ul> <?php echo $pagination->display(); ?> <div class="clear"></div> </div> <?php else: ?> <div id="bg_products"> <p>Không tìm thấy bài viết nào</p> </div> <?php endif; ?> </div><!--end products--> <script type="text/javascript"> $(document).ready(function(){ $('select[name="category"]').bind('change',function(){ window.location.href = $(this).val(); }); $('select[name="order"]').bind('change',function(){ $("#form-filter").trigger('submit'); }); }); </script>
12-05-2011-wharfland-project
trunk/modules/article/views/client/page/news.php
PHP
mit
3,065
<?php if($page): ?> <div id="products"><!--start products--> <div class="box"> <div class="box_left"> <div class="box_right"><a href="#" title=""><?php echo $title; ?></a></div> </div> </div> <div class="article"> <?php echo $page->content ?> <p class="date">Đăng ngày: <?php echo date('d-m-Y H:i:s', $page->created) ?></p> </div> </div> <?php endif; ?>
12-05-2011-wharfland-project
trunk/modules/article/views/client/page/static.php
PHP
mit
416
<?php if($page): ?> <div id="products"><!--start products--> <div class="box"> <div class="box_left"> <div class="box_right"><a href="#" title=""><?php echo $title; ?></a></div> </div> </div> <div class="article"> <h1><?php echo $page->title ?></h1> <?php echo $page->content ?> <p class="date">Đăng ngày: <?php echo date('d-m-Y H:i:s', $page->created) ?></p> </div> </div> <?php endif; ?>
12-05-2011-wharfland-project
trunk/modules/article/views/client/page/detail.php
PHP
mit
468
<div id="products"><!--start products--> <?php if(isset ($articles) == TRUE && count($articles) > 0) : ?> <div class="box"> <div class="box_left"> <div class="box_right"><a href="#" title=""><?php echo $title ?></a></div> </div> </div> <div class="article"> <div> <form id="form-filter" method="post"> <p> <label>Sắp xếp:</label> <select name="order"> <option value="desc" <?php if(Session::instance()->get('order','desc') == 'desc'){ echo 'selected';} ?>>Gần đây</option> <option value="asc" <?php if(Session::instance()->get('order','desc') == 'asc'){ echo 'selected';} ?>>Cũ nhất</option> </select> </p> </form> </div> <ul class="others"> <?php foreach($articles as $obj) : preg_match('/<\s*img [^\>]*src\s*=\s*(["\'])(.*?)\1/', $obj->content, $matches); if (is_array($matches) && !empty($matches)) { $image = $matches[2]; } else { $image = Url::site('assets/client/images/no-image.jpg'); } ?> <li> <p class="img"> <span> <img src="<?php echo $image ?>" alt="" width="100" height="100" /> </span> </p> <p class="title"> <a href="<?php echo Route::url($route,array('id' => $obj->id,'slug' => $obj->slug)); ?>"><?php echo $obj->title ?></a> <span>(26/05)</span> <br /> <?php echo $obj->summary ?> </p> </li> <?php endforeach; ?> </ul> <?php echo $pagination->display(); ?> <div class="clear"></div> </div> <?php else: ?> <div id="bg_products"> <p>Không tìm thấy bài viết nào</p> </div> <?php endif; ?> </div><!--end products--> <script type="text/javascript"> $(document).ready(function(){ $('select[name="order"]').bind('change',function(){ $("#form-filter").trigger('submit'); }); }); </script>
12-05-2011-wharfland-project
trunk/modules/article/views/client/page/list.php
PHP
mit
2,282
<div class="box"> <div class="box_left"> <div class="box_right"><span>Tin tức nổi bật</span></div> </div> </div> <div class="box_1"> <ul id="news_detail"> <?php if(isset ($articles) == TRUE && count($articles) > 0) : foreach($articles as $obj) : preg_match('/<\s*img [^\>]*src\s*=\s*(["\'])(.*?)\1/', $obj->content, $matches); if (is_array($matches) && !empty($matches)) { $image = $matches[2]; } else { $image = Url::site('assets/client/images/no-image.jpg'); } ?> <li> <a href="<?php echo Url::site('article/detail/' . $obj->id) ?>"><img src="<?php echo $image ?>" alt=""></a> <h2><a href="<?php echo Url::site('article/detail/' . $obj->id) ?>"><?php echo $obj->title ?></a></h2> </li> <?php endforeach; endif; ?> </ul> </div>
12-05-2011-wharfland-project
trunk/modules/article/views/client/latest_articles.php
PHP
mit
885
<div id="products"><!--start products--> <?php if(isset ($articles) == TRUE && count($articles) > 0) : ?> <div class="box"> <div class="box_left"> <div class="box_right"><span><?php echo $category->name ?></span></div> </div> </div> <div class="article"> <ul class="others"> <?php foreach($articles as $obj) : preg_match('/<\s*img [^\>]*src\s*=\s*(["\'])(.*?)\1/', $obj->content, $matches); if (is_array($matches) && !empty($matches)) { $image = $matches[2]; } else { $image = Url::site('assets/image/no-image.jpg'); } ?> <li> <p class="img"> <span> <img src="<?php echo $image ?>" alt="" width="100" /> </span> </p> <p class="title" style="width: 340px;"> <a href="<?php echo Url::site('article/detail/' . $obj->id) ?>"><?php echo $obj->title ?></a> <span>(26/05)</span> <br /> <?php echo $obj->summary ?> </p> </li> <?php endforeach; ?> </ul> <div class="clear"></div> <div id="page"> <ul> <li class="page_home">Trang: </li> <?php echo $pagination ?> </ul> </div> </div> <?php else : ?> <div class="box"> <div class="box_left"> <div class="box_right"><a href="#" title="">Lỗi</div> </div> </div> <div class="article"> Không tìm thấy dữ liệu gì </div> <?php endif; ?> </div><!--end products-->
12-05-2011-wharfland-project
trunk/modules/article/views/client/category_article.php
PHP
mit
1,720
<div id="products"><!--start products--> <div class="box"> <div class="box_left"> <div class="box_right"><span>Tin Tức</span></div> </div> </div> <div class="article"> <h1><?php echo $article->title ?></h1> <p class="summary"><?php echo $article->summary ?></p> <p class="date">Đăng ngày: <?php echo date('d-m-Y H:i:s', $article->created) ?></p> <?php echo $article->content ?> </div> <?php if(isset ($other_articles) == TRUE && count($other_articles) > 0) : ?> <div class="box"> <div class="box_left"> <div class="box_right"><a href="#" title="">Tin Khác</a></div> </div> </div> <div class="article"> <ul class="others"> <?php foreach($other_articles as $obj) : preg_match('/<\s*img [^\>]*src\s*=\s*(["\'])(.*?)\1/', $obj->content, $matches); if (is_array($matches) && !empty($matches)) { $image = $matches[2]; } else { $image = Url::site('assets/image/no-image.jpg'); } ?> <li> <p class="img"> <span> <img src="<?php echo $image ?>" alt="" width="100" /> </span> </p> <p class="title"> <a href="<?php echo Url::site('article/detail/' . $obj->id) ?>"><?php echo $obj->title ?></a> <span>(<?php echo date('d/m/Y', $obj->created) ?>)</span> <br /> <?php echo $obj->summary ?> </p> </li> <?php endforeach; ?> </ul> </div> <?php endif; ?> </div><!--end products-->
12-05-2011-wharfland-project
trunk/modules/article/views/client/article_detail.php
PHP
mit
1,726
<h2>Quản lý tin tức</h2> <div class="content-box"><!-- Start Content Box --> <div class="content-box-header"> <h3>Các bài viết</h3> <ul class="content-box-tabs"> <li><a href="#tab1" class="default-tab">Tin đã đăng</a></li> <!-- href must be unique and match the id of target div --> <li><a href="#tab2">Tin chờ duyệt</a></li> </ul> <div class="clear"></div> </div> <!-- End .content-box-header --> <div class="content-box-content"> <form name="frm_search_article" method="post" action="<?php echo Url::site('admin/article/search') ?>"> <fieldset> <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns --> <p> <label>Từ khóa <input type="text" name="keyword" class="text-input small-input" /> <input type="submit" name="submit" value="Tìm kiếm" class="button" /></label> </p> </fieldset> </form> <div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab --> <?php if(isset ($articles) == TRUE && count($articles) > 0) : ?> <form name="frm_manage_article" method="post" action="<?php echo Url::site('admin/article/delete') ?>"> <table> <thead> <tr> <th><input class="check-all" type="checkbox" /></th> <th>Tiêu Đề</th> <th>Danh Mục</th> <th>Tóm Tắt</th> <th>Ngày Đăng</th> <th>Tác Vụ</th> </tr> </thead> <tfoot> <tr> <td colspan="6"> <div class="bulk-actions align-left"> <input name="submit" value="Xóa bài đã chọn" type="submit" class="button" /> <?php echo $category->render() ?> <input id="btn_view_by_category" value="Xem theo danh mục" type="button" class="button" /> </div> <div class="pagination"> <?php if(isset ($pagination) == TRUE) $pagination->display() ?> </div> <!-- End .pagination --> <div class="clear"></div> </td> </tr> </tfoot> <tbody> <?php foreach($articles as $obj) : ?> <tr> <td><input type="checkbox" name="article_id[]" value="<?php echo $obj->id ?>" /></td> <td><a href="<?php echo Url::site('admin/article/edit/' . $obj->id) ?>" title=""><?php echo $obj->title ?></a></td> <td><?php echo $obj->Category->name ?></td> <td><?php echo $obj->summary ?></td> <td><?php echo date('d-m-Y H:i:s', $obj->created) ?></td> <td> <!-- Icons --> <a href="<?php echo Url::site('admin/article/edit/' . $obj->id) ?>" title="Edit"><img src="<?php echo $assets_image . '/icons/pencil.png'; ?>" alt="Edit" /></a> <a href="<?php echo Url::site('admin/article/delete/' . $obj->id) ?>" title="Xóa bài viết"><img src="<?php echo $assets_image . '/icons/cross.png'; ?>" alt="Xóa" /></a> </td> </tr> <?php endforeach; ?> </tbody> </table> </form> <?php else : ?> <p>Không có bài viết nào</p> <?php endif; ?> </div> <!-- End #tab1 --> <!-- Begin new tab2 --> <div class="tab-content" id="tab2"> <?php if(isset ($pending_articles) == TRUE && count($pending_articles) > 0) : ?> <form name="frm_manage_article" method="post" action="<?php echo Url::site('admin/article/delete') ?>"> <table> <thead> <tr> <th><input class="check-all" type="checkbox" /></th> <th>Tiêu Đề</th> <th>Danh Mục</th> <th>Tóm Tắt</th> <th>Ngày Đăng</th> <th>Tác Vụ</th> </tr> </thead> <tfoot> <tr> <td colspan="6"> <div class="bulk-actions align-left"> <input name="submit" value="Xóa bài đã chọn" type="submit" class="button" /> <?php echo $category->render() ?> <input id="btn_view_by_category" value="Xem theo danh mục" type="button" class="button" /> </div> <div class="clear"></div> </td> </tr> </tfoot> <tbody> <?php foreach($pending_articles as $obj) : ?> <tr> <td><input type="checkbox" name="article_id[]" value="<?php echo $obj->id ?>" /></td> <td><a href="<?php echo Url::site('admin/article/edit/' . $obj->id) ?>" title=""><?php echo $obj->title ?></a></td> <td><?php echo $obj->Category->name ?></td> <td><?php echo $obj->summary ?></td> <td><?php echo date('d-m-Y H:i:s', $obj->created) ?></td> <td> <!-- Icons --> <a href="<?php echo Url::site('admin/article/edit/' . $obj->id) ?>" title="Edit"><img src="<?php echo $assets_image . '/icons/pencil.png'; ?>" alt="Edit" /></a> <a href="<?php echo Url::site('admin/article/delete/' . $obj->id) ?>" title="Xóa bài viết"><img src="<?php echo $assets_image . '/icons/cross.png'; ?>" alt="Xóa" /></a> </td> </tr> <?php endforeach; ?> </tbody> </table> </form> <?php else : ?> <p>Không có bài viết nào</p> <?php endif; ?> </div> <!-- End tab2 --> </div> <!-- End .content-box-content --> </div> <!-- End .content-box --> <script type="text/javascript"> $(function(){ Sidebar.setActive(Sidebar.menu.article, 1); $('#btn_view_by_category').click(function() { _id = $('select[name=category_id]').val(); _url = '<?php echo Url::site('admin/article/category') ?>/' + _id; window.location = _url; }); }); </script>
12-05-2011-wharfland-project
trunk/modules/article/views/admin/article_manage.php
PHP
mit
7,091
<?php if(isset($message) == TRUE) : ?> <div class="notification <?php echo $message['type'] ?> png_bg"> <a class="close" href="#"><img alt="close" title="Đóng" src="<?php echo Url::site('assets/admin/images/icons/cross_grey_small.png') ?>"></a> <div><?php echo $message['content'] ?></div> </div> <?php endif; ?> <div class="clear"></div> <div class="content-box"><!-- Start Content Box --> <div class="content-box-header"> <h3>Sửa thông tin bài viết</h3> <div class="clear"></div> </div> <!-- End .content-box-header --> <div class="content-box-content"> <form method="post" action="<?php echo Url::site('admin/article/edit/' . $article->id) ?>"> <fieldset> <p> <label>Tiêu đề</label> <input type="text" name="title" class="text-input medium-input" value="<?php echo $article->title ?>" /> </p> <p> <label>Tóm tắt</label> <textarea rows="15" cols="49" name="summary" class="text-input textarea"><?php echo $article->summary ?></textarea> </p> <p> <label>Nội dung</label> <textarea rows="15" cols="79" name="content" class="text-input textarea tinymce"><?php echo $article->content ?></textarea> </p> <p> <label>Thư mục đăng tin</label> <?php echo $category->render() ?> <select class="small-input" name="dropdown"> </select> </p> <p> <label>Trạng thái</label> <select name="status"> <?php foreach(Article::getStatusAsArray() as $key => $value): ?> <option <?php if($article->status == $key){ echo 'selected'; } ?> value="<?php echo $key; ?>"><?php echo $value; ?></option> <?php endforeach; ?> </select> </p> <p> <input type="submit" name="submit" value="Đăng tin" class="button"> </p> </fieldset> <div class="clear"></div><!-- End .clear --> </form> </div> <!-- End .content-box-content --> </div> <script type="text/javascript"> $(function(){ Sidebar.setActive(Sidebar.menu.article, 0); $('select[name="category_id"] option').each(function(index, elem) { if(elem.value == <?php echo $article->category_id ?>) { elem.selected = true; return; } }); }); </script>
12-05-2011-wharfland-project
trunk/modules/article/views/admin/article_edit.php
PHP
mit
2,738
<?php if(isset($message) == TRUE) : ?> <div class="notification <?php echo $message['type'] ?> png_bg"> <a class="close" href="#"><img alt="close" title="Đóng" src="<?php echo Url::site('assets/admin/images/icons/cross_grey_small.png') ?>"></a> <div><?php echo $message['content'] ?></div> </div> <?php endif; ?> <div class="clear"></div> <div class="content-box"><!-- Start Content Box --> <div class="content-box-header"> <h3>Đăng bài viết mới</h3> <div class="clear"></div> </div> <!-- End .content-box-header --> <div class="content-box-content"> <form method="post" action="<?php echo Url::site('admin/article/create') ?>"> <fieldset> <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns --> <p> <label>Tiêu đề</label> <input type="text" name="title" class="text-input medium-input" /> </p> <p> <label>Tóm tắt</label> <textarea rows="15" cols="49" name="summary" class="text-input textarea"></textarea> </p> <p> <label>Nội dung</label> <textarea rows="15" cols="79" name="content" class="text-input textarea tinymce"></textarea> </p> <p> <label>Thư mục đăng tin</label> <?php echo $category->render() ?> <select class="small-input" name="dropdown"> </select> </p> <p> <label>Trạng thái</label> <select name="status"> <?php foreach(Article::getStatusAsArray() as $key => $value): ?> <option value="<?php echo $key; ?>"><?php echo $value; ?></option> <?php endforeach; ?> </select> </p> <p> <input type="submit" name="submit" value="Đăng tin" class="button"> </p> </fieldset> <div class="clear"></div><!-- End .clear --> </form> </div> <!-- End .content-box-content --> </div> <script type="text/javascript"> $(function(){ Sidebar.setActive(Sidebar.menu.article, 0); }); </script>
12-05-2011-wharfland-project
trunk/modules/article/views/admin/article_create.php
PHP
mit
2,428
<?php Route::set('admin-article-category','admin/article/category(/<id>)(/page-<page>)')->defaults(array( 'directory' => 'admin', 'controller' => 'article', 'action' => 'category', 'id' => null, 'page' => 1 )); Route::set('client-article-category','article/category(/<id>)(/page-<page>)')->defaults(array( 'controller' => 'article', 'action' => 'category', 'id' => null, 'page' => 1 ));
12-05-2011-wharfland-project
trunk/modules/article/init.php
PHP
mit
460
<?php defined('SYSPATH') or die('No direct script access.'); class Controller_Page extends Controller_Client_Layout { const NEWS_CATEGORY_ID = 2; const PROJECT_CATEGORY_ID = 4; const FUNNY_CATEGORY_ID = 6; const FENG_SHUI_CATEGORY_ID = 7; const SHAREHOLDER_CATEGORY_ID = 11; const ABOUT_CATEGORY_ID = 9; const RECRUITMENT_CATEGORY_ID = 10; const PAPER_CATEGORY_ID = 12; const INTERNAL_CATEGORY_ID = 13; public function __construct(Request $request, Response $response) { parent::__construct($request, $response); if(Request::current()->method() === 'POST') { if(isset($_POST['order'])) { Session::instance()->set('order', Security::xss_clean(Arr::get($_POST, 'order'))); } } } public function after() { $this->set_main_right(null); parent::after(); } /** * get articles with category id = 2 */ public function action_news() { if(!is_null($this->request->param('id',NULL))) { $page = ArticleTable::getInstance()->findOneById($this->request->param('id',NULL)); if(!$page) Error::error_404 (); // Add +1 to views $page->countPageview(); $this->set_contents(View::client('page/detail')->set(array( 'page' => $page, 'title' => 'Tin tức' ))); } else { $list = $this->get_list(self::NEWS_CATEGORY_ID,'news'); $this->set_contents(View::client('page/news')->set(array( 'articles' => $list['articles'], 'pagination' => $list['pagination'], 'route' => 'news', 'category' => Libs_Category::getInstance()->getCategoryById(self::NEWS_CATEGORY_ID) ))); } } public function action_category() { $category_id = $this->request->param('id',0); $list = $this->get_list($category_id,'news-category',true); $this->set_contents(View::client('page/news')->set(array( 'articles' => $list['articles'], 'pagination' => $list['pagination'], 'route' => 'news', 'category' => Libs_Category::getInstance()->getCategoryById(self::NEWS_CATEGORY_ID) //category id tin tuc ))); } /** * get articles with category id = 4 */ public function action_project() { $this->get_pages(4,'Dự án','project'); } /** * get article with category id = 9 * one page */ public function action_about() { $page = Doctrine_Query::create() ->from('Article a') ->where('a.category_id = ?',self::ABOUT_CATEGORY_ID) ->andWhere('a.status = ?',Article::STATUS_APPROVAL) ->fetchOne(); $this->set_contents(View::client('page/static')->set(array( 'title' => 'Giới thiệu', 'page' => $page ))); } /** * page id = 10 */ public function action_recruitment() { $page = Doctrine_Query::create() ->from('Article a') ->where('a.category_id = ?',self::RECRUITMENT_CATEGORY_ID) ->andWhere('a.status = ?',Article::STATUS_APPROVAL) ->fetchOne(); $this->set_contents(View::client('page/static')->set(array( 'title' => 'Tuyển dụng', 'page' => $page ))); } /** * get articles with category id = 7 */ public function action_feng_shui() { $this->get_pages(self::FENG_SHUI_CATEGORY_ID,'Phong thủy','feng_shui'); } /** * get articles with category id = 6 */ public function action_funny() { $this->get_pages(self::FUNNY_CATEGORY_ID,'Giải trí','funny'); } /** * get articles with category id = 11 */ public function action_shareholder() { $this->get_pages(self::SHAREHOLDER_CATEGORY_ID,'Thông tin cổ đông','shareholder'); } /** * get articles with self::PAPER_CATEGORY_ID */ public function action_paper() { $this->get_pages(self::PAPER_CATEGORY_ID,'Tin báo chí','paper'); } /** * get articles with self::INTERNAL_CATEGORY_ID */ public function action_internal() { $this->get_pages(self::INTERNAL_CATEGORY_ID,'Tin tức nội bộ','internal'); } /** * @todo display page to view * @param type $category_id category id * @param type $title title of the page * @param type $route route name of the page */ private function get_pages($category_id,$title,$route) { //get all param from current request $params = $this->request->param(); if(is_numeric($params['id'])) { //display article with $params['id'] $this->get_page($params['id'], $category_id, $title); } else { $list = $this->get_list($category_id, $route); $this->set_contents(View::client('page/list')->set(array( 'articles' => $list['articles'], 'pagination' => $list['pagination'], 'title' => $title, 'route' => $route ))); } } /** * get one page view detail * @param type $id page id * @param type $title title of the page */ private function get_page($id,$category_id,$title) { $page = ArticleTable::getInstance()->findOneById($id); if(!$page) Error::error_404 (); if($page->category_id != $category_id) Error::error_404 (); $this->set_contents(View::client('page/detail')->set(array( 'page' => $page, 'title' => $title ))); } private function get_list($category_id,$route,$is_news_category = false) { $params = $this->request->param(); //display list article by category $query = Doctrine_Query::create() ->from('Article a') ->where('a.category_id = ?',$category_id) ->andWhere('a.status = ?',Article::STATUS_APPROVAL); $query->orderBy('a.created '.Session::instance()->get('order', 'DESC')); $pager = new Doctrine_Pager($query, $params['page'], 5); $pagerRange = new Doctrine_Pager_Range_Sliding(array('chunk' => 5),$pager); $urlMask = Route::url($route,array('page' => '{%page_number}')); if($is_news_category) { $category = Libs_Category::getInstance()->getCategoryById($category_id); if($category) { $urlMask = Route::url($route,array('id' => $category->id, 'slug' => $category->slug,'page' => '{%page_number}')); } } $pagination = new CustomPagerLayout($pager, $pagerRange,$urlMask); $pagination->setTemplate('<a href="{%url}" class="number" title="Trang {%page}">{%page}</a>'); $pagination->setSelectedTemplate('<a href="{%url}" class="number current" title="Trang {%page}">{%page}</a>'); return array( 'articles' => $pager->execute(), 'pagination' => $pagination ); } }
12-05-2011-wharfland-project
trunk/modules/article/classes/controller/page.php
PHP
mit
7,722
<?php class Controller_Article extends Controller_Client_Layout { /** * View an article * * @access public * @param <int> $id */ public function action_detail($id) { $id = (int) $id; if($id === 0) { throw new Exception('Không tìm thấy bài viết yêu cầu'); } $article = ArticleTable::getInstance()->find($id); if($article !== NULL) { if($article->status != Article::STATUS_APPROVAL) Error::error_404 (); // Add +1 to views $article->countPageview(); $other_article = Doctrine_Query::create()->from('Article a') ->where('a.id <> ?', $id) ->addWhere('a.category_id = ?', $article->category_id) ->addWhere('a.status = ?', Article::STATUS_APPROVAL) ->orderBy('a.id DESC') ->limit(5) ->execute(); $this->set_main_right(NULL); $this->set_contents(View::client('article_detail', array( 'article' => $article, 'other_articles' => $other_article ))); } } /** * Get articles in a category, with pagination * * @access public * @param <int> $category_id * @param <int> $page * @return <type> */ public function action_category($category_id, $page = 1) { $category_id = (int) $category_id; if($category_id <= 0) { // TODO: Show error page throw new Exception('Danh mục không hợp lệ'); return; } // Get category information $category = CategoryTable::getInstance()->find($category_id); $pager = new Doctrine_Pager( Doctrine_Query::create() ->from( 'Article a' ) ->where('a.category_id = ?', $category_id) ->addWhere('a.status = ?',Article::STATUS_APPROVAL) ->orderby( 'a.id DESC' ), $page); $pager->getExecuted(); $articles = $pager->execute(); $page_ranger = new Doctrine_Pager_Range_Sliding(array('chunk' => 25), $pager); // TODO: Category URl $pagination = new Doctrine_Pager_Layout($pager, $page_ranger, Url::site('article/category/'.$category_id.'/page-{%page}')); $pagination->setTemplate('<li><a href="{%url}" class="number" title="Trang {%page}">{%page}</a></li>'); $pagination->setSelectedTemplate('<li class="page_1"><a href="{%url}" class="number current" title="Trang {%page}">{%page}</a></li>'); $this->set_contents(View::factory('client/category_article', array( 'category' => $category, 'articles' => $articles, 'pagination' => $pagination ))); } /** * Get latest * @return <type> */ public function action_get_latest() { $this->auto_render = FALSE; $articles = Doctrine_Query::create()->from('Article a') ->Where('a.status = ?', Article::STATUS_APPROVAL) ->whereIn('a.category_id',array(2,12,13)) ->orderBy('a.views DESC,a.created DESC') ->limit(10) ->execute(); $this->response->body(View::factory('client/latest_articles', array( 'articles' => $articles ))->render()); } }
12-05-2011-wharfland-project
trunk/modules/article/classes/controller/article.php
PHP
mit
3,552
<?php defined('SYSPATH') or die('No direct script access.'); /** * Article controller (Admin) * * @author an.cao <a@clgt.vn> * @since May 2011 */ class Controller_Admin_Article extends Controller_Admin_Layout { /** * Show all articles in database * * @access public */ public function action_manage($page = 1) { $pager = new Doctrine_Pager( Doctrine_Query::create() ->from( 'Article a' ) ->orderby( 'a.id DESC' ), $page ); $pager->getExecuted(); $articles = $pager->execute(); $page_ranger = new Doctrine_Pager_Range_Sliding(array('chunk' => 5), $pager); $pagination = new Doctrine_Pager_Layout($pager, $page_ranger, Url::site('admin/article/manage/{%page}')); $pagination->setTemplate('<a href="{%url}" class="number" title="Trang {%page}">{%page}</a>'); $pagination->setSelectedTemplate('<a href="{%url}" class="number current" title="Trang {%page}">{%page}</a>'); $this->template->main = View::factory('admin/article_manage', array( 'articles' => $articles, 'pagination' => $pagination, 'category' => Libs_Category::getInstance()->render('category_id'), 'pending_articles' => Doctrine_Query::create() ->from('Article a') ->where('a.status = ?', Article::STATUS_PENDING)->orderBy('a.id DESC')->execute() )); } /** * Search artiles with the given keywords * * @access public * @param <int> $page */ public function action_search($page = 1) { $post = Arr::extract($_POST, array('keyword')); if($post['keyword'] == NULL) { $this->request->redirect(Url::site('admin/article/manage')); } $pager = new Doctrine_Pager( Doctrine_Query::create() ->from( 'Article a' ) ->where('a.title LIKE ?', '%'.$post['keyword'].'%') ->orderby( 'a.id DESC' ), $page ); $pager->getExecuted(); $articles = $pager->execute(); $page_ranger = new Doctrine_Pager_Range_Sliding(array('chunk' => 5), $pager); $pagination = new Doctrine_Pager_Layout($pager, $page_ranger, Url::site('admin/article/manage/{%page}')); $pagination->setTemplate('<a href="{%url}" class="number" title="Trang {%page}">{%page}</a>'); $pagination->setSelectedTemplate('<a href="{%url}" class="number current" title="Trang {%page}">{%page}</a>'); $this->template->main = View::factory('admin/article_manage', array( 'articles' => $articles, 'pagination' => $pagination )); } /** * Create a new article * * @access public * @return <type> */ public function action_create() { $data = array(); // Data is submitted if($this->request->method() === 'POST') { $post = Validation::factory($_POST) ->rule(TRUE, 'trim') ->rule('title', 'not_empty') ->rule('title', 'max_length', array(':value', 255)); // Data is valid if($post->check() == TRUE) { $post = Arr::extract($_POST, array('title', 'summary', 'content', 'category_id','status')); try { $article = new Article(); $article->title = $post['title']; $article->category_id = $post['category_id']; $article->summary = $post['summary']; $article->content = $post['content']; $article->status = $post['status']; $user_info = Api::load('user')->get_user_info(); /** * if user not login with admin role, and then set land status to pending */ if(!Api::load('user')->has_role($user_info['id'],'admin')) { $article->status = Article::STATUS_PENDING; } $article->save(); $data['message'] = array( 'type' => 'success', 'content' => 'Đăng bài viết thành công' ); } catch (Exception $ex) { $data['message'] = array( 'type' => 'success', 'content' => $ex->getMessage() ); } } else { $data['message'] = array( 'type' => 'error', 'content' => 'Dữ liệu nhập vào không hợp lệ. Vui lòng thử lại' ); } } $this->add_scripts(Url::vendors().'tiny_mce/jquery.tinymce.js'); $this->add_scripts(Url::admin_assets().'js/tinymce.js'); $data['category'] = Libs_Category::getInstance()->render('category_id'); $this->template->main = View::factory('admin/article_create', $data); } /** * Edit an article * * @access public * @param <int> $id */ public function action_edit($id) { if((int) $id <= 0) { $this->request->redirect(Url::site('admin/article/manage')); } $data = array(); $article = ArticleTable::getInstance()->find($id); if($article == NULL) { $this->request->redirect(Url::site('admin/article/manage')); } // If there are submitted data if($this->request->method() === 'POST') { $article->setArray(Arr::extract($_POST, array('title', 'summary', 'content', 'category_id','status'))); $user_info = Api::load('user')->get_user_info(); /** * if user not login with admin role, and then set land status to pending */ if(!Api::load('user')->has_role($user_info['id'],'admin')) { $article->status = Article::STATUS_PENDING; } $article->save(); } $this->add_scripts(Url::vendors().'tiny_mce/jquery.tinymce.js'); $this->add_scripts(Url::admin_assets().'js/tinymce.js'); $data['article'] = $article; $data['category'] = Libs_Category::getInstance()->render('category_id'); $this->template->main = View::factory('admin/article_edit', $data); } /** * Delete selected articles * * @access public */ public function action_delete($id = NULL) { // If not direct access if(! ($this->request->method() === 'GET' && $id === NULL)) { try { $query = Doctrine_Query::create() ->delete('Article a'); // Bulk delete if(isset($_POST['submit']) === TRUE) { $post = Arr::extract($_POST, array('article_id')); if(count($post['article_id']) > 0) { $query->whereIn('a.id', $post['article_id']); } } // If a single artilce if((int) $id > 0) { $query->where('a.id = ?', $id); } // Execute query $query->execute(); } catch(Exception $ex) { // TODO: Handle errors } } $this->request->redirect(Url::site('admin/article/manage')); } /** * Quán lý bài viết theo danh mục * * @access public * @param <int> $category_id * @param <int> $page */ public function action_category($category_id, $page = 1) { $category_id = (int) $category_id; if($category_id <= 0) { throw new Exception('Danh mục không hợp lệ'); } $pager = new Doctrine_Pager( Doctrine_Query::create() ->from( 'Article a' ) ->where('a.category_id = ?', $category_id) ->orderby( 'a.id DESC' ), $page); $pager->getExecuted(); $articles = $pager->execute(); $page_ranger = new Doctrine_Pager_Range_Sliding(array('chunk' => 5), $pager); $pagination = new Doctrine_Pager_Layout($pager, $page_ranger, Url::site('admin/article/category/'.$category_id.'/page-{%page}')); $pagination->setTemplate('<a href="{%url}" class="number" title="Trang {%page}">{%page}</a>'); $pagination->setSelectedTemplate('<a href="{%url}" class="number current" title="Trang {%page}">{%page}</a>'); $this->template->main = View::factory('admin/article_manage', array( 'articles' => $articles, 'pagination' => $pagination, 'category' => Libs_Category::getInstance()->render('category_id') )); } }
12-05-2011-wharfland-project
trunk/modules/article/classes/controller/admin/article.php
PHP
mit
9,525
<h3><?php echo Lib_Setting::get('site_name'); ?></h3> <p>Bạn đã nhận đuợc 1 emai liên hệ từ <?php echo $email; ?> </p> <p>Thông tin liên hệ:</p> <p>Người gởi:<?php echo $name ?></p> <p>Địa chỉ:<?php echo $address ?></p> <p>Điện thoại: <?php echo $phone; ?></p> <p>Nội dung: <?php echo $content; ?></p>
12-05-2011-wharfland-project
trunk/modules/clgt/views/client/contact/mail.php
PHP
mit
337
<div id="products"><!--start products--> <div class="box"> <div class="box_left"> <div class="box_right"><a href="#">Liên hệ</a></div> </div> </div> <div id="bg_products"> <?php echo FlashMessage::getInstance()->display('flashmessage/warning'); ?> <form id="contact_form" method="post"> <p><em>(*)</em> thông tin bắt buộc</p> <p> <label>Họ tên<em>*</em> :</label> <input name='name' class="text" /> </p> <p> <label>Địa chỉ<em>*</em> :</label> <input name='address' style="width: 300px" class="text" /> </p> <p> <label>Điện thoại :</label> <input name='phone' class="text" /> </p> <p> <label>Email<em>*</em> :</label> <input name='email' class="text" /> </p> <p> <label>Tiêu đề<em>*</em> :</label> <input name='title' style="width: 300px" class="text" /> </p> <p> <label> Nội dung :<em>*</em> </label> <textarea name="content" rows="5"></textarea> </p> <p> <label></label> <input type="submit" name="send" value="Gửi đi" /> <input type="reset" name="reset" value="Làm lại" /> </p> </form> <div class="info"> <h4>Wharfland group</h4> <p>Địa chỉ : Lô K1 Ô 34, đường NE8, Khu TĐC Mỹ Phước 3, xã Thới Hoà, Bến Cát, Bình </p> <p>Điện thoại : (0650) 3 510 558 - (08) 35 111 888 </p> <p>Fax : (0650) 3 510 559 </p> <p>Email : info@wharfland.com - Website : www.wharfland.com</p> <h4>Văn phòng làm việc</h4> <p>Địa chỉ : Lô K1 Ô 34, đường NE8, Khu TĐC Mỹ Phước 3, xã Thới Hoà, Bến Cát, Bình </p> <p>Điện thoại : (0650) 3 510 558 - (08) 35 111 888 </p> <p>Fax : (0650) 3 510 559 </p> <p>Email : info@wharfland.com - Website : www.wharfland.com</p> </div> <div class="clear"></div> </div> </div>
12-05-2011-wharfland-project
trunk/modules/clgt/views/client/contact/index.php
PHP
mit
2,455
<?php $i=0; foreach($messages as $type => $msg) : $i++ ?> <!-- loi --> <?php if ($type == 'error') : ?> <?php if ($i===1) : ?> <div id="errorMsg"> <h3>Có lổi xảy ra</h3> <ol> <?php endif; ?> <?php foreach ($msg as $s) { echo '<li>' . $s . '</li>'; } ?> <?php if ($i===1) : ?> </ol> </div> <?php endif; ?> <?php endif; ?> <!-- end loi --> <!-- thanh cong --> <?php if ($type === 'success') : ?> <?php if ($i===1) : ?> <div id="okMsg"> <?php endif; ?> <?php foreach ($msg as $s) { echo '<li>' . $s . '</li>'; } ?> <?php if ($i===1) : ?> </div> <?php endif; ?> <?php endif ?> <!-- end thanh cong --> <?php endforeach ?>
12-05-2011-wharfland-project
trunk/modules/clgt/views/flashmessage/uniform.php
PHP
mit
704
<!-- Start Notifications --> <?php if(count($messages) > 0):?> <?php foreach($messages as $type => $msgs): ?> <?php foreach ($msgs as $msg) :?> <div class="notification <?php echo $type ?> png_bg"> <a href="#" class="close"><img src="<?php echo Url::admin_assets() . '/images/icons/cross_grey_small.png'; ?>" title="Close this notification" alt="close" /></a> <div> <?php echo $msg; ?> </div> </div> <?php endforeach;?> <?php endforeach;?> <?php endif;?> <!-- End Notifications -->
12-05-2011-wharfland-project
trunk/modules/clgt/views/flashmessage/render.php
PHP
mit
496
<!-- Start Notifications --> <?php if(count($messages) > 0):?> <?php foreach($messages as $type => $msgs): ?> <div class="notification <?php echo $type; ?> png_bg"> <?php foreach ($msgs as $msg) :?> <p><?php echo $msg; ?></p> <?php endforeach;?> </div> <?php endforeach;?> <?php endif;?> <!-- End Notifications -->
12-05-2011-wharfland-project
trunk/modules/clgt/views/flashmessage/warning.php
PHP
mit
337
<?php defined('SYSPATH') or die('No direct script access.'); class Mailer { public static function SendMail($sender,$receiver,$message, $bcc = '') { $email = Email::connect(); $message = new Swift_Message($message['subject'],$message['message'],'text/html',"utf-8"); $message->setFrom($sender); if (is_array($bcc)) { foreach($bcc as $value) { $message->addBcc($value); } } else { if (!is_null($bcc) && ($bcc != "")) { $message->addBcc($bcc); } } if(is_array($receiver)) { foreach($receiver as $value) { $message->addTo($value); } } else { if (!is_null($receiver) && ($receiver != "")) { $message->addTo ($receiver); } } return $email->send($message); } }
12-05-2011-wharfland-project
trunk/modules/clgt/classes/mailer.php
PHP
mit
1,031
<?php defined('SYSPATH') or die('No direct script access.'); class FlashMessage { /** * Type of message */ const ERROR = 'error'; const WARNING = 'warning'; const NOTICE = 'notice'; const ATTENTION = 'attention'; const INFORMATION = 'information'; const SUCCESS = 'success'; protected $messages; protected $type; private static $instance; public function __construct(){ if(!is_null(Session::instance()->get('fmessage',null))){ $this->messages = unserialize(Session::instance()->get('fmessage')); } } public static function getInstance(){ if(!isset(self::$instance)) self::$instance = new FlashMessage(); return self::$instance; } /** * parse error cho doctrine */ public function doctrine($params) { /* array 'first_name' => array 0 => string 'notblank' (length=8) 1 => string 'email' (length=5) 'email' => array 0 => string 'email' (length=5) */ if (is_array($params)) { foreach($params as $field => $rules) { $field = __($field); // translate field name $values = array( ':field' => $field, ); $this->add(array( self::ERROR => __(Kohana::message('validation', $rules[0]), $values), )); } } else { //success $this->add(array( self::SUCCESS => 'thao tác thành công', )); } } /** * @param $message type : array * @example : Array( * FlashMessage::ERROR => 'u have an error here', * FlashMessage::WARNING => 'u have another warning too', * ) * @param $isNew If you want to begin new session, this mean your message won't merge with old message in session * old message in stack will be deleted */ public function add($message,$type = self::ERROR,$isNew = false){ if($isNew){ $this->refresh(); } // neu truyen vao thong bao ma ko co type // thi mac dinh coi nhu do la thong bao loi if(is_string($message)) { $temp[$type] = $message; $message = $temp; unset($temp); } //append new message to messages foreach($message as $type => $msg){ $this->messages[$type][] = $msg; } $this->serialize(); return $this; } /** * If you need to render your message in html view * Return html view for this message */ public function display($template = 'flashmessage/render'){ // neu ko co messages thi khoi display if (count($this->messages) === 0) return FALSE; if( strpos($template, 'flashmessage') === FALSE) { $template = 'flashmessage/' . $template; } $view = View::factory($template)->set(array( 'messages' => $this->messages, 'type' => $this->type )); //clear current message in session $this->refresh(); return $view->render(); } private function serialize(){ Session::instance()->set('fmessage',serialize($this->messages)); } /** * Clear sesion and renew one */ private function refresh(){ Session::instance()->delete('fmessage'); } /** * Serialize the message to session before destruct this class */ public function __destruct(){ Session::instance()->set('fmessage',serialize($this->messages)); } }
12-05-2011-wharfland-project
trunk/modules/clgt/classes/flashmessage.php
PHP
mit
3,291
<?php defined('SYSPATH') or die('No direct script access.'); class Tools { public static function get_admin_item_page() { /** * we will return this value from db * Change it later */ return 5; } public static function get_client_item_page() { return 5; } public static function get_contact_mail() { return 'clgt@clgt.vn'; } public static function get_land_image($image = null) { if(is_null($image) || empty($image)){ return Url::client_assets().'images/no-image.jpg'; }else{ return $image; } } }
12-05-2011-wharfland-project
trunk/modules/clgt/classes/tools.php
PHP
mit
564
<?php defined('SYSPATH') or die('No direct script access.'); /** * @author : thanh.dang * @version: 1.0 */ class CustomPagerLayout extends Doctrine_Pager_Layout { public function display($options = array(), $return = false) { $pager = $this->getPager(); $str = '<div class="pagination">'; if($pager->getPage() != 1) { // First page $this->addMaskReplacement('page', '&laquo;', true); $options['page_number'] = $pager->getFirstPage(); $str .= $this->processPage($options); } if($pager->getPage() > 1) { // Previous page $this->addMaskReplacement('page', '&lsaquo;', true); $options['page_number'] = $pager->getPreviousPage(); $str .= $this->processPage($options); } // Pages listing $this->removeMaskReplacement('page'); $str .= parent::display($options, true); // Next page if($pager->getPage() < $pager->getLastPage()) { $this->addMaskReplacement('page', '&rsaquo;', true); $options['page_number'] = $pager->getNextPage(); $str .= $this->processPage($options); } if($pager->getPage() != $pager->getLastPage()) { // Last page $this->addMaskReplacement('page', '&raquo;', true); $options['page_number'] = $pager->getLastPage(); $str .= $this->processPage($options); } $str .= '</div>'; // Possible wish to return value instead of print it on screen if ($return) { return $str; } echo $str; } }
12-05-2011-wharfland-project
trunk/modules/clgt/classes/custompagerlayout.php
PHP
mit
1,816
<?php defined('SYSPATH') or die('No direct script access.'); class Controller_Contact extends Controller_Client_Layout { public function action_index() { if(Request::current()->method() === 'POST') { //send contact request $keys = array('name','email','title','content','address'); $data = array(); foreach($keys as $key){ $data[$key] = trim(Arr::get($_POST,$key)); } $valid = Validation::factory($data) ->rule('name','not_empty') ->rule('email','not_empty') ->rule('title','not_empty') ->rule('content','not_empty') ->rule('address', 'not_empty'); if($valid->check()){ try { $mail = Mailer::SendMail(Tools::get_contact_mail(),array(Tools::get_contact_mail()),array( 'subject' => 'Bạn có một tin nhắn từ '.Lib_Setting::get('site_name').' - '.$data['title'], 'message' => View::client('contact/mail')->set(array($data))->render() )); } catch (Exception $e) { Kohana::$log->add(Log::ERROR,$e->getMessage()); } if(isset($mail) && $mail > 0){ FlashMessage::getInstance()->add('Email của bạn đã đuợc gởi đi thành công.', FlashMessage::SUCCESS); } }else{ FlashMessage::getInstance()->add($valid->errors('message','true'), FlashMessage::WARNING); } } $this->set_contents(View::client('contact/index')); } }
12-05-2011-wharfland-project
trunk/modules/clgt/classes/controller/contact.php
PHP
mit
1,920
<?php defined('SYSPATH') or die('No direct access allowed.'); return array ( 'default' => array ( 'type' => 'mysql', 'connection' => array( 'hostname' => '127.0.0.1', 'database' => 'wl', 'username' => 'root', 'password' => '123', 'persistent' => FALSE, ), 'table_prefix' => '', 'charset' => 'utf8', 'caching' => FALSE, 'profiling' => TRUE, ) );
12-05-2011-wharfland-project
trunk/application/config/database.php
PHP
mit
404
<?php defined('SYSPATH') OR die('No direct access allowed.'); return array( /** * SwiftMailer driver, used with the email module. * * Valid drivers are: native, sendmail, smtp */ 'driver' => 'smtp', /** * To use secure connections with SMTP, set "port" to 465 instead of 25. * To enable TLS, set "encryption" to "tls". * * Note for SMTP, 'auth' key no longer exists as it did in 2.3.x helper * Simply specifying a username and password is enough for all normal auth methods * as they are autodeteccted in Swiftmailer 4 * * PopB4Smtp is not supported in this module as I had no way to test it but * SwiftMailer 4 does have a PopBeforeSMTP plugin so it shouldn't be hard to implement * * Encryption can be one of 'ssl' or 'tls' (both require non-default PHP extensions * * Driver options: * @param null native: no options * @param string sendmail: executable path, with -bs or equivalent attached * @param array smtp: hostname, (username), (password), (port), (encryption) */ 'options' => array( 'hostname' => 'smtp.gmail.com', 'username' => 'dcongthanh@gmail.com', 'password' => '', 'port' => '25', ), );
12-05-2011-wharfland-project
trunk/application/config/email.php
PHP
mit
1,220
<div id="navigator"> <?php echo $navigator; ?> <?php if ( ! Api::load('user')->is_logged()) : ?> <div class="login"> <span><a href="<?php echo URL::site('user/login') ?>">Đăng nhập</a></span> <span><a href="<?php echo URL::site('user/create') ?>">Đăng ký</a></span> </div> <?php else: ?> <div class="login"> <span><a href="<?php echo URL::site('land/post'); ?> ">Đăng dự án</a> </span> <span><a href="<?php echo URL::site('user/logout'); ?> ">Thoát</a> </span> </div> <?php endif ?> </div>
12-05-2011-wharfland-project
trunk/application/views/client/navigator.php
PHP
mit
559
<div id="products"><!--start products--> <div class="box"> <div class="box_left"> <div class="box_right"><span>Sản phẩm đang giao dịch</span></div> </div> </div> <div id="bg_products"> <ul> <li> <span class="img_products"><a href="details.html"><img src="<?php echo Url::client_assets();?>images/sanpham.jpg"></a></span> <span class="text_products"> <a href="details.html">Mỹ Phước 3, nền đất ngay đường nhựa 25m, đối diện cổng chợ, 230 triệu</a> <p>Nền đất ngay cổng chợ, rất tiện kinh doanh, gần trường học, công viên, nhà trẻ! Giá tăng đột biến khi chợ khởi công xây dựng! Tầm nhìn chiến lược...</p> </span> <span class="contact"> <p>Liên hệ</p> <p>Thuý Hằng</p> 01656 036 367 <p>Giá :</p> 10.000.000 VNĐ <p><a href="#">[ Chi tiết ]</a></p> </span> <span class="underline_products"><!----></span> </li> <li> <span class="img_products"><a href="details.html"><img src="<?php echo Url::client_assets();?>images/sanpham.jpg"></a></span> <span class="text_products"> <a href="details.html">Mỹ Phước 3, nền đất ngay đường nhựa 25m, đối diện cổng chợ, 230 triệu</a> <p>Nền đất ngay cổng chợ, rất tiện kinh doanh, gần trường học, công viên, nhà trẻ! Giá tăng đột biến khi chợ khởi công xây dựng! Tầm nhìn chiến lược...</p> </span> <span class="contact"> <p>Liên hệ</p> <p>Thuý Hằng</p> 01656 036 367 <p>Giá :</p> 10.000.000 VNĐ <p><a href="#">[ Chi tiết ]</a></p> </span> <span class="underline_products"><!----></span> </li> <li> <span class="img_products"><a href="#"><img src="<?php echo Url::client_assets();?>images/sanpham.jpg"></a></span> <span class="text_products"> <a href="#">Mỹ Phước 3, nền đất ngay đường nhựa 25m, đối diện cổng chợ, 230 triệu</a> <p>Nền đất ngay cổng chợ, rất tiện kinh doanh, gần trường học, công viên, nhà trẻ! Giá tăng đột biến khi chợ khởi công xây dựng! Tầm nhìn chiến lược...</p> </span> <span class="contact"> <p>Liên hệ</p> <p>Thuý Hằng</p> 01656 036 367 <p>Giá :</p> 10.000.000 VNĐ <p><a href="#">[ Chi tiết ]</a></p> </span> <span class="underline_products"><!----></span> </li> <li> <span class="img_products"><a href="#"><img src="<?php echo Url::client_assets();?>images/sanpham.jpg"></a></span> <span class="text_products"> <a href="#">Mỹ Phước 3, nền đất ngay đường nhựa 25m, đối diện cổng chợ, 230 triệu</a> <p>Nền đất ngay cổng chợ, rất tiện kinh doanh, gần trường học, công viên, nhà trẻ! Giá tăng đột biến khi chợ khởi công xây dựng! Tầm nhìn chiến lược...</p> </span> <span class="contact"> <p>Liên hệ</p> <p>Thuý Hằng</p> 01656 036 367 <p>Giá :</p> 10.000.000 VNĐ <p><a href="#">[ Chi tiết ]</a></p> </span> <span class="underline_products"><!----></span> </li> <li> <span class="img_products"><a href="#"><img src="<?php echo Url::client_assets();?>mages/sanpham.jpg"></a></span> <span class="text_products"> <a href="#">Mỹ Phước 3, nền đất ngay đường nhựa 25m, đối diện cổng chợ, 230 triệu</a> <p>Nền đất ngay cổng chợ, rất tiện kinh doanh, gần trường học, công viên, nhà trẻ! Giá tăng đột biến khi chợ khởi công xây dựng! Tầm nhìn chiến lược...</p> </span> <span class="contact"> <p>Liên hệ</p> <p>Thuý Hằng</p> 01656 036 367 <p>Giá :</p> 10.000.000 VNĐ <p><a href="#">[ Chi tiết ]</a></p> </span> <span class="underline_products"><!----></span> </li> <li> <span class="img_products"><a href="#"><img src="assets/images/sanpham.jpg"></a></span> <span class="text_products"> <a href="#">Mỹ Phước 3, nền đất ngay đường nhựa 25m, đối diện cổng chợ, 230 triệu</a> <p>Nền đất ngay cổng chợ, rất tiện kinh doanh, gần trường học, công viên, nhà trẻ! Giá tăng đột biến khi chợ khởi công xây dựng! Tầm nhìn chiến lược...</p> </span> <span class="contact"> <p>Liên hệ</p> <p>Thuý Hằng</p> 01656 036 367 <p>Giá :</p> 10.000.000 VNĐ <p><a href="#">[ Chi tiết ]</a></p> </span> <span class="underline_products"><!----></span> </li> <li> <span class="img_products"><a href="#"><img src="assets/images/sanpham.jpg"></a></span> <span class="text_products"> <a href="#">Mỹ Phước 3, nền đất ngay đường nhựa 25m, đối diện cổng chợ, 230 triệu</a> <p>Nền đất ngay cổng chợ, rất tiện kinh doanh, gần trường học, công viên, nhà trẻ! Giá tăng đột biến khi chợ khởi công xây dựng! Tầm nhìn chiến lược...</p> </span> <span class="contact"> <p>Liên hệ</p> <p>Thuý Hằng</p> 01656 036 367 <p>Giá :</p> 10.000.000 VNĐ <p><a href="#">[ Chi tiết ]</a></p> </span> <span class="underline_products"><!----></span> </li> <li> <span class="img_products"><a href="#"><img src="assets/images/sanpham.jpg"></a></span> <span class="text_products"> <a href="#">Mỹ Phước 3, nền đất ngay đường nhựa 25m, đối diện cổng chợ, 230 triệu</a> <p>Nền đất ngay cổng chợ, rất tiện kinh doanh, gần trường học, công viên, nhà trẻ! Giá tăng đột biến khi chợ khởi công xây dựng! Tầm nhìn chiến lược...</p> </span> <span class="contact"> <p>Liên hệ</p> <p>Thuý Hằng</p> 01656 036 367 <p>Giá :</p> 10.000.000 VNĐ <p><a href="#">[ Chi tiết ]</a></p> </span> <span class="underline_products"><!----></span> </li> <li> <span class="img_products"><a href="#"><img src="assets/images/sanpham.jpg"></a></span> <span class="text_products"> <a href="#">Mỹ Phước 3, nền đất ngay đường nhựa 25m, đối diện cổng chợ, 230 triệu</a> <p>Nền đất ngay cổng chợ, rất tiện kinh doanh, gần trường học, công viên, nhà trẻ! Giá tăng đột biến khi chợ khởi công xây dựng! Tầm nhìn chiến lược...</p> </span> <span class="contact"> <p>Liên hệ</p> <p>Thuý Hằng</p> 01656 036 367 <p>Giá :</p> 10.000.000 VNĐ <p><a href="#">[ Chi tiết ]</a></p> </span> <span class="underline_products"><!----></span> </li> <li> <span class="img_products"><a href="#"><img src="assets/images/sanpham.jpg"></a></span> <span class="text_products"> <a href="#">Mỹ Phước 3, nền đất ngay đường nhựa 25m, đối diện cổng chợ, 230 triệu</a> <p>Nền đất ngay cổng chợ, rất tiện kinh doanh, gần trường học, công viên, nhà trẻ! Giá tăng đột biến khi chợ khởi công xây dựng! Tầm nhìn chiến lược...</p> </span> <span class="contact"> <p>Liên hệ</p> <p>Thuý Hằng</p> 01656 036 367 <p>Giá :</p> 10.000.000 VNĐ <p><a href="#">[ Chi tiết ]</a></p> </span> <span class="underline_products"><!----></span> </li> </ul> <div id="page"> <ul> <li class="page_home">Trang chủ :</li> <li class="page_1"><a href="#">1</a></li> <li class="page_1"><a href="#">2</a></li> <li class="page_1"><a href="#">3</a></li> <li class="page_1"><a href="#">4</a></li> <li class="page_1"><a href="#">5</a></li> <li class="page_1"><a href="#">6</a></li> </ul> </div> </div> </div>
12-05-2011-wharfland-project
trunk/application/views/client/client.php
PHP
mit
8,030
<div id="footer" class="grid_12"> <div class="footer_left"> <div class="footer_right"> <div class="nav_footer"> <?php echo $navigator; ?> <div class="clear"></div> <div id="address" align="center"> <p>Địa chỉ : Lô K1 Ô 34, đường NE8, Khu TĐC Mỹ Phước 3, xã Thới Hoà, Bến Cát, Bình Dương</p> <p>Điện thoại : (0650) 3 510 558 - (08) 35 111 888 - Fax : (0650) 3 510 559</p> <p>Email : <a href="mailto:info@muadatbinhduong.com">info@wharfland.com</a> - Website : <a href="www.muadatbinhduong.com">www.muadatbinhduong.com</a></p> <p class="headquarters" align="center"> <a href="#">Trụ sở |</a> <a href="#">Chi nhánh</a> </p> </div> </div> </div> </div> <div class="coppyright" align="center">Copyright © WharfLand 2011. All rights reserved</div> </div> <!-- Small script trick html menu --> <!-- Add new separate between to <li> --> <script type="text/javascript"> $(document).ready(function(){ $('div#menu_link a:not(:last)').each(function(){ $(this).after('<span>|</span>'); }); $('div#navigator ul li:has(ul)').hover(function(){ $(this).find('ul').css({ display: 'block' }); },function(){ $(this).find('ul').css({ display: 'none' }); }); }); </script>
12-05-2011-wharfland-project
trunk/application/views/client/footer.php
PHP
mit
1,314
<div id="products"><!--start products--> <div class="box"> <div class="box_left"> <div class="box_right"><span>Danh sách bất động sản đang giao dịch</span></div> </div> </div> <?php echo $list_land->render(); ?> </div> <?php // /application/views/client/home.php ?>
12-05-2011-wharfland-project
trunk/application/views/client/home.php
PHP
mit
286
<!DOCTYPE html> <html> <head> <title><?php echo "404 page not found"; ?></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta> <style> body{ } .text-center{ text-align: center; } </style> </head> <body> <div class="text-center"> The page you requested was not found <a href="<?php echo Url::base(); ?>">Quay lại trang chủ</a> </div> </body> </html>
12-05-2011-wharfland-project
trunk/application/views/404.php
PHP
mit
552
<!DOCTYPE html> <html> <head> <title><?php echo $title; ?></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="keywords" content="<?php echo $keywords; ?>" > <?php foreach ($styles as $style) : ?> <link rel="stylesheet" href="<?php echo $style ?>" type="text/css" media="screen" /> <?php endforeach; ?> <script type="text/javascript"> var base_url = "<?php echo Url::site(); ?>"; </script> <?php foreach ($scripts as $script) : ?> <script type="text/javascript" src="<?php echo $script . '?' . $_SERVER['REQUEST_TIME'] ?>"></script> <?php endforeach ?> </head> <body> <div id="wrapper" class="container_12"> <div id="banner" class="grid_12 omega"> <div class="banner_1"> <div class="banner_2"> <div id="header"> <div id="logo"> <a href="<?php echo Url::base() ?>" title=""><img src="<?php echo Url::client_assets(); ?>images/logo.jpg" width="296" height="130" border="0" alt="" /></a> </div> <div class="top_banner"> <?php echo Request::factory('ads/get_banner/top')->execute() ?> </div> </div> </div> </div> </div> <!--start main--> <div id="main" class="grid_12"> <!-- Navigator content --> <?php if ($navigator) { echo $navigator->render(); } ?> <!-- End Navigator --> <!-- Mainleft content --> <div id="main_left" class="grid_3 alpha omega"> <div class="box top"> <div class="box_left"> <div class="box_right"><span>Hỗ trợ trực tuyến</span></div> </div> </div> <div class="box_1"> <ul> <li class="im yahoo"><a href="ymsgr:sendim?<?php echo Lib_Setting::get('yahoo') ?>"></a></li> <li class="im skype"><a href="skype:<?php echo Lib_Setting::get('skype') ?>?chat"></a></li> <li class="img mail"><a href="mailto:<?php echo Lib_Setting::get('email') ?>"></a></li> </ul> </div> <div class="clear"></div> <?php echo Request::factory('article/get_latest')->execute() ?> <?php if ($main_left && is_array($main_left)): ?> <?php foreach ($main_left as $box): ?> <?php echo $box->render(); ?> <?php endforeach; ?> <?php endif; ?> <div class="clear"></div> <div class="box"> <div class="box_left"> <div class="box_right"><span>Quảng Cáo</span></div> </div> </div> <div class="box_1"> <?php echo Request::factory('ads/get_banner/left')->execute() ?> </div> <div class="clear"></div> <div class="box"> <div class="box_left"> <div class="box_right"><span>GIÁ VÀNG( VND/CHI)</span></div> </div> </div> <div class="box_1"> <?php echo Request::factory('ads/get_exchange_service')->execute() ?> </div> <div class="clear"></div> </div> <!-- End mainleft content --> <!-- Begin Slider --> <div id="slider" class="grid_9 omega nivoSlider"> <img src="<?php echo Url::client_assets(); ?>images/slider/1.jpg" title="WharfLand - Mang đất Bình Dương đi khoe!" /> <img src="<?php echo Url::client_assets(); ?>images/slider/2.jpg" title="Có Đầu Tư - Có Cơ Hội" /> <img src="<?php echo Url::client_assets(); ?>images/slider/3.jpg" title="WharfLand - Mang đất Bình Dương đi khoe!" /> <img src="<?php echo Url::client_assets(); ?>images/slider/4.jpg" title="Có Đầu Tư - Có Cơ Hội" /> <img src="<?php echo Url::client_assets(); ?>images/slider/5.jpg" title="WharfLand - Mang đất Bình Dương đi khoe!" /> <img src="<?php echo Url::client_assets(); ?>images/slider/5.jpg" title="Có Đầu Tư - Có Cơ Hội" /> </div> <!-- End Slider --> <div id="main_center" class="<?php if (is_null($main_right)) { echo 'full_content'; } ?> grid_6"> <?php if ($contents && is_array($contents)): ?> <?php foreach ($contents as $content): ?> <?php echo $content->render(); ?> <?php endforeach; ?> <?php endif; ?> </div> <?php if (!is_null($main_right)): ?> <div id="main_right" class="grid_3 alpha omega"> <div class="box" style="margin-top:0"><!--start advertisement--> <div class="box_left"> <div class="box_right"><span>Quảng cáo</span></div> </div> </div> <div class="box_1"> <div id="img_advertisement"> <?php echo Request::factory('ads/get_banner/right')->execute() ?> </div> </div> <div class="clear"></div> <?php if (!is_null($main_right) && is_array($main_right)): ?> <?php foreach ($main_right as $box): ?> <?php echo $box->render(); ?> <?php endforeach; ?> <?php endif; ?> </div> <?php endif; ?> <div class="clear"></div> </div><!--end main--> <?php echo Request::factory('ads/get_partner')->execute() ?> <?php echo $footer; ?> </div> <script> $(function(){ $('#slider').nivoSlider(); }); </script> </body> </html>
12-05-2011-wharfland-project
trunk/application/views/client.php
PHP
mit
7,398
<!-- Page Head --> <h2>Welcome John</h2> <p id="page-intro">What would you like to do?</p> <ul class="shortcut-buttons-set"> <li><a class="shortcut-button" href="#"><span> <img src="<?php echo $assets_image . '/icons/pencil_48.png'; ?>" alt="icon" /><br /> Write an Article </span></a></li> <li><a class="shortcut-button" href="#"><span> <img src="<?php echo $assets_image . '/icons/paper_content_pencil_48.png'; ?>" alt="icon" /><br /> Create a New Page </span></a></li> <li><a class="shortcut-button" href="#"><span> <img src="<?php echo $assets_image . '/icons/image_add_48.png'; ?>" alt="icon" /><br /> Upload an Image </span></a></li> <li><a class="shortcut-button" href="#"><span> <img src="<?php echo $assets_image . '/icons/clock_48.png'; ?>" alt="icon" /><br /> Add an Event </span></a></li> <li><a class="shortcut-button" href="#messages" rel="modal"><span> <img src="<?php echo $assets_image . '/icons/comment_48.png'; ?>" alt="icon" /><br /> Open Modal </span></a></li> </ul><!-- End .shortcut-buttons-set --> <div class="clear"></div> <!-- End .clear --> <div class="content-box"><!-- Start Content Box --> <div class="content-box-header"> <h3>Content box</h3> <ul class="content-box-tabs"> <li><a href="#tab1" class="default-tab">Table</a></li> <!-- href must be unique and match the id of target div --> <li><a href="#tab2">Forms</a></li> </ul> <div class="clear"></div> </div> <!-- End .content-box-header --> <div class="content-box-content"> <div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab --> <div class="notification attention png_bg"> <a href="#" class="close"><img src="<?php echo $assets_image . '/icons/cross_grey_small.png'; ?>" title="Close this notification" alt="close" /></a> <div> This is a Content Box. You can put whatever you want in it. By the way, you can close this notification with the top-right cross. </div> </div> <table> <thead> <tr> <th><input class="check-all" type="checkbox" /></th> <th>Column 1</th> <th>Column 2</th> <th>Column 3</th> <th>Column 4</th> <th>Column 5</th> </tr> </thead> <tfoot> <tr> <td colspan="6"> <div class="bulk-actions align-left"> <select name="dropdown"> <option value="option1">Choose an action...</option> <option value="option2">Edit</option> <option value="option3">Delete</option> </select> <a class="button" href="#">Apply to selected</a> </div> <div class="pagination"> <a href="#" title="First Page">&laquo; First</a><a href="#" title="Previous Page">&laquo; Previous</a> <a href="#" class="number" title="1">1</a> <a href="#" class="number" title="2">2</a> <a href="#" class="number current" title="3">3</a> <a href="#" class="number" title="4">4</a> <a href="#" title="Next Page">Next &raquo;</a><a href="#" title="Last Page">Last &raquo;</a> </div> <!-- End .pagination --> <div class="clear"></div> </td> </tr> </tfoot> <tbody> <tr> <td><input type="checkbox" /></td> <td>Lorem ipsum dolor</td> <td><a href="#" title="title">Sit amet</a></td> <td>Consectetur adipiscing</td> <td>Donec tortor diam</td> <td> <!-- Icons --> <a href="#" title="Edit"><img src="<?php echo $assets_image . '/icons/pencil.png'; ?>" alt="Edit" /></a> <a href="#" title="Delete"><img src="<?php echo $assets_image . '/icons/cross.png'; ?>" alt="Delete" /></a> <a href="#" title="Edit Meta"><img src="<?php echo $assets_image . '/icons/hammer_screwdriver.png'; ?>" alt="Edit Meta" /></a> </td> </tr> <tr> <td><input type="checkbox" /></td> <td>Lorem ipsum dolor</td> <td><a href="#" title="title">Sit amet</a></td> <td>Consectetur adipiscing</td> <td>Donec tortor diam</td> <td> <!-- Icons --> <a href="#" title="Edit"><img src="<?php echo $assets_image . '/icons/pencil.png'; ?>" alt="Edit" /></a> <a href="#" title="Delete"><img src="<?php echo $assets_image . '/icons/cross.png'; ?>" alt="Delete" /></a> <a href="#" title="Edit Meta"><img src="<?php echo $assets_image . '/icons/hammer_screwdriver.png'; ?>" alt="Edit Meta" /></a> </td> </tr> <tr> <td><input type="checkbox" /></td> <td>Lorem ipsum dolor</td> <td><a href="#" title="title">Sit amet</a></td> <td>Consectetur adipiscing</td> <td>Donec tortor diam</td> <td> <!-- Icons --> <a href="#" title="Edit"><img src="<?php echo $assets_image . '/icons/pencil.png'; ?>" alt="Edit" /></a> <a href="#" title="Delete"><img src="<?php echo $assets_image . '/icons/cross.png'; ?>" alt="Delete" /></a> <a href="#" title="Edit Meta"><img src="<?php echo $assets_image . '/icons/hammer_screwdriver.png'; ?>" alt="Edit Meta" /></a> </td> </tr> <tr> <td><input type="checkbox" /></td> <td>Lorem ipsum dolor</td> <td><a href="#" title="title">Sit amet</a></td> <td>Consectetur adipiscing</td> <td>Donec tortor diam</td> <td> <!-- Icons --> <a href="#" title="Edit"><img src="<?php echo $assets_image . '/icons/pencil.png'; ?>" alt="Edit" /></a> <a href="#" title="Delete"><img src="<?php echo $assets_image . '/icons/cross.png'; ?>" alt="Delete" /></a> <a href="#" title="Edit Meta"><img src="<?php echo $assets_image . '/icons/hammer_screwdriver.png'; ?>" alt="Edit Meta" /></a> </td> </tr> <tr> <td><input type="checkbox" /></td> <td>Lorem ipsum dolor</td> <td><a href="#" title="title">Sit amet</a></td> <td>Consectetur adipiscing</td> <td>Donec tortor diam</td> <td> <!-- Icons --> <a href="#" title="Edit"><img src="<?php echo $assets_image . '/icons/pencil.png'; ?>" alt="Edit" /></a> <a href="#" title="Delete"><img src="<?php echo $assets_image . '/icons/cross.png'; ?>" alt="Delete" /></a> <a href="#" title="Edit Meta"><img src="<?php echo $assets_image . '/icons/hammer_screwdriver.png'; ?>" alt="Edit Meta" /></a> </td> </tr> <tr> <td><input type="checkbox" /></td> <td>Lorem ipsum dolor</td> <td><a href="#" title="title">Sit amet</a></td> <td>Consectetur adipiscing</td> <td>Donec tortor diam</td> <td> <!-- Icons --> <a href="#" title="Edit"><img src="<?php echo $assets_image . '/icons/pencil.png'; ?>" alt="Edit" /></a> <a href="#" title="Delete"><img src="<?php echo $assets_image . '/icons/cross.png'; ?>" alt="Delete" /></a> <a href="#" title="Edit Meta"><img src="<?php echo $assets_image . '/icons/hammer_screwdriver.png'; ?>" alt="Edit Meta" /></a> </td> </tr> <tr> <td><input type="checkbox" /></td> <td>Lorem ipsum dolor</td> <td><a href="#" title="title">Sit amet</a></td> <td>Consectetur adipiscing</td> <td>Donec tortor diam</td> <td> <!-- Icons --> <a href="#" title="Edit"><img src="<?php echo $assets_image . '/icons/pencil.png'; ?>" alt="Edit" /></a> <a href="#" title="Delete"><img src="<?php echo $assets_image . '/icons/cross.png'; ?>" alt="Delete" /></a> <a href="#" title="Edit Meta"><img src="<?php echo $assets_image . '/icons/hammer_screwdriver.png'; ?>" alt="Edit Meta" /></a> </td> </tr> <tr> <td><input type="checkbox" /></td> <td>Lorem ipsum dolor</td> <td><a href="#" title="title">Sit amet</a></td> <td>Consectetur adipiscing</td> <td>Donec tortor diam</td> <td> <!-- Icons --> <a href="#" title="Edit"><img src="<?php echo $assets_image . '/icons/pencil.png'; ?>" alt="Edit" /></a> <a href="#" title="Delete"><img src="<?php echo $assets_image . '/icons/cross.png'; ?>" alt="Delete" /></a> <a href="#" title="Edit Meta"><img src="<?php echo $assets_image . '/icons/hammer_screwdriver.png'; ?>" alt="Edit Meta" /></a> </td> </tr> </tbody> </table> </div> <!-- End #tab1 --> <div class="tab-content" id="tab2"> <form action="" method="post"> <fieldset> <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns --> <p> <label>Small form input</label> <input class="text-input small-input" type="text" id="small-input" name="small-input" /> <span class="input-notification success png_bg">Successful message</span> <!-- Classes for input-notification: success, error, information, attention --> <br /><small>A small description of the field</small> </p> <p> <label>Medium form input</label> <input class="text-input medium-input datepicker" type="text" id="medium-input" name="medium-input" /> <span class="input-notification error png_bg">Error message</span> </p> <p> <label>Large form input</label> <input class="text-input large-input" type="text" id="large-input" name="large-input" /> </p> <p> <label>Checkboxes</label> <input type="checkbox" name="checkbox1" /> This is a checkbox <input type="checkbox" name="checkbox2" /> And this is another checkbox </p> <p> <label>Radio buttons</label> <input type="radio" name="radio1" /> This is a radio button<br /> <input type="radio" name="radio2" /> This is another radio button </p> <p> <label>This is a drop down list</label> <select name="dropdown" class="small-input"> <option value="option1">Option 1</option> <option value="option2">Option 2</option> <option value="option3">Option 3</option> <option value="option4">Option 4</option> </select> </p> <p> <label>Textarea with WYSIWYG</label> <textarea class="text-input textarea wysiwyg" id="textarea" name="textfield" cols="79" rows="15"></textarea> </p> <p> <input class="button" type="submit" value="Submit" /> </p> </fieldset> <div class="clear"></div><!-- End .clear --> </form> </div> <!-- End #tab2 --> </div> <!-- End .content-box-content --> </div> <!-- End .content-box --> <div class="content-box column-left"> <div class="content-box-header"> <h3>Content box left</h3> </div> <!-- End .content-box-header --> <div class="content-box-content"> <div class="tab-content default-tab"> <h4>Maecenas dignissim</h4> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed in porta lectus. Maecenas dignissim enim quis ipsum mattis aliquet. Maecenas id velit et elit gravida bibendum. Duis nec rutrum lorem. Donec egestas metus a risus euismod ultricies. Maecenas lacinia orci at neque commodo commodo. </p> </div> <!-- End #tab3 --> </div> <!-- End .content-box-content --> </div> <!-- End .content-box --> <div class="content-box column-right closed-box"> <div class="content-box-header"> <!-- Add the class "closed" to the Content box header to have it closed by default --> <h3>Content box right</h3> </div> <!-- End .content-box-header --> <div class="content-box-content"> <div class="tab-content default-tab"> <h4>This box is closed by default</h4> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed in porta lectus. Maecenas dignissim enim quis ipsum mattis aliquet. Maecenas id velit et elit gravida bibendum. Duis nec rutrum lorem. Donec egestas metus a risus euismod ultricies. Maecenas lacinia orci at neque commodo commodo. </p> </div> <!-- End #tab3 --> </div> <!-- End .content-box-content --> </div> <!-- End .content-box --> <div class="clear"></div> <!-- Start Notifications --> <div class="notification attention png_bg"> <a href="#" class="close"><img src="<?php echo $assets_image . '/icons/cross_grey_small.png'; ?>" title="Close this notification" alt="close" /></a> <div> Attention notification. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin vulputate, sapien quis fermentum luctus, libero. </div> </div> <div class="notification information png_bg"> <a href="#" class="close"><img src="<?php echo $assets_image . '/icons/cross_grey_small.png'; ?>" title="Close this notification" alt="close" /></a> <div> Information notification. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin vulputate, sapien quis fermentum luctus, libero. </div> </div> <div class="notification success png_bg"> <a href="#" class="close"><img src="<?php echo $assets_image . '/icons/cross_grey_small.png'; ?>" title="Close this notification" alt="close" /></a> <div> Success notification. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin vulputate, sapien quis fermentum luctus, libero. </div> </div> <div class="notification error png_bg"> <a href="#" class="close"><img src="<?php echo $assets_image . '/icons/cross_grey_small.png'; ?>" title="Close this notification" alt="close" /></a> <div> Error notification. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin vulputate, sapien quis fermentum luctus, libero. </div> </div> <!-- End Notifications -->
12-05-2011-wharfland-project
trunk/application/views/admin/genaral/main.php
PHP
mit
15,111
<ul id="main-nav"> <!-- Accordion Menu --> <li id="dashboard_nav"> <a href="<?php echo Url::site('admin') ?>" class="nav-top-item no-submenu"> <!-- Add the class "no-submenu" to menu items with no sub menu --> Trang Quản Lý </a> </li> <li id="article_nav"> <a href="<?php echo Url::site('admin/article/manage') ?>" class="nav-top-item">Tin Tức</a> <ul> <li><a href="<?php echo Url::site('admin/article/create') ?>">Đăng Tin</a></li> <li><a href="<?php echo Url::site('admin/article/manage') ?>">Quản Lý Bài Viết</a></li> <!-- Add class "current" to sub menu items also --> <li><a href="<?php echo Url::site('admin/category') ?>">Quản Lý Danh mục</a></li> </ul> </li> <li id="project_nav"> <a href="<?php echo Url::site('admin/land/manage') ?>" class="nav-top-item">Dự Án</a> <ul> <li><a href="<?php echo Url::site('admin/land/manage') ?>">Quản lý dự án</a></li> <li><a href="<?php echo Url::site('admin/land/pending') ?>">Dự án chờ duyệt</a></li> </ul> </li> <li id="ads_nav"> <a href="<?php echo Url::site('admin/ads/manage') ?>" class="nav-top-item">Đối Tác - Quảng Cáo</a> <ul> <li><a href="<?php echo Url::site('admin/ads/create') ?>">Thêm Mới</a></li> <li><a href="<?php echo Url::site('admin/ads/manage') ?>">Quản Lý</a></li> <li><a href="<?php echo Url::site('admin/ads/order') ?>">Thay Đổi Thứ Tự</a></li> </ul> </li> <li id="user_nav"> <a href="<?php echo Url::site('admin/user') ?>" class="nav-top-item">Thành Viên</a> <ul> <li><a href="<?php echo Url::site('admin/user/index'); ?>">Quản lý</a></li> <li><a href="<?php echo Url::site('admin/role/index'); ?>">Phân quyền</a></li> </ul> </li> <li id="setting_nav"> <a href="<?php echo Url::site('admin/setting') ?>" class="nav-top-item no-submenu">Thiết Lập Hệ Thống</a> </li> </ul> <!-- End #main-nav --> </div></div> <!-- End #sidebar -->
12-05-2011-wharfland-project
trunk/application/views/admin/genaral/sidebar.php
PHP
mit
2,227
wqdwqd
12-05-2011-wharfland-project
trunk/application/views/admin/dashboard/setting.php
Hack
mit
6
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title><?php echo $title ?></title> <?php foreach ($styles as $style) : ?> <link rel="stylesheet" href="<?php echo $style ?>" type="text/css" media="screen" /> <?php endforeach; ?> <!-- Internet Explorer Fixes Stylesheet --> <!--[if lte IE 7]> <link rel="stylesheet" href="<?php echo $assets_css . '/ie.css' ?>" type="text/css" media="screen" /> <![endif]--> <script type="text/javascript"> var base_url = "<?php echo Url::site(); ?>"; </script> <?php foreach ($scripts as $script) : ?> <script type="text/javascript" src="<?php echo $script ?>"></script> <?php endforeach ?> <!--[if IE]><script type="text/javascript" src="<?php echo $assets_js . '/jquery.bgiframe.js'; ?>"></script><![endif]--> <!-- Internet Explorer .png-fix --> <!--[if IE 6]> <script type="text/javascript" src="<?php echo $assets_js . '/DD_belatedPNG_0.0.7a.js'; ?>"></script> <script type="text/javascript"> DD_belatedPNG.fix('.png_bg, img, li'); </script> <![endif]--> </head> <body> <div id="body-wrapper"> <!-- Wrapper for the radial gradient background --> <div id="sidebar"><div id="sidebar-wrapper"> <!-- Sidebar with logo and menu --> <h1 id="sidebar-title"><a href="#">Simpla Admin</a></h1> <!-- Logo (221px wide) --> <a href="#"><img id="logo" src="<?php echo $assets_image . '/logo.png'; ?>" alt="Simpla Admin logo" /></a> <!-- Sidebar Profile links --> <div id="profile-links"> Xin chào, <a href="#" title="Edit your profile"> <?php echo $user['username']; ?></a> <br /> <a href="<?php echo Url::site('client/index'); ?>" title="View the Site">Quay trở về</a> | <a href="<?php echo Url::site('user/logout') ?>" title="Sign Out">Đăng xuất</a> </div> <?php echo $sidebar ?> <div id="main-content"> <!-- Main Content Section with everything --> <noscript> <!-- Show a notification if the user has disabled javascript --> <div class="notification error png_bg"> <div> Javascript is disabled or is not supported by your browser. Please <a href="http://browsehappy.com/" title="Upgrade to a better browser">upgrade</a> your browser or <a href="http://www.google.com/support/bin/answer.py?answer=23852" title="Enable Javascript in your browser">enable</a> Javascript to navigate the interface properly. </div> </div> </noscript> <?php echo $main ?> <div id="footer"> <small> <!-- Remove this notice or replace it with whatever you want --> &#169; Copyright 2011 WharfLand | Powered by <a href="http://clgt.vn">Clgt.vn</a> | <a href="#">Top</a> </small> </div><!-- End #footer --> </div> <!-- End #main-content --> </div></body> </html>
12-05-2011-wharfland-project
trunk/application/views/admin.php
PHP
mit
3,930
<?php defined('SYSPATH') or die('No direct script access.'); return array( 'alpha' => ':field must contain only letters', 'alpha_dash' => ':field must contain only numbers, letters and dashes', 'alpha_numeric' => ':field must contain only letters and numbers', 'color' => ':field must be a color', 'credit_card' => ':field must be a credit card number', 'date' => ':field must be a date', 'decimal' => ':field must be a decimal with :param2 places', 'digit' => ':field must be a digit', 'email' => ':field must be a email address', 'email_domain' => ':field must contain a valid email domain', 'equals' => ':field must equal :param2', 'exact_length' => ':field must be exactly :param2 characters long', 'in_array' => ':field must be one of the available options', 'ip' => ':field must be an ip address', 'matches' => ':field must be the same as :param2', 'min_length' => ':field must be at least :param2 characters long', 'max_length' => ':field must be less than :param2 characters long', 'not_empty' => ':field must not be empty', 'notblank' => ':field must not be empty', 'numeric' => ':field must be numeric', 'phone' => ':field must be a phone number', 'range' => ':field must be within the range of :param2 to :param3', 'regex' => ':field does not match the required format', 'url' => ':field must be a url', 'unique' => ':field must be unique', 'Upload::type' => ':field extension must be :param2', );
12-05-2011-wharfland-project
trunk/application/messages/validation.php
PHP
mit
1,606
<?php return array( 'unique' => ':field must be unique', ); ?>
12-05-2011-wharfland-project
trunk/application/messages/message.php
PHP
mit
67
<?php defined('SYSPATH') or die('No direct script access.'); class View extends Kohana_View { public static function admin($file = null,array $data = null) { return new View('admin/'.$file, $data); } public static function client($file = null,array $data = null) { return new View('client/'.$file, $data); } }
12-05-2011-wharfland-project
trunk/application/classes/view.php
PHP
mit
321
<?php class Error { public static function error_404() { $error_page = Route::get('error')->uri(array('action' => '404')); $new_request = Request::factory($error_page); $new_request = $new_request->execute(); $new_request->status(404); if ( $new_request->send_headers()->body()) { die( $new_request->body() ); } } }
12-05-2011-wharfland-project
trunk/application/classes/error.php
PHP
mit
406
<?php class Controller_Client_Layout extends Controller_Template { public $template = 'client'; public $layout = 'client'; public function action_index(){} public function before(){ parent::before(); if (Request::current() === Request::initial()) { $this->template->title = Lib_Setting::get('site_name'); $this->template->keywords = Lib_Setting::get('keywords'); $this->template->main_left = array( //Request::factory('article/get_latest')->execute() ); $this->template->contents = array( //View::client('client') ); $this->template->main_right = array( View::client('land/box_search') ); $this->template->partners = null; $this->set_navigator(); $this->template->footer = View::client('footer')->set(array( 'navigator' => Libs_Menu::getInstance()->renderFooterHtmlMenu(Libs_Menu::getInstance()->getMenuAsTree()) )); $this->template->styles = array( Url::client_assets().'css/style.css', Url::client_assets().'css/jsCarousel.css', Url::client_assets().'css/nivo-slider.css', ); $this->template->scripts = array( Url::client_assets().'js/jquery-1.6.min.js', Url::client_assets().'js/jsCarousel.js', Url::client_assets().'js/jquery.nivo.slider.pack.js', ); } } public function after(){ parent::after(); } public function set_navigator($navigator = null) { if(!is_null($navigator)) $this->template->navigator = $navigator; else $this->template->navigator = View::client('navigator')->set(array( 'navigator' => Libs_Menu::getInstance()->renderTopHtmlMenu(Libs_Menu::getInstance()->getMenuAsTree()) )); } public function set_partners($partners = null) { if(!is_null($partners)){ $this->template->partners = $partners; } } public function set_contents($views = null) { if(is_null($views)){ return false; } if(!is_array($views)){ $views = array($views); } $this->template->contents = array_merge($this->template->contents,$views); } public function add_main_left($views = null) { if(!is_array($views)){ $views = array($views); } $this->template->main_left = array_merge($this->template->main_left,$views); } public function add_main_right($views = null) { if(!is_array($views)){ $views = array($views); } $this->template->main_right = array_merge($this->template->main_right,$views); } public function set_main_right($view = null) { $this->template->main_right = $view; } public function add_scripts($scripts) { if(!is_array($scripts)) $scripts = array($scripts); $this->template->scripts = Arr::merge($this->template->scripts,$scripts); } public function add_styles($styles) { if(!is_array($styles)) $styles = array($styles); $this->template->styles = Arr::merge($this->template->styles,$styles); } /** * gọi function này để load style và script nếu dùng uniform */ public function uniform() { $this->add_styles(array( Url::client_assets().'css/uni-form.css', Url::client_assets().'css/default.uni-form.css', )); $this->add_scripts(array( Url::client_assets().'js/uni-form.jquery.js', )); } }
12-05-2011-wharfland-project
trunk/application/classes/controller/client/layout.php
PHP
mit
3,348
<?php class Controller_Client_Home extends Controller_Client_Layout { public function action_index() { /* * hide main_right column */ //$this->set_main_right(); $this->set_contents(View::client('home')->set(array( 'list_land' => Libs_Land::getInstance()->get_list('client/land/list') ))); } }
12-05-2011-wharfland-project
trunk/application/classes/controller/client/home.php
PHP
mit
336
<?php class Controller_Error extends Controller { public function action_404() { // Set the Request's Status to 404 (Page Not Found) $this->response->status(404); $this->response->body(View::factory('404')); } }
12-05-2011-wharfland-project
trunk/application/classes/controller/error.php
PHP
mit
237
<?php defined('SYSPATH') or die('No direct script access.'); class Controller_Client extends Controller_Client_Home { }
12-05-2011-wharfland-project
trunk/application/classes/controller/client.php
PHP
mit
122
<?php class Controller_Admin_Dashboard extends Controller_Admin_Layout { public function action_index() { } public function action_setting() { } }
12-05-2011-wharfland-project
trunk/application/classes/controller/admin/dashboard.php
PHP
mit
172
<?php class Controller_Admin_Layout extends Controller_Template { public $template = "admin"; protected $layout = 'admin'; protected $assets_css = 'assets/admin/css'; protected $assets_js = 'assets/admin/js'; protected $assets_image = 'assets/admin/images'; public function before() { parent::before(); if ( ! Api::load('user')->is_logged('admin')) { Request::current()->redirect('admin/login'); } else { $this->template->user = Api::load('user')->get_user_info(); } $global_vars = array( 'assets_css' => URL::site($this->assets_css, TRUE), 'assets_js' => URL::site($this->assets_js, TRUE), 'assets_image' => URL::site($this->assets_image, TRUE), ); foreach($global_vars as $key => $value) { View::bind_global($key, $value); } $this->template->title = 'Backend'; $this->template->sidebar = View::factory('admin/genaral/sidebar'); $this->template->main = ''; //View::factory('admin/genaral/main'); $this->template->scripts = array(); $this->template->styles = array(); } //action method here public function after() { $styles = array( URL::site($this->assets_css.'/reset.css'), URL::site($this->assets_css.'/style.css'), URL::site($this->assets_css.'/invalid.css'), URL::site($this->assets_css.'/colorbox.css'), ); $scripts = array( URL::site($this->assets_js.'/jquery-1.6.min.js?' . time()), URL::site($this->assets_js.'/jquery.colorbox-min.js?' . time()), //URL::site($this->assets_js.'/wysiwyg.js'), //URL::site($this->assets_js.'/jquery.datePicker.js'), URL::site($this->assets_js.'/jquery.date.js?' . time()), URL::site($this->assets_js.'/sidebar.js?' . time()), URL::site($this->assets_js.'/simpla.jquery.configuration.js?' . time()), ); $this->template->scripts = Arr::merge($scripts, $this->template->scripts); $this->template->styles = Arr::merge($styles, $this->template->styles); parent::after(); } public function set_content($view) { $this->template->main = $view; } public function add_scripts($scripts) { if(!is_array($scripts)) $scripts = array($scripts); $this->template->scripts = Arr::merge($this->template->scripts,$scripts); } public function add_styles($styles) { if(!is_array($styles)) $styles = array($styles); $this->template->styles = Arr::merge($this->template->styles,$styles); } }
12-05-2011-wharfland-project
trunk/application/classes/controller/admin/layout.php
PHP
mit
2,818
<?php class Controller_Admin_Home extends Controller_Admin_Layout { public function action_index() { //View::factory($this->admin_layout . '/home/index'); } }
12-05-2011-wharfland-project
trunk/application/classes/controller/admin/home.php
PHP
mit
182
<?php class Controller_Admin extends Controller_Admin_Home { }
12-05-2011-wharfland-project
trunk/application/classes/controller/admin.php
PHP
mit
67
<?php class Url extends Kohana_URL { /** * Urlize title to sluggable with unicode characters support * @param type $title */ public static function slug($title) { return URL::title($title,'-',true); } public static function admin_assets() { return Url::site('assets/admin/').'/'; } public static function client_assets() { return Url::site('assets/client/').'/'; } public static function vendors() { return Url::site('vendors/').'/'; } }
12-05-2011-wharfland-project
trunk/application/classes/url.php
PHP
mit
543
<?php class Api { public function __construct() { // do nothing } private static $instance = null; private $apis = array(); public static function load($api_name) { if(is_null(self::$instance)) self::$instance = new self; if(isset(self::$instance->apis[$api_name])){ return self::$instance->apis[$api_name]; }else{ $api_class_name = 'Api_'.ucfirst($api_name); if(class_exists($api_class_name)){ self::$instance->apis[$api_name] = new $api_class_name(); return self::$instance->apis[$api_name]; }else{ return null; } } } public static function getInstance() { if(is_null(self::$instance)){ self::$instance = new self; } return self::$instance; } public function get_apis() { return $this->apis; } public function releaseApis() { unset ($this->apis); } }
12-05-2011-wharfland-project
trunk/application/classes/api.php
PHP
mit
1,080
<?php defined('SYSPATH') or die('No direct script access.'); // -- Environment setup -------------------------------------------------------- // Load the core Kohana class require SYSPATH.'classes/kohana/core'.EXT; if (is_file(APPPATH.'classes/kohana'.EXT)) { // Application extends the core require APPPATH.'classes/kohana'.EXT; } else { // Load empty core extension require SYSPATH.'classes/kohana'.EXT; } /** * Set the default time zone. * * @see http://kohanaframework.org/guide/using.configuration * @see http://php.net/timezones */ date_default_timezone_set('Asia/Ho_Chi_Minh'); /** * Set the default locale. * * @see http://kohanaframework.org/guide/using.configuration * @see http://php.net/setlocale */ setlocale(LC_ALL, 'en_US.utf-8'); /** * Enable the Kohana auto-loader. * * @see http://kohanaframework.org/guide/using.autoloading * @see http://php.net/spl_autoload_register */ spl_autoload_register(array('Kohana', 'auto_load')); /** * Enable the Kohana auto-loader for unserialization. * * @see http://php.net/spl_autoload_call * @see http://php.net/manual/var.configuration.php#unserialize-callback-func */ ini_set('unserialize_callback_func', 'spl_autoload_call'); // -- Configuration and initialization ----------------------------------------- /** * Set the default language */ I18n::lang('vi'); /** * Set Kohana::$environment if a 'KOHANA_ENV' environment variable has been supplied. * * Note: If you supply an invalid environment name, a PHP warning will be thrown * saying "Couldn't find constant Kohana::<INVALID_ENV_NAME>" */ /** * Change Enviroment */ Kohana::$environment = Kohana::DEVELOPMENT; if (isset($_SERVER['KOHANA_ENV'])) { Kohana::$environment = constant('Kohana::'.strtoupper($_SERVER['KOHANA_ENV'])); } /** * Initialize Kohana, setting the default options. * * The following options are available: * * - string base_url path, and optionally domain, of your application NULL * - string index_file name of your index file, usually "index.php" index.php * - string charset internal character set used for input and output utf-8 * - string cache_dir set the internal cache directory APPPATH/cache * - boolean errors enable or disable error handling TRUE * - boolean profile enable or disable internal profiling TRUE * - boolean caching enable or disable internal caching FALSE */ Kohana::init(array( 'base_url' => 'http://localhost/wl/', 'index_file' => '', 'errors' => TRUE, 'profile' => FALSE, 'caching' => FALSE, )); /** * Attach the file write to logging. Multiple writers are supported. */ Kohana::$log->attach(new Log_File(APPPATH.'logs')); /** * Attach a file reader to config. Multiple readers are supported. */ Kohana::$config->attach(new Config_File); /** * Enable modules. Modules are referenced by a relative or absolute path. */ Kohana::modules(array( 'doctrine' => MODPATH.'doctrine', 'category' => MODPATH.'category', 'article' => MODPATH.'article', 'land' => MODPATH.'land', 'clgt' => MODPATH.'clgt', 'setting' => MODPATH.'setting', 'user' => MODPATH.'user', 'ads' => MODPATH.'ads', 'purifier' => MODPATH.'purifier', 'mailer' => MODPATH.'mailer', 'photo' => MODPATH.'photo', // 'image' => MODPATH.'image', // Image manipulation // 'orm' => MODPATH.'orm', // Object Relationship Mapping 'unittest' => MODPATH.'unittest', // Unit testing // 'userguide' => MODPATH.'userguide', // User guide and API documentation )); /** * Set the routes. Each route must have a minimum of a name, a URI and a set of * defaults for the URI. */ Route::set('paper','bao-chi(/<id>-<slug>)(/p/<page>)',array( 'id' => '[0-9]+', 'slug' => '[a-zA-Z0-9-]+' ))->defaults(array( 'controller' => 'page', 'action' => 'paper', 'id' => null, 'slug' => null, 'page' => 1 )); Route::set('internal','noi-bo(/<id>-<slug>)(/p/<page>)',array( 'id' => '[0-9]+', 'slug' => '[a-zA-Z0-9-]+' ))->defaults(array( 'controller' => 'page', 'action' => 'internal', 'id' => null, 'slug' => null, 'page' => 1 )); Route::set('shareholder','co-dong(/<id>-<slug>)(/p/<page>)',array( 'id' => '[0-9]+', 'slug' => '[a-zA-Z0-9-]+' ))->defaults(array( 'controller' => 'page', 'action' => 'shareholder', 'id' => null, 'slug' => null, 'page' => 1 )); Route::set('funny','giai-tri(/<id>-<slug>)(/p/<page>)',array( 'id' => '[0-9]+', 'slug' => '[a-zA-Z0-9-]+' ))->defaults(array( 'controller' => 'page', 'action' => 'funny', 'id' => null, 'slug' => null, 'page' => 1 )); Route::set('recruitment','tuyen-dung')->defaults(array( 'controller' => 'page', 'action' => 'recruitment' )); Route::set('feng_shui','phong-thuy(/<id>-<slug>)(/p/<page>)',array( 'id' => '[0-9]+', 'slug' => '[a-zA-Z0-9-]+' ))->defaults(array( 'controller' => 'page', 'action' => 'feng_shui', 'id' => null, 'slug' => null, 'page' => 1 )); Route::set('project','du-an(/<id>-<slug>)(/p/<page>)',array( 'id' => '[0-9]+', 'slug' => '[a-zA-Z0-9-]+' ))->defaults(array( 'controller' => 'page', 'action' => 'project', 'id' => null, 'slug' => null, 'page' => 1 )); /** * id and slug of category */ Route::set('news-category','tin-tuc/danh-muc(/<id>-<slug>)(/p/<page>)(/o/<order>)',array( 'id' => '[0-9]+', 'slug' => '[a-zA-Z0-9-]+', 'order' => '(desc|asc)' ))->defaults(array( 'controller' => 'page', 'action' => 'category', 'id' => null, 'slug' => null, 'page' => 1 )); /** * id and slug of article */ Route::set('news','tin-tuc(/<id>-<slug>)(/p/<page>)',array( 'id' => '[0-9]+', 'slug' => '[a-zA-Z0-9-]+' ))->defaults(array( 'controller' => 'page', 'action' => 'news', 'id' => null, 'slug' => null, 'page' => 1 )); Route::set('about','gioi-thieu')->defaults(array( 'controller' => 'page', 'action' => 'about' )); Route::set('error', 'error(/<action>(/<id>))', array('id' => '.+')) ->defaults(array( 'controller' => 'error', 'action' => '404', 'id' => FALSE, )); Route::set('admin', 'admin/(<controller>(/<action>(/<id>)))') ->defaults(array( 'directory' => 'admin', 'controller' => 'home', 'action' => 'index', )); Route::set('default', '(<controller>(/<action>(/<id>)))') ->defaults(array( 'controller' => 'client', 'action' => 'index', ));
12-05-2011-wharfland-project
trunk/application/bootstrap.php
PHP
mit
6,589
<?php defined('SYSPATH') or die('No direct script access.'); return array( 'N' => 'Bắc', 'E' => 'Đông', 'W' => 'Tây', 'S' => 'Nam', 'ES' => 'Đông nam', 'EN' => 'Đông bắc', 'WS' => 'Tây nam', 'WN' => 'Tây bắc', 'UD' => 'Bất kỳ', 'rent' => 'Cho thuê', 'lease' => 'Cần mua', 'title' => 'Tiêu đề', 'contact name' => 'Tên người liên hệ', 'contact phone' => 'Điện thoại liên hệ', 'area' => 'Diện tích', 'name' => 'Tên', 'content' => 'Nội dung', 'address' => 'Địa chỉ', 'email' => 'Email', 'first_name' => 'Họ', 'last_name' => 'Tên', 'password' => 'Mật khẩu', 'username' => 'Biệt danh', // validation ':field must contain only letters' => ':field chỉ bao gồm kí tự', ':field must contain only numbers, letters and dashes' => ':field chỉ bao gồm số, chữ và gạch chân', ':field must contain only letters and numbers' => ':field chỉ bao gồm chữ và số', ':field must be a color' => ':field phải là mã màu', ':field must be a credit card number' => '', ':field must be a date' => '', ':field must be a decimal with :param2 places' => '', ':field must be a digit' => '', ':field must be a email address' => ':field phải là địa chỉ email hợp lệ', ':field must contain a valid email domain' => '', ':field must equal :param2' => '', ':field must be exactly :param2 characters long' => '', ':field must be one of the available options' => '', ':field must be an ip address' => '', ':field must be the same as :param2' => '', ':field must be at least :param2 characters long' => '', ':field must be less than :param2 characters long' => '', ':field must not be empty' => ':field không được để trống', ':field must be numeric' => ':field phải là số', ':field must be a phone number' => ':field phải là điện thoại', ':field must be within the range of :param2 to :param3' => '', ':field does not match the required format' => '', ':field must be a url' => ':field phải là địa chỉ url', ':field must be unique' => ':field này đã được sử dụng rồi bạn ơi', );
12-05-2011-wharfland-project
trunk/application/i18n/vi.php
PHP
mit
2,308
<?php /** * The directory in which your application specific resources are located. * The application directory must contain the bootstrap.php file. * * @see http://kohanaframework.org/guide/about.install#application */ $application = 'application'; /** * The directory in which your modules are located. * * @see http://kohanaframework.org/guide/about.install#modules */ $modules = 'modules'; /** * The directory in which the Kohana resources are located. The system * directory must contain the classes/kohana.php file. * * @see http://kohanaframework.org/guide/about.install#system */ $system = 'system'; /** * The default extension of resource files. If you change this, all resources * must be renamed to use the new extension. * * @see http://kohanaframework.org/guide/about.install#ext */ define('EXT', '.php'); /** * Set the PHP error reporting level. If you set this in php.ini, you remove this. * @see http://php.net/error_reporting * * When developing your application, it is highly recommended to enable notices * and strict warnings. Enable them by using: E_ALL | E_STRICT * * In a production environment, it is safe to ignore notices and strict warnings. * Disable them by using: E_ALL ^ E_NOTICE * * When using a legacy application with PHP >= 5.3, it is recommended to disable * deprecated notices. Disable with: E_ALL & ~E_DEPRECATED */ error_reporting(E_ALL | E_STRICT); /** * End of standard configuration! Changing any of the code below should only be * attempted by those with a working knowledge of Kohana internals. * * @see http://kohanaframework.org/guide/using.configuration */ // Set the full path to the docroot define('DOCROOT', realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR); // Make the application relative to the docroot, for symlink'd index.php if ( ! is_dir($application) AND is_dir(DOCROOT.$application)) $application = DOCROOT.$application; // Make the modules relative to the docroot, for symlink'd index.php if ( ! is_dir($modules) AND is_dir(DOCROOT.$modules)) $modules = DOCROOT.$modules; // Make the system relative to the docroot, for symlink'd index.php if ( ! is_dir($system) AND is_dir(DOCROOT.$system)) $system = DOCROOT.$system; // Define the absolute paths for configured directories define('APPPATH', realpath($application).DIRECTORY_SEPARATOR); define('MODPATH', realpath($modules).DIRECTORY_SEPARATOR); define('SYSPATH', realpath($system).DIRECTORY_SEPARATOR); // Clean up the configuration vars unset($application, $modules, $system); if (file_exists('install'.EXT)) { // Load the installation check return include 'install'.EXT; } /** * Define the start time of the application, used for profiling. */ if ( ! defined('KOHANA_START_TIME')) { define('KOHANA_START_TIME', microtime(TRUE)); } /** * Define the memory usage at the start of the application, used for profiling. */ if ( ! defined('KOHANA_START_MEMORY')) { define('KOHANA_START_MEMORY', memory_get_usage()); } // Bootstrap the application require APPPATH.'bootstrap'.EXT; /** * Execute the main request. A source of the URI can be passed, eg: $_SERVER['PATH_INFO']. * If no source is specified, the URI will be automatically detected. */ try { $request = Request::factory()->execute(); } catch(Exception $e) { if(Kohana::$environment == Kohana::DEVELOPMENT) { throw $e; } Kohana::$log->add(Log::ERROR,$e->getMessage()); //$request = Request::factory('client/index')->execute(); Error::error_404(); } echo $request->send_headers()->body();
12-05-2011-wharfland-project
trunk/index.php
PHP
mit
3,591
<?php defined('SYSPATH') or die('No direct script access.'); /** * A list of mime types. Our list is generally more complete and accurate than * the operating system MIME list. * * If there are any missing options, please create a ticket on our issue tracker, * http://kohanaphp.com/trac/newticket. Be sure to give the filename and * expected MIME type, as well as any additional information you can provide. */ return array ( '323' => array('text/h323'), '7z' => array('application/x-7z-compressed'), 'abw' => array('application/x-abiword'), 'acx' => array('application/internet-property-stream'), 'ai' => array('application/postscript'), 'aif' => array('audio/x-aiff'), 'aifc' => array('audio/x-aiff'), 'aiff' => array('audio/x-aiff'), 'amf' => array('application/x-amf'), 'asf' => array('video/x-ms-asf'), 'asr' => array('video/x-ms-asf'), 'asx' => array('video/x-ms-asf'), 'atom' => array('application/atom+xml'), 'avi' => array('video/avi', 'video/msvideo', 'video/x-msvideo'), 'bin' => array('application/octet-stream','application/macbinary'), 'bmp' => array('image/bmp'), 'c' => array('text/x-csrc'), 'c++' => array('text/x-c++src'), 'cab' => array('application/x-cab'), 'cc' => array('text/x-c++src'), 'cda' => array('application/x-cdf'), 'class' => array('application/octet-stream'), 'cpp' => array('text/x-c++src'), 'cpt' => array('application/mac-compactpro'), 'csh' => array('text/x-csh'), 'css' => array('text/css'), 'csv' => array('text/x-comma-separated-values', 'application/vnd.ms-excel', 'text/comma-separated-values', 'text/csv'), 'dbk' => array('application/docbook+xml'), 'dcr' => array('application/x-director'), 'deb' => array('application/x-debian-package'), 'diff' => array('text/x-diff'), 'dir' => array('application/x-director'), 'divx' => array('video/divx'), 'dll' => array('application/octet-stream', 'application/x-msdos-program'), 'dmg' => array('application/x-apple-diskimage'), 'dms' => array('application/octet-stream'), 'doc' => array('application/msword'), 'docx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document'), 'dvi' => array('application/x-dvi'), 'dxr' => array('application/x-director'), 'eml' => array('message/rfc822'), 'eps' => array('application/postscript'), 'evy' => array('application/envoy'), 'exe' => array('application/x-msdos-program', 'application/octet-stream'), 'fla' => array('application/octet-stream'), 'flac' => array('application/x-flac'), 'flc' => array('video/flc'), 'fli' => array('video/fli'), 'flv' => array('video/x-flv'), 'gif' => array('image/gif'), 'gtar' => array('application/x-gtar'), 'gz' => array('application/x-gzip'), 'h' => array('text/x-chdr'), 'h++' => array('text/x-c++hdr'), 'hh' => array('text/x-c++hdr'), 'hpp' => array('text/x-c++hdr'), 'hqx' => array('application/mac-binhex40'), 'hs' => array('text/x-haskell'), 'htm' => array('text/html'), 'html' => array('text/html'), 'ico' => array('image/x-icon'), 'ics' => array('text/calendar'), 'iii' => array('application/x-iphone'), 'ins' => array('application/x-internet-signup'), 'iso' => array('application/x-iso9660-image'), 'isp' => array('application/x-internet-signup'), 'jar' => array('application/java-archive'), 'java' => array('application/x-java-applet'), 'jpe' => array('image/jpeg', 'image/pjpeg'), 'jpeg' => array('image/jpeg', 'image/pjpeg'), 'jpg' => array('image/jpeg', 'image/pjpeg'), 'js' => array('application/x-javascript'), 'json' => array('application/json'), 'latex' => array('application/x-latex'), 'lha' => array('application/octet-stream'), 'log' => array('text/plain', 'text/x-log'), 'lzh' => array('application/octet-stream'), 'm4a' => array('audio/mpeg'), 'm4p' => array('video/mp4v-es'), 'm4v' => array('video/mp4'), 'man' => array('application/x-troff-man'), 'mdb' => array('application/x-msaccess'), 'midi' => array('audio/midi'), 'mid' => array('audio/midi'), 'mif' => array('application/vnd.mif'), 'mka' => array('audio/x-matroska'), 'mkv' => array('video/x-matroska'), 'mov' => array('video/quicktime'), 'movie' => array('video/x-sgi-movie'), 'mp2' => array('audio/mpeg'), 'mp3' => array('audio/mpeg'), 'mp4' => array('application/mp4','audio/mp4','video/mp4'), 'mpa' => array('video/mpeg'), 'mpe' => array('video/mpeg'), 'mpeg' => array('video/mpeg'), 'mpg' => array('video/mpeg'), 'mpg4' => array('video/mp4'), 'mpga' => array('audio/mpeg'), 'mpp' => array('application/vnd.ms-project'), 'mpv' => array('video/x-matroska'), 'mpv2' => array('video/mpeg'), 'ms' => array('application/x-troff-ms'), 'msg' => array('application/msoutlook','application/x-msg'), 'msi' => array('application/x-msi'), 'nws' => array('message/rfc822'), 'oda' => array('application/oda'), 'odb' => array('application/vnd.oasis.opendocument.database'), 'odc' => array('application/vnd.oasis.opendocument.chart'), 'odf' => array('application/vnd.oasis.opendocument.forumla'), 'odg' => array('application/vnd.oasis.opendocument.graphics'), 'odi' => array('application/vnd.oasis.opendocument.image'), 'odm' => array('application/vnd.oasis.opendocument.text-master'), 'odp' => array('application/vnd.oasis.opendocument.presentation'), 'ods' => array('application/vnd.oasis.opendocument.spreadsheet'), 'odt' => array('application/vnd.oasis.opendocument.text'), 'oga' => array('audio/ogg'), 'ogg' => array('application/ogg'), 'ogv' => array('video/ogg'), 'otg' => array('application/vnd.oasis.opendocument.graphics-template'), 'oth' => array('application/vnd.oasis.opendocument.web'), 'otp' => array('application/vnd.oasis.opendocument.presentation-template'), 'ots' => array('application/vnd.oasis.opendocument.spreadsheet-template'), 'ott' => array('application/vnd.oasis.opendocument.template'), 'p' => array('text/x-pascal'), 'pas' => array('text/x-pascal'), 'patch' => array('text/x-diff'), 'pbm' => array('image/x-portable-bitmap'), 'pdf' => array('application/pdf', 'application/x-download'), 'php' => array('application/x-httpd-php'), 'php3' => array('application/x-httpd-php'), 'php4' => array('application/x-httpd-php'), 'php5' => array('application/x-httpd-php'), 'phps' => array('application/x-httpd-php-source'), 'phtml' => array('application/x-httpd-php'), 'pl' => array('text/x-perl'), 'pm' => array('text/x-perl'), 'png' => array('image/png', 'image/x-png'), 'po' => array('text/x-gettext-translation'), 'pot' => array('application/vnd.ms-powerpoint'), 'pps' => array('application/vnd.ms-powerpoint'), 'ppt' => array('application/powerpoint'), 'pptx' => array('application/vnd.openxmlformats-officedocument.presentationml.presentation'), 'ps' => array('application/postscript'), 'psd' => array('application/x-photoshop', 'image/x-photoshop'), 'pub' => array('application/x-mspublisher'), 'py' => array('text/x-python'), 'qt' => array('video/quicktime'), 'ra' => array('audio/x-realaudio'), 'ram' => array('audio/x-realaudio', 'audio/x-pn-realaudio'), 'rar' => array('application/rar'), 'rgb' => array('image/x-rgb'), 'rm' => array('audio/x-pn-realaudio'), 'rpm' => array('audio/x-pn-realaudio-plugin', 'application/x-redhat-package-manager'), 'rss' => array('application/rss+xml'), 'rtf' => array('text/rtf'), 'rtx' => array('text/richtext'), 'rv' => array('video/vnd.rn-realvideo'), 'sea' => array('application/octet-stream'), 'sh' => array('text/x-sh'), 'shtml' => array('text/html'), 'sit' => array('application/x-stuffit'), 'smi' => array('application/smil'), 'smil' => array('application/smil'), 'so' => array('application/octet-stream'), 'src' => array('application/x-wais-source'), 'svg' => array('image/svg+xml'), 'swf' => array('application/x-shockwave-flash'), 't' => array('application/x-troff'), 'tar' => array('application/x-tar'), 'tcl' => array('text/x-tcl'), 'tex' => array('application/x-tex'), 'text' => array('text/plain'), 'texti' => array('application/x-texinfo'), 'textinfo' => array('application/x-texinfo'), 'tgz' => array('application/x-tar'), 'tif' => array('image/tiff'), 'tiff' => array('image/tiff'), 'torrent' => array('application/x-bittorrent'), 'tr' => array('application/x-troff'), 'tsv' => array('text/tab-separated-values'), 'txt' => array('text/plain'), 'wav' => array('audio/x-wav'), 'wax' => array('audio/x-ms-wax'), 'wbxml' => array('application/wbxml'), 'wm' => array('video/x-ms-wm'), 'wma' => array('audio/x-ms-wma'), 'wmd' => array('application/x-ms-wmd'), 'wmlc' => array('application/wmlc'), 'wmv' => array('video/x-ms-wmv', 'application/octet-stream'), 'wmx' => array('video/x-ms-wmx'), 'wmz' => array('application/x-ms-wmz'), 'word' => array('application/msword', 'application/octet-stream'), 'wp5' => array('application/wordperfect5.1'), 'wpd' => array('application/vnd.wordperfect'), 'wvx' => array('video/x-ms-wvx'), 'xbm' => array('image/x-xbitmap'), 'xcf' => array('image/xcf'), 'xhtml' => array('application/xhtml+xml'), 'xht' => array('application/xhtml+xml'), 'xl' => array('application/excel', 'application/vnd.ms-excel'), 'xla' => array('application/excel', 'application/vnd.ms-excel'), 'xlc' => array('application/excel', 'application/vnd.ms-excel'), 'xlm' => array('application/excel', 'application/vnd.ms-excel'), 'xls' => array('application/excel', 'application/vnd.ms-excel'), 'xlsx' => array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'), 'xlt' => array('application/excel', 'application/vnd.ms-excel'), 'xml' => array('text/xml', 'application/xml'), 'xof' => array('x-world/x-vrml'), 'xpm' => array('image/x-xpixmap'), 'xsl' => array('text/xml'), 'xvid' => array('video/x-xvid'), 'xwd' => array('image/x-xwindowdump'), 'z' => array('application/x-compress'), 'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed') );
12-05-2011-wharfland-project
trunk/system/config/mimes.php
PHP
mit
10,255
<?php defined('SYSPATH') or die('No direct script access.'); return array( 'cookie' => array( 'encrypted' => FALSE, ), );
12-05-2011-wharfland-project
trunk/system/config/session.php
PHP
mit
127
<?php defined('SYSPATH') or die('No direct script access.'); /** * Credit card validation configuration. * * Options for each credit card: * length - All the allowed card number lengths, in a comma separated string * prefix - The digits the card needs to start with, in regex format * luhn - Enable or disable card number validation by the Luhn algorithm */ return array( 'default' => array( 'length' => '13,14,15,16,17,18,19', 'prefix' => '', 'luhn' => TRUE, ), 'american express' => array( 'length' => '15', 'prefix' => '3[47]', 'luhn' => TRUE, ), 'diners club' => array( 'length' => '14,16', 'prefix' => '36|55|30[0-5]', 'luhn' => TRUE, ), 'discover' => array( 'length' => '16', 'prefix' => '6(?:5|011)', 'luhn' => TRUE, ), 'jcb' => array( 'length' => '15,16', 'prefix' => '3|1800|2131', 'luhn' => TRUE, ), 'maestro' => array( 'length' => '16,18', 'prefix' => '50(?:20|38)|6(?:304|759)', 'luhn' => TRUE, ), 'mastercard' => array( 'length' => '16', 'prefix' => '5[1-5]', 'luhn' => TRUE, ), 'visa' => array( 'length' => '13,16', 'prefix' => '4', 'luhn' => TRUE, ), );
12-05-2011-wharfland-project
trunk/system/config/credit_cards.php
PHP
mit
1,169
<?php defined('SYSPATH') or die('No direct script access.'); return array( // Leave this alone 'modules' => array( // This should be the path to this modules userguide pages, without the 'guide/'. Ex: '/guide/modulename/' would be 'modulename' 'kohana' => array( // Whether this modules userguide pages should be shown 'enabled' => TRUE, // The name that should show up on the userguide index page 'name' => 'Kohana', // A short description of this module, shown on the index page 'description' => 'Documentation for Kohana core/system.', // Copyright message, shown in the footer for this module 'copyright' => '&copy; 2008–2010 Kohana Team', ) ) );
12-05-2011-wharfland-project
trunk/system/config/userguide.php
PHP
mit
698
<?php defined('SYSPATH') or die('No direct script access.'); return array( 'platform' => array( 'windows nt 6.1' => 'Windows 7', 'windows nt 6.0' => 'Windows Vista', 'windows nt 5.2' => 'Windows 2003', 'windows nt 5.1' => 'Windows XP', 'windows nt 5.0' => 'Windows 2000', 'windows nt 4.0' => 'Windows NT', 'winnt4.0' => 'Windows NT', 'winnt 4.0' => 'Windows NT', 'winnt' => 'Windows NT', 'windows 98' => 'Windows 98', 'win98' => 'Windows 98', 'windows 95' => 'Windows 95', 'win95' => 'Windows 95', 'windows' => 'Unknown Windows OS', 'os x' => 'Mac OS X', 'intel mac' => 'Intel Mac', 'ppc mac' => 'PowerPC Mac', 'powerpc' => 'PowerPC', 'ppc' => 'PowerPC', 'cygwin' => 'Cygwin', 'linux' => 'Linux', 'debian' => 'Debian', 'openvms' => 'OpenVMS', 'sunos' => 'Sun Solaris', 'amiga' => 'Amiga', 'beos' => 'BeOS', 'apachebench' => 'ApacheBench', 'freebsd' => 'FreeBSD', 'netbsd' => 'NetBSD', 'bsdi' => 'BSDi', 'openbsd' => 'OpenBSD', 'os/2' => 'OS/2', 'warp' => 'OS/2', 'aix' => 'AIX', 'irix' => 'Irix', 'osf' => 'DEC OSF', 'hp-ux' => 'HP-UX', 'hurd' => 'GNU/Hurd', 'unix' => 'Unknown Unix OS', ), 'browser' => array( 'Opera' => 'Opera', 'MSIE' => 'Internet Explorer', 'Internet Explorer' => 'Internet Explorer', 'Shiira' => 'Shiira', 'Firefox' => 'Firefox', 'Chimera' => 'Chimera', 'Phoenix' => 'Phoenix', 'Firebird' => 'Firebird', 'Camino' => 'Camino', 'Navigator' => 'Netscape', 'Netscape' => 'Netscape', 'OmniWeb' => 'OmniWeb', 'Chrome' => 'Chrome', 'Safari' => 'Safari', 'CFNetwork' => 'Safari', // Core Foundation for OSX, WebKit/Safari 'Konqueror' => 'Konqueror', 'Epiphany' => 'Epiphany', 'Galeon' => 'Galeon', 'Mozilla' => 'Mozilla', 'icab' => 'iCab', 'lynx' => 'Lynx', 'links' => 'Links', 'hotjava' => 'HotJava', 'amaya' => 'Amaya', 'IBrowse' => 'IBrowse', ), 'mobile' => array( 'mobileexplorer' => 'Mobile Explorer', 'openwave' => 'Open Wave', 'opera mini' => 'Opera Mini', 'operamini' => 'Opera Mini', 'elaine' => 'Palm', 'palmsource' => 'Palm', 'digital paths' => 'Palm', 'avantgo' => 'Avantgo', 'xiino' => 'Xiino', 'palmscape' => 'Palmscape', 'nokia' => 'Nokia', 'ericsson' => 'Ericsson', 'blackBerry' => 'BlackBerry', 'motorola' => 'Motorola', 'iphone' => 'iPhone', 'ipad' => 'iPad', 'ipod' => 'iPod', 'android' => 'Android', ), 'robot' => array( 'googlebot' => 'Googlebot', 'msnbot' => 'MSNBot', 'slurp' => 'Inktomi Slurp', 'yahoo' => 'Yahoo', 'askjeeves' => 'AskJeeves', 'fastcrawler' => 'FastCrawler', 'infoseek' => 'InfoSeek Robot 1.0', 'lycos' => 'Lycos', ), );
12-05-2011-wharfland-project
trunk/system/config/user_agents.php
PHP
mit
3,327
<?php defined('SYSPATH') or die('No direct script access.'); return array( CURLOPT_USERAGENT => 'Mozilla/5.0 (compatible; Kohana v'.Kohana::VERSION.' +http://kohanaframework.org/)', CURLOPT_CONNECTTIMEOUT => 5, CURLOPT_TIMEOUT => 5, CURLOPT_HEADERFUNCTION => array('Request_Client_External', '_parse_headers'), CURLOPT_HEADER => FALSE, );
12-05-2011-wharfland-project
trunk/system/config/curl.php
PHP
mit
364
<?php defined('SYSPATH') or die('No direct script access.'); return array( 'default' => array( /** * The following options must be set: * * string key secret passphrase * integer mode encryption mode, one of MCRYPT_MODE_* * integer cipher encryption cipher, one of the Mcrpyt cipher constants */ 'cipher' => MCRYPT_RIJNDAEL_128, 'mode' => MCRYPT_MODE_NOFB, ), );
12-05-2011-wharfland-project
trunk/system/config/encrypt.php
PHP
mit
406
<?php defined('SYSPATH') or die('No direct script access.'); return array( 'uncountable' => array( 'access', 'advice', 'aircraft', 'art', 'baggage', 'bison', 'dances', 'deer', 'equipment', 'fish', 'fuel', 'furniture', 'heat', 'honey', 'homework', 'impatience', 'information', 'knowledge', 'luggage', 'media', 'money', 'moose', 'music', 'news', 'patience', 'progress', 'pollution', 'research', 'rice', 'salmon', 'sand', 'series', 'sheep', 'sms', 'spam', 'species', 'staff', 'swine', 'toothpaste', 'traffic', 'understanding', 'water', 'weather', 'work', ), 'irregular' => array( 'child' => 'children', 'clothes' => 'clothing', 'man' => 'men', 'movie' => 'movies', 'person' => 'people', 'woman' => 'women', 'mouse' => 'mice', 'goose' => 'geese', 'ox' => 'oxen', 'leaf' => 'leaves', 'course' => 'courses', 'size' => 'sizes', 'was' => 'were', 'is' => 'are', 'verse' => 'verses', 'hero' => 'heroes', 'purchase' => 'purchases', ), );
12-05-2011-wharfland-project
trunk/system/config/inflector.php
PHP
mit
1,056
<?php // Get the latest logo contents $data = base64_encode(file_get_contents('http://kohanaframework.org/media/img/kohana.png')); // Create the logo file file_put_contents('logo.php', "<?php /** * Kohana Logo, base64_encoded PNG * * @copyright (c) 2008-2011 Kohana Team * @license http://kohanaframework.org/license */ return array('mime' => 'image/png', 'data' => '{$data}'); ?>");
12-05-2011-wharfland-project
trunk/system/views/kohana/generate_logo.php
PHP
mit
395
<?php // Unique error identifier $error_id = uniqid('error'); ?> <style type="text/css"> #kohana_error { background: #ddd; font-size: 1em; font-family:sans-serif; text-align: left; color: #111; } #kohana_error h1, #kohana_error h2 { margin: 0; padding: 1em; font-size: 1em; font-weight: normal; background: #911; color: #fff; } #kohana_error h1 a, #kohana_error h2 a { color: #fff; } #kohana_error h2 { background: #222; } #kohana_error h3 { margin: 0; padding: 0.4em 0 0; font-size: 1em; font-weight: normal; } #kohana_error p { margin: 0; padding: 0.2em 0; } #kohana_error a { color: #1b323b; } #kohana_error pre { overflow: auto; white-space: pre-wrap; } #kohana_error table { width: 100%; display: block; margin: 0 0 0.4em; padding: 0; border-collapse: collapse; background: #fff; } #kohana_error table td { border: solid 1px #ddd; text-align: left; vertical-align: top; padding: 0.4em; } #kohana_error div.content { padding: 0.4em 1em 1em; overflow: hidden; } #kohana_error pre.source { margin: 0 0 1em; padding: 0.4em; background: #fff; border: dotted 1px #b7c680; line-height: 1.2em; } #kohana_error pre.source span.line { display: block; } #kohana_error pre.source span.highlight { background: #f0eb96; } #kohana_error pre.source span.line span.number { color: #666; } #kohana_error ol.trace { display: block; margin: 0 0 0 2em; padding: 0; list-style: decimal; } #kohana_error ol.trace li { margin: 0; padding: 0; } .js .collapsed { display: none; } </style> <script type="text/javascript"> document.documentElement.className = document.documentElement.className + ' js'; function koggle(elem) { elem = document.getElementById(elem); if (elem.style && elem.style['display']) // Only works with the "style" attr var disp = elem.style['display']; else if (elem.currentStyle) // For MSIE, naturally var disp = elem.currentStyle['display']; else if (window.getComputedStyle) // For most other browsers var disp = document.defaultView.getComputedStyle(elem, null).getPropertyValue('display'); // Toggle the state of the "display" style elem.style.display = disp == 'block' ? 'none' : 'block'; return false; } </script> <div id="kohana_error"> <h1><span class="type"><?php echo $type ?> [ <?php echo $code ?> ]:</span> <span class="message"><?php echo html::chars($message) ?></span></h1> <div id="<?php echo $error_id ?>" class="content"> <p><span class="file"><?php echo Debug::path($file) ?> [ <?php echo $line ?> ]</span></p> <?php echo Debug::source($file, $line) ?> <ol class="trace"> <?php foreach (Debug::trace($trace) as $i => $step): ?> <li> <p> <span class="file"> <?php if ($step['file']): $source_id = $error_id.'source'.$i; ?> <a href="#<?php echo $source_id ?>" onclick="return koggle('<?php echo $source_id ?>')"><?php echo Debug::path($step['file']) ?> [ <?php echo $step['line'] ?> ]</a> <?php else: ?> {<?php echo __('PHP internal call') ?>} <?php endif ?> </span> &raquo; <?php echo $step['function'] ?>(<?php if ($step['args']): $args_id = $error_id.'args'.$i; ?><a href="#<?php echo $args_id ?>" onclick="return koggle('<?php echo $args_id ?>')"><?php echo __('arguments') ?></a><?php endif ?>) </p> <?php if (isset($args_id)): ?> <div id="<?php echo $args_id ?>" class="collapsed"> <table cellspacing="0"> <?php foreach ($step['args'] as $name => $arg): ?> <tr> <td><code><?php echo $name ?></code></td> <td><pre><?php echo Debug::dump($arg) ?></pre></td> </tr> <?php endforeach ?> </table> </div> <?php endif ?> <?php if (isset($source_id)): ?> <pre id="<?php echo $source_id ?>" class="source collapsed"><code><?php echo $step['source'] ?></code></pre> <?php endif ?> </li> <?php unset($args_id, $source_id); ?> <?php endforeach ?> </ol> </div> <h2><a href="#<?php echo $env_id = $error_id.'environment' ?>" onclick="return koggle('<?php echo $env_id ?>')"><?php echo __('Environment') ?></a></h2> <div id="<?php echo $env_id ?>" class="content collapsed"> <?php $included = get_included_files() ?> <h3><a href="#<?php echo $env_id = $error_id.'environment_included' ?>" onclick="return koggle('<?php echo $env_id ?>')"><?php echo __('Included files') ?></a> (<?php echo count($included) ?>)</h3> <div id="<?php echo $env_id ?>" class="collapsed"> <table cellspacing="0"> <?php foreach ($included as $file): ?> <tr> <td><code><?php echo Debug::path($file) ?></code></td> </tr> <?php endforeach ?> </table> </div> <?php $included = get_loaded_extensions() ?> <h3><a href="#<?php echo $env_id = $error_id.'environment_loaded' ?>" onclick="return koggle('<?php echo $env_id ?>')"><?php echo __('Loaded extensions') ?></a> (<?php echo count($included) ?>)</h3> <div id="<?php echo $env_id ?>" class="collapsed"> <table cellspacing="0"> <?php foreach ($included as $file): ?> <tr> <td><code><?php echo Debug::path($file) ?></code></td> </tr> <?php endforeach ?> </table> </div> <?php foreach (array('_SESSION', '_GET', '_POST', '_FILES', '_COOKIE', '_SERVER') as $var): ?> <?php if (empty($GLOBALS[$var]) OR ! is_array($GLOBALS[$var])) continue ?> <h3><a href="#<?php echo $env_id = $error_id.'environment'.strtolower($var) ?>" onclick="return koggle('<?php echo $env_id ?>')">$<?php echo $var ?></a></h3> <div id="<?php echo $env_id ?>" class="collapsed"> <table cellspacing="0"> <?php foreach ($GLOBALS[$var] as $key => $value): ?> <tr> <td><code><?php echo HTML::chars($key) ?></code></td> <td><pre><?php echo Debug::dump($value) ?></pre></td> </tr> <?php endforeach ?> </table> </div> <?php endforeach ?> </div> </div>
12-05-2011-wharfland-project
trunk/system/views/kohana/error.php
PHP
mit
5,753
.kohana table.profiler { width: 99%; margin: 0 auto 1em; border-collapse: collapse; } .kohana table.profiler th, .kohana table.profiler td { padding: 0.2em 0.4em; background: #fff; border: solid 1px #999; border-width: 1px 0; text-align: left; font-weight: normal; font-size: 1em; color: #111; vertical-align: top; text-align: right; } .kohana table.profiler th.name { text-align: left; } .kohana table.profiler tr.group th { font-size: 1.4em; background: #222; color: #eee; border-color: #222; } .kohana table.profiler tr.group td { background: #222; color: #777; border-color: #222; } .kohana table.profiler tr.group td.time { padding-bottom: 0; } .kohana table.profiler tr.headers th { text-transform: lowercase; font-variant: small-caps; background: #ddd; color: #777; } .kohana table.profiler tr.mark th.name { width: 40%; font-size: 1.2em; background: #fff; vertical-align: middle; } .kohana table.profiler tr.mark td { padding: 0; } .kohana table.profiler tr.mark.final td { padding: 0.2em 0.4em; } .kohana table.profiler tr.mark td > div { position: relative; padding: 0.2em 0.4em; } .kohana table.profiler tr.mark td div.value { position: relative; z-index: 2; } .kohana table.profiler tr.mark td div.graph { position: absolute; top: 0; bottom: 0; right: 0; left: 100%; background: #71bdf0; z-index: 1; } .kohana table.profiler tr.mark.memory td div.graph { background: #acd4f0; } .kohana table.profiler tr.mark td.current { background: #eddecc; } .kohana table.profiler tr.mark td.min { background: #d2f1cb; } .kohana table.profiler tr.mark td.max { background: #ead3cb; } .kohana table.profiler tr.mark td.average { background: #ddd; } .kohana table.profiler tr.mark td.total { background: #d0e3f0; } .kohana table.profiler tr.time td { border-bottom: 0; font-weight: bold; } .kohana table.profiler tr.memory td { border-top: 0; } .kohana table.profiler tr.final th.name { background: #222; color: #fff; } .kohana table.profiler abbr { border: 0; color: #777; font-weight: normal; } .kohana table.profiler:hover tr.group td { color: #ccc; } .kohana table.profiler:hover tr.mark td div.graph { background: #1197f0; } .kohana table.profiler:hover tr.mark.memory td div.graph { background: #7cc1f0; }
12-05-2011-wharfland-project
trunk/system/views/profiler/style.css
CSS
mit
2,208
<?php defined('SYSPATH') or die('No direct script access.') ?> <style type="text/css"> <?php include Kohana::find_file('views', 'profiler/style', 'css') ?> </style> <?php $group_stats = Profiler::group_stats(); $group_cols = array('min', 'max', 'average', 'total'); $application_cols = array('min', 'max', 'average', 'current'); ?> <div class="kohana"> <?php foreach (Profiler::groups() as $group => $benchmarks): ?> <table class="profiler"> <tr class="group"> <th class="name" rowspan="2"><?php echo __(ucfirst($group)) ?></th> <td class="time" colspan="4"><?php echo number_format($group_stats[$group]['total']['time'], 6) ?> <abbr title="seconds">s</abbr></td> </tr> <tr class="group"> <td class="memory" colspan="4"><?php echo number_format($group_stats[$group]['total']['memory'] / 1024, 4) ?> <abbr title="kilobyte">kB</abbr></td> </tr> <tr class="headers"> <th class="name"><?php echo __('Benchmark') ?></th> <?php foreach ($group_cols as $key): ?> <th class="<?php echo $key ?>"><?php echo __(ucfirst($key)) ?></th> <?php endforeach ?> </tr> <?php foreach ($benchmarks as $name => $tokens): ?> <tr class="mark time"> <?php $stats = Profiler::stats($tokens) ?> <th class="name" rowspan="2" scope="rowgroup"><?php echo HTML::chars($name), ' (', count($tokens), ')' ?></th> <?php foreach ($group_cols as $key): ?> <td class="<?php echo $key ?>"> <div> <div class="value"><?php echo number_format($stats[$key]['time'], 6) ?> <abbr title="seconds">s</abbr></div> <?php if ($key === 'total'): ?> <div class="graph" style="left: <?php echo max(0, 100 - $stats[$key]['time'] / $group_stats[$group]['max']['time'] * 100) ?>%"></div> <?php endif ?> </div> </td> <?php endforeach ?> </tr> <tr class="mark memory"> <?php foreach ($group_cols as $key): ?> <td class="<?php echo $key ?>"> <div> <div class="value"><?php echo number_format($stats[$key]['memory'] / 1024, 4) ?> <abbr title="kilobyte">kB</abbr></div> <?php if ($key === 'total'): ?> <div class="graph" style="left: <?php echo max(0, 100 - $stats[$key]['memory'] / $group_stats[$group]['max']['memory'] * 100) ?>%"></div> <?php endif ?> </div> </td> <?php endforeach ?> </tr> <?php endforeach ?> </table> <?php endforeach ?> <table class="profiler"> <?php $stats = Profiler::application() ?> <tr class="final mark time"> <th class="name" rowspan="2" scope="rowgroup"><?php echo __('Application Execution').' ('.$stats['count'].')' ?></th> <?php foreach ($application_cols as $key): ?> <td class="<?php echo $key ?>"><?php echo number_format($stats[$key]['time'], 6) ?> <abbr title="seconds">s</abbr></td> <?php endforeach ?> </tr> <tr class="final mark memory"> <?php foreach ($application_cols as $key): ?> <td class="<?php echo $key ?>"><?php echo number_format($stats[$key]['memory'] / 1024, 4) ?> <abbr title="kilobyte">kB</abbr></td> <?php endforeach ?> </tr> </table> </div>
12-05-2011-wharfland-project
trunk/system/views/profiler/stats.php
PHP
mit
3,022
<?php defined('SYSPATH') or die('No direct script access.'); return array( 'alpha' => ':field must contain only letters', 'alpha_dash' => ':field must contain only numbers, letters and dashes', 'alpha_numeric' => ':field must contain only letters and numbers', 'color' => ':field must be a color', 'credit_card' => ':field must be a credit card number', 'date' => ':field must be a date', 'decimal' => ':field must be a decimal with :param2 places', 'digit' => ':field must be a digit', 'email' => ':field must be a email address', 'email_domain' => ':field must contain a valid email domain', 'equals' => ':field must equal :param2', 'exact_length' => ':field must be exactly :param2 characters long', 'in_array' => ':field must be one of the available options', 'ip' => ':field must be an ip address', 'matches' => ':field must be the same as :param2', 'min_length' => ':field must be at least :param2 characters long', 'max_length' => ':field must be less than :param2 characters long', 'not_empty' => ':field must not be empty', 'numeric' => ':field must be numeric', 'phone' => ':field must be a phone number', 'range' => ':field must be within the range of :param2 to :param3', 'regex' => ':field does not match the required format', 'url' => ':field must be a url', );
12-05-2011-wharfland-project
trunk/system/messages/validation.php
PHP
mit
1,433
<?php defined('SYSPATH') OR die('Kohana bootstrap needs to be included before tests run'); /** * Unit tests for internal request client * * @group kohana * @group kohana.request * @group kohana.request.client * @group kohana.request.client.internal * * @package Kohana * @category Tests * @author Kohana Team * @copyright (c) 2008-2011 Kohana Team * @license http://kohanaframework.org/license */ class Kohana_Request_Client_InternalTest extends Unittest_TestCase { public function provider_exceptions() { return array( array('', 'welcome', 'missing_action', 'welcome/missing_action', 'The requested URL welcome/missing_action was not found on this server.'), array('kohana3', 'missing_controller', 'index', 'kohana3/missing_controller/index', 'The requested URL kohana3/missing_controller/index was not found on this server.'), array('', 'template', 'missing_action', 'kohana3/template/missing_action', 'Cannot create instances of abstract controller_template'), ); } /** * Tests for correct exception messages * * @test * @dataProvider provider_exceptions * * @return null */ public function test_exceptions($directory, $controller, $action, $uri, $expected) { // Mock for request object $request = $this->getMock('Request', array(), array($uri)); $request->expects($this->any()) ->method('directory') ->will($this->returnValue($directory)); $request->expects($this->any()) ->method('controller') ->will($this->returnValue($controller)); $request->expects($this->any()) ->method('action') ->will($this->returnValue($action)); $request->expects($this->any()) ->method('uri') ->will($this->returnValue($uri)); $request->expects($this->any()) ->method('response') ->will($this->returnValue($this->getMock('Response'))); $internal_client = new Request_Client_Internal; try { $internal_client->execute($request); } catch(HTTP_Exception_404 $e) { if ($e->getMessage() !== $expected) { $this->fail('Was expecting "'.$expected.'" but got "'.$e->getMessage().'" instead.'); } return; } catch(Kohana_Exception $e) { if ($e->getMessage() !== $expected) { $this->fail('Was expecting "'.$expected.'" but got "'.$e->getMessage().'" instead.'); } return; } $this->fail('A HTTP_Exception_404 or Kohana_Exception exception was expected.'); } }
12-05-2011-wharfland-project
trunk/system/tests/kohana/request/client/internal.php
PHP
mit
2,417
<?php /** * A holding class for route callback tests * * @group kohana * * @package Unittest * @author Kohana Team * @copyright (c) 2008-2011 Kohana Team * @license http://kohanaframework.org/license */ class Route_Holder { /** * Just an empty callback that doesn't match anything */ public static function default_callback($uri) { } /** * Just an empty callback that matches everything * * @return array */ public static function default_return_callback($uri) { return array( ); } /** * Route callback for test_matches_returns_array_of_parameters_on_successful_match * * @return array */ public static function matches_returns_array_of_parameters_on_successful_match($uri) { return array( 'controller' => 'welcome', 'action' => 'index', ); } /** * Route callback for test_required_parameters_are_needed * * @return array */ public static function required_parameters_are_needed($uri) { if (substr($uri, 0, 5) == 'admin') { return array( 'controller' => 'foo', 'action' => 'bar', ); } } /** * Route callback for test reverse_routing_returns_routes_uri_if_route_is_static * * @return array */ public static function reverse_routing_returns_routes_uri_if_route_is_static($uri) { if ($uri == 'info/about_us') { return array( ); } } }
12-05-2011-wharfland-project
trunk/system/tests/test_data/callback_routes.php
PHP
mit
1,370
This is a view with a dot in the filename.
12-05-2011-wharfland-project
trunk/system/tests/test_data/views/test.css.php
Hack
mit
42
<?php defined('SYSPATH') or die('No direct script access.'); class Config_File extends Kohana_Config_File {}
12-05-2011-wharfland-project
trunk/system/classes/config/file.php
PHP
mit
109
<?php defined('SYSPATH') or die('No direct script access.'); class Config_Reader extends Kohana_Config_Reader {}
12-05-2011-wharfland-project
trunk/system/classes/config/reader.php
PHP
mit
113