当前位置: 首页>>代码示例>>PHP>>正文


PHP url::area方法代码示例

本文整理汇总了PHP中url::area方法的典型用法代码示例。如果您正苦于以下问题:PHP url::area方法的具体用法?PHP url::area怎么用?PHP url::area使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在url的用法示例。


在下文中一共展示了url::area方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: placeorder

 public function placeorder()
 {
     if ($this->current) {
         $this->template->title = 'Place Order for Sample or Dummy';
         $view = new View(url::area() . 'placeorder');
         $view->user = $this->current;
         $view->breadcrumbs = $this->breadcrumbs->add()->url(false)->title('Place Order')->cut();
         $this->template->content = $view;
     } else {
         //$this->notification->add($this->i18n['security.login.fail']);
         url::failed(url::current());
     }
 }
开发者ID:HIVE-Creative,项目名称:spicers,代码行数:13,代码来源:samples.php

示例2: init

 /**
  * This function will set all the defaults for the base controllers
  * default template, page title, etc and set up each of the classes that
  * we might use later on, notification, breadcrumbs, navigation, security.
  * 
  * @author Jamie Peake
  */
 protected function init()
 {
     // initialise the default template data
     $this->template->title = '';
     $this->template->content = '';
     $this->notification = Notification::instance();
     $this->breadcrumbs = new Breadcrumbs();
     $this->breadcrumbs->add()->url('home')->title('Home');
     // add the home location.
     $this->navigation = Navigation::instance('main');
     $this->access = Access::instance();
     $this->current = $this->access->get_user();
     $this->i18n = Kohana::lang(url::area() . Router::$method);
     $this->post = Session::instance()->get('post');
     // this is a simple way to build the css classes we will be using, it will check to see
     // if the method is index, and if the url requested didnt include an index then it will add it
     // this is a feeble way to do this, and needs to be looked into as there are cases where it will break
     // @todo test with edge cases, fix for edge cases.
     $this->css_classes = Router::$rsegments;
     if (Router::$method == 'index' && !in_array('index', Router::$rsegments)) {
         $this->css_classes[] = 'index';
     }
 }
开发者ID:HIVE-Creative,项目名称:spicers,代码行数:30,代码来源:base.php

示例3: delete

 /**
  * Will delete an inspiration, if the inspiration is owned by the current user
  *
  *
  * @todo: do not allow inspirations to be deleted if they are published.
  * @param unknown_type $id
  */
 public function delete($id = NULL)
 {
     if ($this->access->allowed('inspirations', 'delete')) {
         if ($id) {
             $inspiration = ORM::factory('inspiration', $id);
             if ($inspiration->loaded) {
                 // make sure that the current user is the owner of the inspiration.
                 if ($inspiration->user_id == $this->current->id) {
                     if ($inspiration->status != 'approved') {
                         $inspiration->status = 'deleted';
                         if ($inspiration->save()) {
                             $this->notification->add($this->i18n['system.inspiration.success'], $inspiration->name);
                         } else {
                             $this->notification->add($this->i18n['system.inspiration.failed'], $inspiration->name);
                         }
                     } else {
                         $this->notification->add($this->i18n['system.inspiration.approved'], $inspiration->name);
                     }
                 } else {
                     $this->notification($this->i18n['system.access.failed']);
                     // error you do not have access to delete someone elses inspiration.
                 }
             } else {
                 $this->notification($this->i18n['system.inspiration.invalid']);
             }
         } else {
             $this->notification($this->i18n['system.inspiration.invalid']);
         }
     } else {
         url::failed();
     }
     if (!request::is_ajax()) {
         url::redirect(url::area());
     }
 }
开发者ID:HIVE-Creative,项目名称:spicers,代码行数:42,代码来源:inspirations.php

示例4: confirm

        echo url::area() . 'edit/' . $content->id;
        ?>
"><?php 
        echo $content->name;
        ?>
</a></td>
					
					<td class="align-center"><?php 
        echo $content->status == 'approved' ? '<span class="icon-approved">&#x2714;</span>' : '<span class="icon-pending">&#x2718;</span>';
        ?>
</td>
					<td><a class="text-edit" href="<?php 
        echo url::area() . 'edit/' . $content->id;
        ?>
">Edit</a> <a class="text-delete" href="<?php 
        echo url::area() . 'delete/' . $content->id;
        ?>
" onclick="return confirm('Do you really want to delete?');">Delete</a></td>
				</tr>
			<?php 
    }
    ?>
		<?php 
} else {
    ?>
			<tr><td colspan="3">There are currently no technicals for this paper, to add one please click on the 'Add Technical' button.</td></tr> 
		<?php 
}
?>
		</tbody>
	</table>
开发者ID:HIVE-Creative,项目名称:spicers,代码行数:31,代码来源:index.php

示例5:

		<div class="header">
			<h2>Your Spicers</h2>
		</div><!-- /.header -->
		
		<?php 
if (isset($breadcrumbs) && $breadcrumbs != NULL) {
    ?>
			<?php 
    echo $breadcrumbs;
    ?>
		<?php 
}
?>
	
		<form id="signin-form" action="<?php 
echo url::area() . 'signin';
?>
" method="post" class="column x16">
			
			<div class="notifications"></div>
			
			<fieldset class="column x8 first">
				
				<input type="hidden" name="redirect" value="<?php 
echo $redirect;
?>
" />
			
				<div class="column x4">
				
					<div class="header page-title">
开发者ID:HIVE-Creative,项目名称:spicers,代码行数:31,代码来源:login.php

示例6: delete

 /**
  * Note this does not actually delete the faq but rather it just changes the status of it. 
  */
 public function delete($id = FALSE)
 {
     $group = '';
     // assign the group, so if somethign goes wrong we wont get a url redirect error
     if ($this->access->allowed('faqs', 'delete')) {
         if ($id) {
             $faq = ORM::factory('faq')->find($id);
             if ($faq->loaded) {
                 $faq->status = 'deleted';
                 if ($faq->save()) {
                     $this->notification->add($this->i18n['system.faq.success'], $faq->name);
                 } else {
                     $this->notification($this->i18n['system.faq.error']);
                 }
                 // redirect ot the group page if we have one.
                 if (!request::is_ajax()) {
                     url::redirect(url::area() . 'index/' . $faq->group);
                 }
             } else {
                 $this->notification($this->i18n['system.faq.invalid']);
             }
         } else {
             $this->notification($this->i18n['system.faq.invalid']);
         }
     } else {
         url::failed();
     }
     if (!request::is_ajax()) {
         url::redirect(url::area());
     }
 }
开发者ID:HIVE-Creative,项目名称:spicers,代码行数:34,代码来源:faqs.php

示例7: delete

 public function delete($id = FALSE)
 {
     if ($this->access->allowed('campaigns', 'delete')) {
         if ($id) {
             $campaign = ORM::factory('campaign')->find($id);
             if ($campaign->loaded) {
                 $campaign->status = 'deleted';
                 if ($campaign->save()) {
                     $this->notification->add($this->i18n['system.campaign.success'], $campaign->name);
                 } else {
                     $this->notification($this->i18n['system.campaign.error']);
                 }
             } else {
                 $this->notification($this->i18n['system.campaign.invalid']);
             }
         } else {
             $this->notification($this->i18n['system.campaign.invalid']);
         }
     } else {
         url::failed();
     }
     if (!request::is_ajax()) {
         url::redirect(url::area());
     }
 }
开发者ID:HIVE-Creative,项目名称:spicers,代码行数:25,代码来源:campaigns.php

示例8: reset_process

 public function reset_process()
 {
     // Validate the form input
     $input = Validation::factory($this->input->post())->pre_filter('trim')->add_rules('email', 'required', 'length[4,127]');
     if ($input->validate()) {
         $user = ORM::factory('user')->where('email', $this->input->post('email'))->find();
         if (valid::email($this->input->post('email'))) {
             if ($user->loaded) {
                 // we have found the user and their email address.
                 // @todo make email useable, view, conifg options etc.
                 $password = text::random(Kohana::config('password_reset.password_character_type'), Kohana::config('password_reset.random_password_length'));
                 $user->password = $password;
                 if ($user->save()) {
                     // @todo change this. So very bad.
                     email::send($this->input->post('email'), 'Jamie@hive.com.au', 'Password Reset', 'As requested, your password has been reset. It is now : ' . $password, TRUE);
                     $this->notification->add()->type('success')->title('Password Reset')->description('Your new password has been emailed to you.');
                 } else {
                     $this->notification->add()->type('error')->title('System Error')->description('The System was unable to set the new password.');
                 }
             } else {
                 $this->notification->add()->type('error')->title('Invalid Email')->description('No such email address is with in our system.');
             }
         } else {
             $this->notification->add()->type('error')->title('Invalid Email')->description('You must enter a <u>valid</u> email address to recover your password.');
         }
         url::redirect(url::area() . 'login');
     } else {
         $this->notification->add()->type('error')->title('No Email Entered')->description('You must enter a valid email address to recover your password.');
     }
 }
开发者ID:HIVE-Creative,项目名称:spicers,代码行数:30,代码来源:account.php

示例9: update

 /**
  * This method will do the update processs upon the location, this needs to be mopved into the frmaework
  * @todo to be moved intot he framework, of the hive feramw work
  */
 public function update()
 {
     if ($this->access->allowed('locations', 'update')) {
         $location = orm::factory('location')->find($this->input->post('id'));
         if ($location->loaded) {
             $input = Validation::factory($this->input->post())->pre_filter('trim')->add_rules('name', 'required')->add_rules('status', 'required')->add_rules('group', 'required')->add_rules('latitude', 'required')->add_rules('longitude', 'required')->add_rules('address', 'required');
             if ($input->validate()) {
                 // make sure that name of the location has not been entered with the same name as an exsiting one
                 if ($this->input->post('name') != $location->name) {
                     $existing = orm::factory('location')->where('name', $this->input->post('name'))->where('group', $this->input->post('group'))->find();
                     if ($existing->loaded) {
                         $this->notification->add($this->i18n['system.location.exists'], array($this->input->post('name'), $this->input->post('group')));
                         url::redirect(url::area() . 'edit/' . $location->name);
                         // redirect back to the edit page
                     }
                 }
                 $location->name = $this->input->post('name');
                 $location->description = $this->input->post('description');
                 $location->url = $this->input->post('url');
                 $location->address = $this->input->post('address');
                 $location->latitude = $this->input->post('latitude');
                 $location->longitude = $this->input->post('longitude');
                 $location->status = $this->input->post('status');
                 $location->group = $this->input->post('group');
                 // now add the image.
                 if (is_array($this->input->post('images'))) {
                     $images = $this->input->post('images');
                     $location->image = $images['logo'];
                 }
                 if ($location->save()) {
                     $this->notification->add($this->i18n['system.location.success'], $location->name);
                     // make sure that the file location exists, if not create it
                     $cms = DOCROOT . 'application/' . SITE . '/media/cms/locations/' . $location->id;
                     if (file::tree($cms)) {
                         if (isset($images)) {
                             // add the campaign logo
                             $path = $images['logo'];
                             if (file_exists(DOCROOT . 'upload/' . $path)) {
                                 //@todo change this so that the uploads folder is not part of the info sent in
                                 if (rename(DOCROOT . 'upload/' . $path, $cms . '/' . $path)) {
                                     $this->notification->add($this->i18n['cms.image.success']);
                                 } else {
                                     $this->notification->add($this->i18n['cms.image.error']);
                                 }
                             } else {
                                 $this->notification->add($this->i18n['cms.cover.error']);
                             }
                         }
                     } else {
                         $this->notification->add($this->i18n['cms.folder.error']);
                     }
                     url::redirect(url::area() . 'edit/' . $location->id);
                 } else {
                     $this->notification->add($this->i18n['system.location.failed'], $location->name);
                 }
             } else {
                 foreach ($input->errors() as $key => $value) {
                     $this->notification->add($this->i18n['filter.' . $key . '.' . $value]);
                 }
             }
         } else {
             $this->notification->add($this->i18n['system.location.invalid']);
         }
     } else {
         url::failed();
     }
     url::redirect(url::area() . 'edit/' . $this->input->post('id'));
 }
开发者ID:HIVE-Creative,项目名称:spicers,代码行数:72,代码来源:locations.php

示例10: delete

 public function delete($id = NULL)
 {
     if ($this->access->allowed('papers', 'delete')) {
         if ($id) {
             $paper = ORM::factory('paper')->find($id);
             if ($paper->loaded) {
                 $paper_name = $paper->name;
                 $paper->status = 'deleted';
                 if ($paper->save()) {
                     $this->notification->add($this->i18n['system.paper.success'], $paper_name);
                 } else {
                     $this->notification->add($this->i18n['system.paper.error'], $paper_name);
                 }
             } else {
                 $this->notification($this->i18n['system.paper.invaild']);
             }
         } else {
             $this->notification($this->i18n['system.paper.invaild']);
         }
     } else {
         url::failed();
     }
     if (!request::is_ajax()) {
         url::redirect(url::area());
     }
 }
开发者ID:HIVE-Creative,项目名称:spicers,代码行数:26,代码来源:papers.php

示例11: isset

    echo $breadcrumbs;
    ?>
		<?php 
}
?>

		<div id="register-intro" class="column x4">
			<div class="header page-title">
				<h3>Register</h3>
				<h4>Create an account with Spicers to create and share favourite lists of papers, submit work to the Inspiration showcase, order samples and more.</h4>
			</div>
			<p>Have an account? <a href="account/login">Sign in</a></p>
		</div><!-- /.column -->

		<form id="site-register" action="<?php 
echo url::area() . 'signup';
?>
" method="post" class="column x12">

			<div class="notifications"></div>

			<div id="register">

				<fieldset class="column x4 first">
					<div class="header">
						<h4>Your Details</h4>
					</div><!-- /.header -->
					<dl>
						<dt><label for="register-user-firstname">First Name <span class="required">*</span></label></dt>
				    	<dd><input type="text" id="register-user-firstname" name="firstname" value="<?php 
echo isset($post['firstname']) ? $post['firstname'] : '';
开发者ID:HIVE-Creative,项目名称:spicers,代码行数:31,代码来源:register.php

示例12:

			<?php 
    echo $breadcrumbs;
    ?>
		<?php 
}
?>

		<div class="column x4">

			<div class="header page-title">
				<h3>Settings</h3>
				<p>Keep your details up to date to get the best out of Spicers.com.au</p>
			</div>

			<form id="account-settings" action="<?php 
echo url::area() . 'update';
?>
" method="post">
				<div class="notifications"></div>
				<input type="hidden" name="action" value="details" />
				<fieldset>
					<legend>Your Details</legend>
					<ul class="block-list">
						<?php 
if ($type == 'username') {
    ?>
						<li>
							<label class="column first" for="settings-user">User Name</label>
							<div class="column x3 last">
					    		<input type="text" name="username" id="settings-user" value="<?php 
    echo $user->username;
开发者ID:HIVE-Creative,项目名称:spicers,代码行数:31,代码来源:settings.php

示例13:

						<div class="image">
							<a href="/products/papers/view/<?php 
        echo $paper->name;
        ?>
"><img src="/media/cms/products/papers/<?php 
        echo $paper->id;
        ?>
/logo.jpg" alt="<?php 
        echo $paper->name;
        ?>
" /></a>
							<?php 
        if ($current_user) {
            ?>
								<a href="<?php 
            echo url::area() . 'papers/delete/' . $lightbox->id . '/' . $paper->id;
            ?>
" class="button button-account remove"><span>Remove</span></a>
							<?php 
        }
        ?>
						</div>
						<div class="content">
							<h5><a href="/products/papers/view/<?php 
        echo $paper->name;
        ?>
"><?php 
        echo $paper->name;
        ?>
</a></h5>
							<p><?php 
开发者ID:HIVE-Creative,项目名称:spicers,代码行数:31,代码来源:view.php

示例14: delete

 /**
  * Note this does not actually delete the faq but rather it just changes the status of it. 
  */
 public function delete($id = FALSE)
 {
     $group = '';
     // assign the group, so if somethign goes wrong we wont get a url redirect error
     if ($this->access->allowed('glossaries', 'delete')) {
         if ($id) {
             $glossary = ORM::factory('glossary')->find($id);
             if ($glossary->loaded) {
                 $glossary->status = 'deleted';
                 if ($glossary->save()) {
                     $this->notification->add($this->i18n['system.glossary.success'], $glossary->name);
                 } else {
                     $this->notification($this->i18n['system.glossary.error']);
                 }
             } else {
                 $this->notification($this->i18n['system.glossary.invalid']);
             }
         } else {
             $this->notification($this->i18n['system.glossary.invalid']);
         }
     } else {
         url::failed();
     }
     if (!request::is_ajax()) {
         url::redirect(url::area());
     }
 }
开发者ID:HIVE-Creative,项目名称:spicers,代码行数:30,代码来源:glossaries.php

示例15: delete

 public function delete($id = NULL)
 {
     if ($this->access->allowed('industrials', 'delete')) {
         if ($id > 0) {
             $industrial = orm::factory('industrial')->find($id);
             if ($industrial->loaded) {
                 $name = $industrial->name;
                 // for use with the notification system
                 if ($industrial->delete()) {
                     // success
                 } else {
                     // error
                 }
             } else {
                 // invalid
             }
         } else {
             // invalid
         }
     } else {
         url::failed();
     }
     if (!request::is_ajax()) {
         url::redirect(url::area());
     }
 }
开发者ID:HIVE-Creative,项目名称:spicers,代码行数:26,代码来源:industrials.php


注:本文中的url::area方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。