本文整理汇总了PHP中Navigation::item_buttons方法的典型用法代码示例。如果您正苦于以下问题:PHP Navigation::item_buttons方法的具体用法?PHP Navigation::item_buttons怎么用?PHP Navigation::item_buttons使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Navigation
的用法示例。
在下文中一共展示了Navigation::item_buttons方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_checkout
/**
* Checkout item
* @return Response
*/
public function get_checkout($id = null)
{
if (!Auth::can('add_checkout')) {
Vsession::cadd('y', __('site.not_allowed'))->cflash('status');
return Redirect::to_action('item@list');
}
// Generating buttons
$this->item_buttons = Navigation::item_buttons()->add_item_button(array('icon' => 'icon-arrow-down', 'link' => 'item@checkin', 'text' => __('site.check_in_item')))->add_item_button(array('icon' => 'icon-arrow-up', 'link' => 'item@checkout', 'text' => __('site.check_out_item')))->get_item_buttons();
Asset::style('jquicss', 'app/assets/css/jquery-ui-1.10.2.custom.min.css', 'jquery');
Asset::script('jquijs', 'app/assets/js/jquery-ui-1.10.2.custom.js', 'jquery');
Asset::script('datepicker', 'app/assets/js/jquery.ui.datepicker-' . Config::get('application.language') . '.js', 'jquery');
if ($id != null) {
$id = trim(filter_var($id, FILTER_SANITIZE_NUMBER_INT));
$item = $this->fetch_item('id', $id);
} else {
$item = null;
}
return View::make('layout.index')->nest('header', 'layout.blocks.header', array('submenu' => $this->submenu))->nest('main', 'item.checkout', array('item' => $item, 'status' => $this->status, 'item_buttons' => $this->item_buttons));
}
示例2: get_edit
/**
* Add contact page
* @return Response
*/
public function get_edit($id = null)
{
if (!Auth::can('edit_contacts')) {
Vsession::cadd('y', __('site.not_allowed'))->cflash('status');
return Redirect::to_action('contacts@list');
}
if ($id !== null) {
$id = trim(filter_var($id, FILTER_SANITIZE_NUMBER_INT));
} else {
Redirect::to_action('contact@list');
}
if (null === ($contact = $this->fetch_contact($id))) {
return Redirect::to_action('contact@list');
}
// Generating buttons
$this->item_buttons = Navigation::item_buttons()->reset_item_buttons()->add_item_button(array('icon' => 'icon-minus-sign icon-white', 'link' => 'contact@delete/' . $id, 'text' => __('site.delete_contact'), 'class' => 'btn-danger delete'))->get_item_buttons();
return View::make('layout.index')->nest('header', 'layout.blocks.header', array('submenu' => $this->submenu))->nest('main', 'contact.edit', array('contact' => $contact, 'status' => $this->status, 'item_buttons' => $this->item_buttons));
}
示例3: delete_button
/**
* Make delete button for Item if ID set
*
* @param int $id Item ID
* @return string Button markup
*/
private function delete_button($id)
{
if (!is_null($id)) {
// Generating buttons
return Navigation::item_buttons()->add_item_button(array('icon' => 'icon-minus-sign icon-white', 'link' => 'item@delete/' . $id, 'text' => __('site.delete_item'), 'class' => 'btn-danger delete'))->get_item_buttons();
}
}
示例4: reset_item_buttons
public function reset_item_buttons()
{
self::$item_buttons = array();
return self::factory();
}
示例5: get_edit
/**
* Edit user
* @return Response
*/
public function get_edit($id = null, $user = null)
{
if (!Auth::can('edit_users')) {
if (!Auth::can('edit_self') || Auth::user()->id !== (int) $id) {
Vsession::cadd('y', __('site.not_allowed'))->cflash('status');
return Redirect::to_action('site@status');
}
}
// Input ID
if ($id == null || !$this->user_exists($id, 'users')) {
return Redirect::to_action('user@list');
}
$id = trim(filter_var($id, FILTER_SANITIZE_NUMBER_INT));
if (is_null($user)) {
$user = $this->fetch_user($id);
$user = $user[0];
}
// Generating buttons
$this->item_buttons = Navigation::item_buttons()->add_item_button(array('icon' => 'icon-minus-sign icon-white', 'link' => 'user@delete/' . $id, 'text' => __('site.delete_user'), 'class' => 'btn-danger delete'))->get_item_buttons();
return View::make('layout.index')->nest('header', 'layout.blocks.header', array('submenu' => $this->submenu))->nest('main', 'user.edit', array('user' => $user, 'roles' => $this->list_roles(), 'item_buttons' => $this->item_buttons));
}