public function __construct(Setting $settings = null, Portfolio $portfolio = null, Filesystem $filesystem = null) { $this->settings = $settings == null ? Setting::first() : $settings; $this->portfolio = $portfolio == null ? Portfolio::all() : $portfolio; $this->filesystem = $filesystem == null ? new Filesystem() : $filesystem; \View::share('settings', $this->settings); }
public function vistaListado() { $items_borrados = Item::where('estado', 'B')->lists('id'); if (count($items_borrados) > 0) { $portfolios = Portfolio::whereNotIn('item_id', $items_borrados)->get(); } else { $portfolios = Portfolio::all(); } $categorias = Categoria::where('estado', 'A')->get(); $secciones = Seccion::where('estado', 'A')->get(); $this->array_view['portfolios'] = $portfolios; $this->array_view['categorias'] = $categorias; $this->array_view['secciones'] = $secciones; //Hace que se muestre el html lista.blade.php de la carpeta item //con los parametros pasados por el array return View::make($this->folder_name . '.lista', $this->array_view); }
/** * Display the component. * * @return string */ function display() { if (!Portfolio::is_enabled()) { return ''; } $id = $this->id; $tool = $this->tool; $attributes = $this->attributes; $attributes['z-index'] = 100000; $s = ' '; foreach ($attributes as $key => $value) { $s .= $key . '="' . $value . '" '; } $result = array(); $result[] = '<span ' . $s . ' >'; $result[] = '<span class="dropdown" >'; $result[] = '<a href="#" data-toggle="dropdown" class="dropdown-toggle">'; $result[] = Display::return_icon('document_send.png', get_lang('Send'), array(), ICON_SIZE_SMALL) . '<b class="caret"></b>'; $result[] = '</a>'; $result[] = '<ul class="dropdown-menu">'; $portfolios = Portfolio::all(); foreach ($portfolios as $portfolio) { $parameters = Uri::course_params(); $parameters[PortfolioController::PARAM_ACTION] = PortfolioController::ACTION_SHARE; $parameters[PortfolioController::PARAM_CONTROLLER] = PortfolioController::NAME; $parameters[PortfolioController::PARAM_PORTFOLIO] = $portfolio->get_name(); $parameters[PortfolioController::PARAM_SECURITY_TOKEN] = self::security_token(); $parameters[PortfolioController::PARAM_TOOL] = $this->get_tool(); $parameters[PortfolioController::PARAM_ID] = $id; $parameters[PortfolioController::PARAM_TOOL] = $tool; $url = Chamilo::url('/main/portfolio/share.php', $parameters); $result[] = '<li>'; $result[] = '<a href="' . $url . '">' . $portfolio->get_title() . '</a>'; $result[] = '</li>'; } $result[] = '</ul>'; $result[] = '</span>'; $result[] = '</span>'; return implode("\n", $result); }
public function index() { return View::make("admin.{$this->name}.{$this->action}", ['items' => Portfolio::all(), 'name' => $this->name, 'action' => $this->action]); }