public static function loadAdminBar() { $auth = \Current_User::getAuthorization(); $nav_vars['is_deity'] = \Current_user::isDeity(); $nav_vars['logout_uri'] = $auth->logout_link; $nav_vars['username'] = \Current_User::getDisplayName(); if (\Current_User::allow('systemsinventory', 'edit')) { $nav_vars['add'] = '<a href="systemsinventory/system/add"><i class="fa fa-plus"></i> Add System</a>'; } if (\Current_User::allow('systemsinventory', 'view')) { $nav_vars['search'] = '<a href="systemsinventory/search"><i class="fa fa-search"></i> Search Systems</a>'; } if (\Current_User::allow('systemsinventory', 'reports')) { $nav_vars['reports'] = '<a href="systemsinventory/reports"><i class="fa fa-area-chart"></i> Reports</a>'; } if (\Current_User::allow('systemsinventory', 'settings')) { $nav_vars['settings'] = '<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"><i class="fa fa-cog"></i> Settings</a>'; } $nav_bar = new \Template($nav_vars); $nav_bar->setModuleTemplate('systemsinventory', 'navbar.html'); $content = $nav_bar->get(); \Layout::plug($content, 'NAV_LINKS'); }
public function setCropeImage($img, $coords) { $newImage = str_replace('.', '_resize.', $img); $config = array('image_library' => 'gd2', 'source_image' => '.' . $img, 'new_image' => '.' . $newImage, 'width' => $coords['w'], 'height' => $coords['h'], 'maintain_ratio' => FALSE, 'x_axis' => $coords['x'], 'y_axis' => $coords['y']); $this->image_lib->initialize($config); if ($this->image_lib->crop()) { $this->users_model->saveCropImgForUser(Current_user::getIdUser(), $newImage); return '<img src="' . $newImage . '?' . time() . '" />'; } else { return FALSE; } }