public function detalhe_metas($pkusuarioAluno = 0) { $msg = null; $data = $this->getParametroVisao(); $data['page'] = 'home'; $data['tema'] != '' ? $this->load->setTheme($data['tema']) : ''; $data['msg'] = $msg; $data['abaAtiva'] = 27; $data['abaPage'] = 'detalhe_metas'; $data['alias'] = 'detalhe_metas'; //Trecho modificado para um melhor controle de acesso $tipoLogado = (int) $data["idTipoUsuario"]; $idUsuarioAluno = $data['idUsuarioAluno']; if ($tipoLogado == Kernel_Models_TiposUsuario::TIPO_ADMIN || $tipoLogado == Kernel_Models_TiposUsuario::TIPO_GESTOR || $tipoLogado == Kernel_Models_TiposUsuario::TIPO_COORDENADOR) { $idUsuarioAluno = (int) $pkusuarioAluno; //Apenas os tipos definidos acima pondem escolher alunos não logados $data['idUsuarioAluno'] = $idUsuarioAluno; //passando o aluno para a view if (!$idUsuarioAluno) { //Caso o código informado para o aluno seja inválido echo Javascript::alert("O aluno informado é inválido"); echo Javascript::shadowboxClose(); die(Javascript::history_back()); } } $data["mes"] = filter_input(INPUT_GET, "mes"); //Recebendo o mês via GET if (!isset($_GET['mes'])) { redirect(base_url() . 'metas/mtavan/detalhe_metas?mes=' . date('m')); } $mes = isset($_GET['mes']) ? $_GET['mes'] : date('m'); $SqlOlimpica = new SqlOlimpica(); $result = $SqlOlimpica->get_datas($data['idUsuarioAluno'], $mes, 2); // $result = $SqlOlimpica->get_datas($data['idTurmaAluno'], $mes, 2);//Antes estava sendo passado o código da truma, a página não estava funcionando adequadamente $data['total'] = count($result); $html = '<table>'; $html .= '<tr><th>Data</th><th style="width:40px;">Ordem</th><th style="width:70px;">Disciplina</th><th style="width:200px;">Professor</th><th>Conteúdo</th><th>Presença</th></tr>'; foreach ($result as $row) { $SqlOlimpica = new SqlOlimpica(); $result = $SqlOlimpica->get_aulas_calendario_aluno($data['idTurmaAluno'], $row['data_aula'], $data['idUsuarioAluno']); $aula = '<table>'; foreach ($result['registros'] as $item) { $aula .= '<tr> <td style="border-bottom: 0px; width: 40px;">Aula ' . $item['ordem'] . '</td> <td style="border-bottom: 0px; width: 70px;">' . Mestre::materia($item['materia']) . '</td> <td style="border-bottom: 0px; width: 200px;">' . $item['nome'] . '</td> <td style="border-bottom: 0px;">' . $item['conteudo'] . '</td> </tr>'; $ordem = 'Aula ' . $item['ordem']; $materia = Mestre::materia($item['materia']); $nome = $item['nome']; $presenca = $item['presenca'] != null ? '<div class="icon_ok"></div>' : ''; } $aula .= '</table>'; $html .= '<tr><td>' . View::converteDataBr($row['data_aula']) . '</td><td colspan="4">' . $aula . '</td><td style="padding-left: 31px;">' . $presenca . '</td></tr>'; } $html .= '</table>'; $data['html'] = $html; $this->load->view($this->load->getUrlTema(), $data); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $group = $this->groups->find($id); Javascript::put('groups', MemberGroup::all()); Javascript::put('form', $group); return view('backend.forums.membergroups.edit'); }
public function render() { if (!$this->_if) { return; } return parent::render(); }
/** * {@inheritDoc} * @param string $integrityCheck Informação para checagem de integridade do script remoto. * @param string $crossorigin Identificação do tipo de requisição crossorigin do script remoto. */ public function __construct(string $url, string $fallback = '', string $integrityCheck = '', string $crossorigin = 'anonymous') { parent::__construct('', false, false); $this->url = $url; $this->fallback = $fallback; $this->integrityCheck = $integrityCheck; $this->crossorigin = $crossorigin; }
/** * @return $this */ public function index() { // SEO Meta settings $this->seo_meta['page_title'] = trans('seo.back.dashboard.index'); $now = Carbon::now(); $pre_formatted_periods = []; // 7 last days $referrer_start = clone $now; $referrer_end = clone $now; $pre_formatted_periods['last_7_days'] = ['start_date' => $referrer_start->subDays(7)->startOfDay()->format('d/m/Y H:i'), 'end_date' => $referrer_end->subDays(1)->endOfDay()->format('d/m/Y H:i')]; // last week $referrer_start = clone $now; $referrer_end = clone $now; $pre_formatted_periods['last_complete_week'] = ['start_date' => $referrer_start->subWeek()->startOfWeek()->startOfDay()->format('d/m/Y H:i'), 'end_date' => $referrer_end->subWeek()->endOfWeek()->endOfDay()->format('d/m/Y H:i')]; // 30 last days $referrer_start = clone $now; $referrer_end = clone $now; $pre_formatted_periods['last_30_days'] = ['start_date' => $referrer_start->subDays(30)->startOfDay()->format('d/m/Y H:i'), 'end_date' => $referrer_end->subDays(1)->endOfDay()->format('d/m/Y H:i')]; // last month $referrer_start = clone $now; $referrer_end = clone $now; $pre_formatted_periods['last_complete_month'] = ['start_date' => $referrer_start->subMonth()->startOfMonth()->startOfDay()->format('d/m/Y H:i'), 'end_date' => $referrer_end->subMonth()->endOfMonth()->endOfDay()->format('d/m/Y H:i')]; // 90 last days $referrer_start = clone $now; $referrer_end = clone $now; $pre_formatted_periods['last_90_days'] = ['start_date' => $referrer_start->subDays(90)->startOfDay()->format('d/m/Y H:i'), 'end_date' => $referrer_end->subDays(1)->endOfDay()->format('d/m/Y H:i')]; // 3 last months $referrer_start = clone $now; $referrer_end = clone $now; $pre_formatted_periods['last_3_complete_months'] = ['start_date' => $referrer_start->subMonths(3)->startOfMonth()->startOfDay()->format('d/m/Y H:i'), 'end_date' => $referrer_end->subMonth()->endOfMonth()->endOfDay()->format('d/m/Y H:i')]; // 180 last days $referrer_start = clone $now; $referrer_end = clone $now; $pre_formatted_periods['last_180_days'] = ['start_date' => $referrer_start->subDays(180)->startOfDay()->format('d/m/Y H:i'), 'end_date' => $referrer_end->subDays(1)->endOfDay()->format('d/m/Y H:i')]; // 6 last months $referrer_start = clone $now; $referrer_end = clone $now; $pre_formatted_periods['last_6_complete_months'] = ['start_date' => $referrer_start->subMonths(6)->startOfMonth()->startOfDay()->format('d/m/Y H:i'), 'end_date' => $referrer_end->subMonth()->endOfMonth()->endOfDay()->format('d/m/Y H:i')]; // this year $referrer_start = clone $now; $referrer_end = clone $now; $pre_formatted_periods['this_year'] = ['start_date' => $referrer_start->startOfYear()->startOfDay()->format('d/m/Y H:i'), 'end_date' => $referrer_end->endOfDay()->format('d/m/Y H:i')]; // last year $referrer_start = clone $now; $referrer_end = clone $now; $pre_formatted_periods['last_year'] = ['start_date' => $referrer_start->subYear()->startOfYear()->startOfDay()->format('d/m/Y H:i'), 'end_date' => $referrer_end->subYear()->endOfYear()->endOfDay()->format('d/m/Y H:i')]; Javascript::put(['pre_formatted_periods' => $pre_formatted_periods, 'trans' => ['visitors' => trans('dashboard.statistics.label.visitors'), 'page_views' => trans('dashboard.statistics.label.page_views'), 'pages' => trans('dashboard.statistics.label.pages'), 'url' => trans('dashboard.statistics.label.url'), 'views' => trans('dashboard.statistics.label.views'), 'form_downloads' => trans('dashboard.statistics.label.form_downloads'), 'qr_code_scans' => trans('dashboard.statistics.label.qr_code_scans')]]); // prepare data for the view $data = ['seo_meta' => $this->seo_meta, 'pre_formatted_periods' => $pre_formatted_periods]; // return the view with data return view('pages.back.dashboard')->with($data); }
/** * Método que permite editar a conta selecionada * @param int $contaId */ public function editar($contaId = FALSE) { $id = (int) $contaId; $this->contas->setId($id); $conta = $this->contas->getObject(); if (!$id || !$conta) { echo Javascript::alert("A conta informada é inválida"); echo Javascript::history_back(); return; } // $acao = $this->load->model('public_acao'); $acao = new ModelBase("public.acao"); $this->setData('conta', $conta)->setData('acao', $acao->select("", array(), "", array('modulo')))->printView(); }
/** * Combo Load */ public function combo_load() { parent::combo_load(); if ($this->input->get('include_jquery') == 'y') { $this->output->set_output(file_get_contents(PATH_JQUERY . 'jquery.js') . "\n\n" . $this->output->get_output()); } $this->safecracker->load_channel_standalone(); if ($this->input->get('use_live_url') == 'y') { $this->output->append_output($this->safecracker->channel_standalone->_url_title_js() . "\n\n"); } $this->load->helper('smiley'); $this->output->append_output(($this->config->item('use_compressed_js') != 'n' ? str_replace(array("\n", "\t"), '', smiley_js('', '', FALSE)) : smiley_js('', '', FALSE)) . "\n\n"); $this->output->append_output(file_get_contents($this->js_path . 'saef.js')); $this->output->set_header('Content-Length: ' . strlen($this->output->get_output())); }
public function detalhe_olimpica($pkUsuarioAluno = 0) { $msg = null; $data = $this->getParametroVisao(); $data['page'] = 'home'; $data['tema'] != '' ? $this->load->setTheme($data['tema']) : ''; $data['msg'] = $msg; $data['abaAtiva'] = 19; $data['abaPage'] = 'detalhe_olimpica'; $data['alias'] = 'detalhe_olimpica'; $mes = isset($_GET['mes']) ? $_GET['mes'] : ''; //Trecho modificado para um melhor controle de acesso $tipoLogado = (int) $data["idTipoUsuario"]; $idUsuarioAluno = $data['idUsuarioAluno']; if ($tipoLogado == Kernel_Models_TiposUsuario::TIPO_ADMIN || $tipoLogado == Kernel_Models_TiposUsuario::TIPO_GESTOR || $tipoLogado == Kernel_Models_TiposUsuario::TIPO_COORDENADOR) { $idUsuarioAluno = (int) $pkUsuarioAluno; //Apenas os tipos definidos acima pondem escolher alunos não logados $data['idUsuarioAluno'] = $idUsuarioAluno; //passando o aluno para a view if (!$idUsuarioAluno) { //Caso o código informado para o aluno seja inválido echo Javascript::alert("O aluno informado é inválido"); echo Javascript::shadowboxClose(); die(Javascript::history_back()); } } $data["mes"] = filter_input(INPUT_GET, "mes"); //Recebendo o mês via GET $SqlOlimpica = new SqlOlimpica(); $result = $SqlOlimpica->get_datas($idUsuarioAluno, $mes, 1); $data['total'] = count($result); $html = '<table><tr><th>Data</th><th>Conteúdo</th><th>Disciplina</th><th>Presença<br/>/ Nota</th></tr>'; foreach ($result as $row) { $presenca = $row['presenca'] != null ? '<div class="icon_ok ml20"></div>' : ''; $presenca_final = $row['nota'] != '' ? '<div class="ml20"><strong>' . number_format($row['nota']) . '</strong></div>' : $presenca; $conteudo = $row['prova'] != '' ? '<strong>PROVA</strong>' : $row['conteudo']; $materia = explode(' - ', $row['turma_nome']); $html .= '<tr> <td>' . View::converteDataBr($row['data_aula']) . '</td> <td>' . $conteudo . '</td> <td>' . $materia[1] . '</td> <td>' . $presenca_final . '</td>'; } $html .= '</table>'; $data['html'] = $html; $this->load->view($this->load->getUrlTema(), $data); }
public function loadDemo() { $demo_code = <<<EOF \$js = new Javascript('check_all'); \$js->setType('button'); // button is default, may also use link or checkbox \$js->setCheckClass('fruits'); \$js2 = new Javascript('check_all'); \$js2->setType('link'); \$js2->setCheckClass('veggies'); EOF; $js = Javascript::factory('check_all'); $js->setType('button'); // button is default, may also use link or checkbox $js->setCheckClass('fruits'); $js2 = Javascript::factory('check_all'); $js2->setType('link'); $js2->setCheckClass('veggies'); $js->prepare(); $js2->prepare(); $demo1 = (string) $js; $demo2 = (string) $js2; $demo_example = <<<EOF <table cellpadding="6"><tr><td> <p><input type="checkbox" name="apple" class="fruits" value="1" /> Apple<br /> <input type="checkbox" name="banana" class="fruits" value="1" /> Banana<br /> <input type="checkbox" name="grape" class="fruits" value="1" /> Grape<br /> <input type="checkbox" name="melon" class="fruits" value="1" /> Melon<br /> <input type="checkbox" name="orange" class="fruits" value="1" /> Orange</p> {$demo1} </td> <td><p><input type="checkbox" name="carrot" class="veggies" value="1" /> Carrot<br /> <input type="checkbox" name="pepper" class="veggies" value="1" /> Pepper<br /> <input type="checkbox" name="lettuce" class="veggies" value="1" /> Lettuce<br /> <input type="checkbox" name="celery" class="veggies" value="1" /> Celery<br /> <input type="checkbox" name="cucumber" class="veggies" value="1" /> Cucumber</p> {$demo2} </td> </tr> </table> EOF; $this->prepare(); $this->setDemoCode($demo_code); $this->setDemoExample($demo_example); $this->setBodyScript(null); }
/** * Método que redireciona um dispositivo movel para outra página */ public function redirect_mobile() { $token = filter_input(INPUT_GET, "token"); $email = filter_input(INPUT_GET, "email"); $imei = filter_input(INPUT_GET, "imei"); $so = "generico"; $pagina = filter_input(INPUT_GET, 'pagina'); if (is_string($token) && Strings::validarUrl($pagina)) { $usuarioSistema = new Kernel_Models_Usuario(); if ($usuarioSistema->loginMobile($email, $token, $imei, $so)) { $destino = $pagina; } else { $destino = base_url() . "usuario/login_w"; } } else { $destino = base_url() . "usuario/login_w"; } die(Javascript::window_location($destino)); }
/** * Método que trabalha os dados para exibição dos indicadores dos professores * @param int $pkPesquisaCat O código da categoria da pesquisa * @param int $pkSerie O código da serie * @param int $pkTurma O código da turma */ public function indicadores($pkPesquisaCat, $pkSerie, $pkTurma) { $sqlPesquisa = new SqlPesquisa(); $pesquisaNome = $sqlPesquisa->get_pesquisa_nome((int) $pkPesquisaCat); if (!(int) $pkPesquisaCat || !(int) $pkSerie || !(int) $pkTurma || !count($pesquisaNome)) { echo Javascript::alert('Dados inválido. Os dados informados para a pesquisa são inválidos'); echo Javascript::shadowboxClose(); echo Javascript::history_back(); return; } $turma = new Kernel_Models_Turma(); // $fapRankingPesqTurmaInd = $this->load->model('fap_ranking_pesquisa_turma_indicador'); $fapRankingPesqTurmaInd = new ModelBase("fap.ranking_pesquisa_turma_indicador"); $rankingTurma = $fapRankingPesqTurmaInd->select('fk_pesquisa_cat=' . $pkPesquisaCat . ' and fk_turma=' . $pkTurma, array(), '', array('indicador'), array(), 0, 0, 0); $lsita = array(); $conteudo = $assiduidade = $disciplina = $envolvimento = array(); $arrayTipos = array('', 'Conteúdo', 'Assiduidade', 'Disciplina', 'Envolvimento'); while ($row = $rankingTurma->fetchObject()) { if (!isset($lsita[$row->fk_pes_questao_template][$row->fk_usuario_professor])) { $lsita[$row->fk_pes_questao_template][$row->fk_usuario_professor] = $row; } switch ($row->fk_pes_questao_template) { case 1: $conteudo[] = $row->indicador; break; case 2: $assiduidade[] = $row->indicador; break; case 3: $disciplina[] = $row->indicador; break; default: $envolvimento[] = $row->indicador; break; } } $conteudoMedia = Matematica::mediaAritimeticaArray($conteudo); $assiduidadeMedia = Matematica::mediaAritimeticaArray($assiduidade); $disciplinaMedia = Matematica::mediaAritimeticaArray($disciplina); $envolvimentoMedia = Matematica::mediaAritimeticaArray($envolvimento); $this->setData('sqlPesquisa', $sqlPesquisa)->setData('pkPesquisa', $pkPesquisaCat)->setData('pesquisaNome', $pesquisaNome)->setData('pkSerie', $pkSerie)->setData('pkTurma', $pkTurma)->setData('conteudoMedia', number_format($conteudoMedia, 1))->setData('conteudoConceito', View::bgConceito($conteudoMedia))->setData('assiduidadeMedia', number_format($assiduidadeMedia, 1))->setData('assiduidadeConceito', View::bgConceito($assiduidadeMedia))->setData('disciplinaMedia', number_format($disciplinaMedia, 1))->setData('disciplinaConceito', View::bgConceito($disciplinaMedia))->setData('envolvimentoMedia', number_format($envolvimentoMedia, 1))->setData('envolvimentoConceito', View::bgConceito($envolvimentoMedia))->setData('listaResumo', $lsita)->setData('arrayTipos', $arrayTipos)->setData('turma', $turma->getObject('pk_turma=' . (int) $pkTurma))->setData('pesquisaTurma', $sqlPesquisa->ranking_pesquisa_turma($pkPesquisaCat, $pkTurma, $this->getData('ano_letivo')))->setData('filtroTurmas', $sqlPesquisa->ranking_pesquisa_cat_fitro_turma($pkPesquisaCat, $pkSerie, $this->getData('ano_letivo')))->printView(); }
public static function arrayToJson($value) { $jsonValue = ''; foreach ($value as $key => $value) { if (is_object($value)) { $jsonValue .= self::withUnQuotedPattern($key, $value); } elseif (is_array($value)) { $value = array_keys($value) === range(0, count($value) - 1) ? json_encode($value) : self::arrayToJson($value); $jsonValue .= self::withUnQuotedPattern($key, $value); } elseif (is_bool($value)) { $jsonValue .= self::withUnQuotedPattern($key, Javascript::booleanValue($value)); } elseif (is_numeric($value)) { $jsonValue .= self::withUnQuotedPattern($key, $value); } else { $jsonValue .= self::withQuotedPattern($key, $value); } $jsonValue .= Javascript::ARGUMENT_SEPARATOR; } return Javascript::cleanSintax(sprintf(self::$PATTERN, $jsonValue)); }
/** * Método qeu gera um alerta e redireciona o usuário para a tela de lohin */ private function redirectToLogin() { //captura uri acessada pelo qrcode para reutilizar após o login $uriQrcode = $_SERVER['REQUEST_URI']; //explode a uri para capturar apenas a pk do anexo $explode = explode('/', $uriQrcode); if ($explode[3] == null) { //cria variavel de location associando a pk do anexo como parametro $location = base_url() . 'usuario/login_w'; echo Javascript::alert("Desculpe, você não esta logado ou não possue acesso a URL informada"); die(Javascript::window_location($location)); // header('location:' . base_url() . 'usuario/login_w/' .$uriQrcode); } else { //cria variavel de location associando a pk do anexo como parametro $location = base_url() . 'conteudos_extras_do_livro/' . $explode[3]; // echo Javascript::alert("Desculpe, você não esta logado ou não possue acesso a URL informada"); // die(Javascript::window_location($location)); // header('location:' . base_url() . 'usuario/login_w/' .$uriQrcode); } }
* these Appropriate Legal Notices must retain the display of the "Powered by * SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not * reasonably feasible for technical reasons, the Appropriate Legal Notices must * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". ********************************************************************************/ $_REQUEST['edit'] = 'true'; require_once 'include/SugarFolders/SugarFolders.php'; require_once 'include/templates/TemplateGroupChooser.php'; // GLOBALS global $mod_strings; global $app_strings; global $app_list_strings; global $current_user; $focus = new InboundEmail(); $focus->checkImap(); $javascript = new Javascript(); $email = new Email(); /* Start standard EditView setup logic */ $domMailBoxType = $app_list_strings['dom_mailbox_type']; if (isset($_REQUEST['record'])) { $GLOBALS['log']->debug("In InboundEmail edit view, about to retrieve record: " . $_REQUEST['record']); $result = $focus->retrieve($_REQUEST['record']); if ($result == null) { sugar_die($app_strings['ERROR_NO_RECORD']); } } else { if (!empty($_REQUEST['mailbox_type'])) { $focus->mailbox_type = $_REQUEST['mailbox_type']; } //Default to imap protocol for new accounts. $focus->protocol = 'imap';
function printJavascript() { $javascriptObj = new Javascript(); $javascript = $javascriptObj->getJavascrtipt(); foreach ($this->moduleManager->modules as $module) { $javascript .= $module->getJavascript(); } header("Cache-Control: public"); header("content-type: text/javascript"); echo $javascript; }
* * @package Monstra * @subpackage Plugins * @author Romanenko Sergey / Awilum * @copyright 2012-2014 Romanenko Sergey / Awilum * @version 1.0.0 * */ // Register plugin Plugin::register(__FILE__, __('Pages', 'pages'), __('Pages manager', 'pages'), '1.0.0', 'Awilum', 'http://monstra.org/', 'pages', 'box'); if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin', 'editor'))) { // Include Admin Plugin::Admin('pages', 'box'); } // Add Plugin Javascript Javascript::add('plugins/box/pages/js/pages.js', 'backend'); /** * Pages Class */ class Pages extends Frontend { /** * Current page data * * @var object */ public static $page = null; /** * Pages tables * * @var object
<meta property="og:title" content="Postal Urbana" /> <meta property="og:site_name" content="Postal Urbana"/> <meta property="og:url" content="http://www.postalurbana.com.ar" /> <meta property="og:description" content="Postal Urbana - Diseño gráfico, web, marketing digital y redes sociales. Mendoza, Argentina" /> <meta property="og:image"content="http://www.postalurbana.com.ar/fbbrand.png" /> </head> <body> <!--[if lt IE 8]> <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> <![endif]--> @yield('content') <script src="{{ asset('js/plugins.js') }}"></script> <?php foreach (Javascript::loadApplicationFiles('website') as $file): ?> <script type="text/javascript" src="<?php echo $file; ?>"></script> <?php endforeach; ?> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-67280682-1', 'auto'); ga('send', 'pageview'); </script> </body> </html>
* * @package Monstra * @subpackage Plugins * @author Romanenko Sergey / Awilum * @copyright 2012-2014 Romanenko Sergey / Awilum * @version 1.0.0 * */ // Register plugin Plugin::register(__FILE__, __('Menu', 'menu'), __('Menu manager', 'menu'), '1.0.0', 'Awilum', 'http://monstra.org/', null, 'box'); if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin'))) { // Include Admin Plugin::admin('menu', 'box'); } // Add Plugin Javascript Javascript::add('plugins/box/menu/js/menu.js', 'backend'); /** * Menu Class */ class Menu { /** * Get menu * * @param string $category Category name */ public static function get($category = '') { // Get menu table $menu = new Table('menu'); // Display view
/** * View the permissions page for the given board ID * * @param $id * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function viewPermissions($id) { $board = $this->boards->find($id); $defaultPermissions = $board->getDefaultPermissions()->toArray(); $groups = MemberGroup::all(); $groupsArray = array(); foreach ($groups as $group) { //dd($group->permissions()->Board($id)->first()); if ($groupPermission = $group->permissions()->Board($id)->first()) { $groupsArray[$group->name] = $groupPermission->toArray(); } else { $groupsArray[$group->name] = $group->permissions()->Board($id)->create(array_add($defaultPermissions, 'board_id', $id)); } } Javascript::put("board", $board); Javascript::put("permissions", $groupsArray); return view('backend.forums.boards.permissions'); }
/** * Método responsável pela exibição da mensagem. * OBS: O método esta incompleto pois não esta fazendo a busca correta para o destinatário especifico * @param int $mensagemId */ public function ver_mensagem($mensagemId = 0) { //Inicializando os objetos básicos $usrValidar = new Kernel_Models_ValidarUsuarios(); $agenda = new alunos_models_AgendaSemanal(); try { $usrValidar->getCoordenador(); $mensagem = $agenda->getMensagem((int) $mensagemId); die(stripslashes($mensagem->getConteudo())); } catch (Exception $exc) { echo Javascript::alert($exc->getMessage()); echo Javascript::shadowboxClose(); die(Javascript::history_back()); } }
<p class="description"></p> </div> <div class="col-md-6"> <a href="" target="_blank" class="btn green_btn preview_btn">Go to Site</a> </div> </div> </div> </div> </div> </div> </div> <?php echo Snippet::get('google-analytics'); Javascript::add('public/assets/js/vendor.js', 'frontend', 1); Javascript::add('public/assets/js/app.js', 'frontend', 2); Javascript::load(); /* <div class="loading"></div> <style rel="stylesheet"> .loading{ background: url('https://dl.dropbox.com/u/23834858/fotos/loading.gif') no-repeat center center rgba(51, 51, 51, 0.82); position: fixed; top: 0; left: 0; width: 100%; height: 100%; margin: 0 auto; display: block; z-index: 10000; } </style>
/** * Método que permite visualizar e editar uma categoria especifica * @param int $categoriaId O id da categoria no banco */ public function ver_categoria($categoriaId = 0) { //Inicializando o objeto básico $ouvidoria = new eqpedagogica_models_Ouvidoria(); //Verificando se a categria existe try { //Validando a categroia $categoria = $ouvidoria->getCategoriaBanco((int) $categoriaId); } catch (Exception $exc) { echo Javascript::alert($exc->getMessage()); die(Javascript::history_back()); } //fazendo a edição da categoria if ($_SERVER['REQUEST_METHOD'] == "POST") { try { //Recebendo os novos dados $categoriaNovoTitulo = filter_input(INPUT_POST, "categoria", FILTER_SANITIZE_MAGIC_QUOTES); //Editando a categoria $ouvidoria->editarCategoria($categoriaNovoTitulo); //Exibindo a mensagem de sucesso echo Javascript::alert("Categoria editada com sucesso"); //Redirecionando para a listagem die(Javascript::window_location($this->rotas->rotaById(924))); } catch (Exception $exc) { echo Javascript::alert($exc->getMessage()); die(Javascript::history_back()); } } //Passando so dados para o view $this->setData("categoria", $categoria)->printView(); }
public function cadastrar_parecer() { try { $idSerieAluno = (int) $this->getData("idSerieAluno"); } catch (Exception $exc) { echo Javascript::alert($exc->getMessage()); echo Javascript::shadowboxClose(); die(Javascript::history_back()); } //Inicializando os objetos básicos da página $sqlPareceres = new SqlPareceres(); if ($_SERVER['REQUEST_METHOD'] == "POST") { try { // View::validarFormAntInjection($data['alias']); $sqlPareceres->reset_respostas_usuario($this->input->post('pk_pes_pesquisa'), $this->input->post('pk_usuario')); $result = $sqlPareceres->get_questoes($this->input->post('pk_pes_pesquisa')); $i = 0; foreach ($result as $item) { $i++; if ($item['tipo_questao'] == 1 || $item['tipo_questao'] == 2) { $divide = explode('#', $this->input->post('alternativa_' . $i)); $pk_pes_questao = $divide[0]; $pk_pes_alternativa = $divide[1]; $sqlPareceres->cadastrar_resposta($this->input->post('pk_pes_pesquisa'), $pk_pes_questao, $pk_pes_alternativa, $this->input->post('pk_unidade'), $this->input->post('pk_serie'), $this->input->post('pk_usuario'), $this->input->post('pk_tipo_usuario'), $item['tipo_questao']); } else { $resultAlternativas = $sqlPareceres->get_alternativas_pesquisa($item['pk_pes_questao']); $i2 = 0; foreach ($resultAlternativas as $alt) { $i2++; if ($item['tipo_questao'] == 3 || $item['tipo_questao'] == 4) { $divide = explode('#', $this->input->post('alternativa_' . $i . '_' . $i2)); $pk_pes_questao = $divide[0]; $pk_pes_alternativa = $divide[1]; $sqlPareceres->cadastrar_resposta($this->input->post('pk_pes_pesquisa'), $pk_pes_questao, $pk_pes_alternativa, $this->input->post('pk_unidade'), $this->input->post('pk_serie'), $this->input->post('pk_usuario'), $this->input->post('pk_tipo_usuario'), $item['tipo_questao'], $this->input->post('alternativa_' . $i . '_' . $i2 . '_valor')); } } } } unset($_SESSION['pesquisa']); $this->session->set_flashdata('msg', '<div class="alert ok">Obrigado por sua participação!</div>'); redirect(current_url()); return false; } catch (Exception $e) { $msg = '<p class="alert erro">' . $e->getMessage() . '</p>'; } } $result = $sqlPareceres->get_ultima_pesquisa($idSerieAluno); $pk_pes_pesquisa = $result[0]['pk_pes_pesquisa']; $html = ''; $resultQuestoes = $sqlPareceres->get_questoes($pk_pes_pesquisa); $i = 0; foreach ($resultQuestoes as $item) { $i++; $classe = $item['tipo_questao'] == 3 ? "div-ordenar" : "div-nota"; $html .= "<div class=\"passos\" data-questao=\"{$item['pes_questao']}\">"; $html .= "<p style=\"font-size:16px;\">{$item['pes_questao']}</p>"; $html .= "<div class=\"mb20 {$classe}\">"; $resultAlternativas = $sqlPareceres->get_alternativas_pesquisa($item['pk_pes_questao']); $i2 = 0; foreach ($resultAlternativas as $alt) { $i2++; //Tipo de ordenação $html .= "<div>"; if ($item['tipo_questao'] == 3) { // Questão para gerar ranking de prioridades $html .= "<input type=\"hidden\" name=\"alternativa_{$i}_{$i2}\" value=\"{$item['pk_pes_questao']}#{$alt['pk_pes_alternativa']}\" />"; $html .= "<select name=\"alternativa_{$i}_{$i2}_valor\" class=\"mr10\" /></select>"; } else { if ($item['tipo_questao'] == 4) { //Questão para gerar indicador a partir de notas dadas pelo usuário $html .= "<input class=\"item-preen\" type=\"hidden\" name=\"alternativa_{$i}_{$i2}\" " . "value=\"{$item['pk_pes_questao']}#{$alt['pk_pes_alternativa']}\" />"; $html .= '<select name="alternativa_' . $i . '_' . $i2 . '_valor" class="mr10" />' . '<option value=""></option>' . '<option value="1">1,0</option>' . '<option value="2">2,0</option>' . '<option value="3">3,0</option>' . '<option value="4">4,0</option>' . '<option value="5">5,0</option>' . '<option value="6">6,0</option>' . '<option value="7">7,0</option>' . '<option value="8">8,0</option>' . '<option value="9">9,0</option>' . '<option value="10">10,0</option>' . '</select>'; } else { $html .= '<input class=\\"item-preen\\" type="radio" name="alternativa_' . $i . '" value="' . $item['pk_pes_questao'] . '#' . $alt['pk_pes_alternativa'] . '" />'; } } $html .= $alt['pes_alternativa_nome']; $html .= "</div>"; } $html .= '</div>'; $html .= "<div class=\"passos-btn\">"; if ($i > 1) { $html .= "<button class=\"submit btn-voltar\" form=\"\">VOLTAR</button>"; } if (count($resultQuestoes) == $i) { $html .= "<button type=\"submit\" name=\"cadastrar\" form=\"\" class=\"submit btn-cadastrar\">Incluir<?button>"; } else { $html .= "<button class=\"submit btn-proximo\" form=\"\" >PRÓXIMO</button>"; } $html .= '</div>'; $html .= '</div>'; } $html .= '<br />'; //Passadno so dados para o view e carregando os plugins exigidos pela página $this->automSelectMenu()->setData("html", $html)->setData("pk_pes_pesquisa", $pk_pes_pesquisa)->printView(); }
public function init() { Javascript::requireLibrary('openlayers'); }
* * @package Monstra * @subpackage Plugins * @author cmroanirgo * @copyright 2016 cmroanirgo / kodespace.com * @version 1.0.0 * */ // Register plugin Plugin::register(__FILE__, __('Slider', 'slider'), __('Slider manager', 'slider'), '1.0.0', 'kodespace', 'http://kodespace.com/'); if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin'))) { // Include Admin Plugin::admin('slider'); } // Add Plugin Javascript Javascript::add('plugins/slider/js/slider.js', 'backend'); // Add shortcode {snippet} Shortcode::add('slider', 'Slider::_get'); /** * Slider Class */ class Slider { /** * Get slider * * @param string $category Category name */ public static function get($category = '') { if ($category == 'default') {
/** * Themes plugin admin */ public static function main() { // Get current themes $current_site_theme = Option::get('theme_site_name'); $current_admin_theme = Option::get('theme_admin_name'); // Init vars $themes_site = Themes::getSiteThemes(); $themes_admin = Themes::getAdminThemes(); $templates = Themes::getTemplates(); $chunks = Themes::getChunks(); $styles = Themes::getStyles(); $scripts = Themes::getScripts(); $errors = array(); $chunk_path = THEMES_SITE . DS . $current_site_theme . DS; $template_path = THEMES_SITE . DS . $current_site_theme . DS; $style_path = THEMES_SITE . DS . $current_site_theme . DS . 'css' . DS; $script_path = THEMES_SITE . DS . $current_site_theme . DS . 'js' . DS; // Save site theme if (Request::post('save_site_theme')) { if (Security::check(Request::post('csrf'))) { Option::update('theme_site_name', Request::post('themes')); // Clean Monstra TMP folder. Monstra::cleanTmp(); // Increment Styles and Javascript version Stylesheet::stylesVersionIncrement(); Javascript::javascriptVersionIncrement(); Request::redirect('index.php?id=themes'); } else { die('Request was denied because it contained an invalid security token. Please refresh the page and try again.'); } } // Save site theme if (Request::post('save_admin_theme')) { if (Security::check(Request::post('csrf'))) { Option::update('theme_admin_name', Request::post('themes')); // Clean Monstra TMP folder. Monstra::cleanTmp(); Request::redirect('index.php?id=themes'); } else { die('Request was denied because it contained an invalid security token. Please refresh the page and try again.'); } } // Its mean that you can add your own actions for this plugin Action::run('admin_themes_extra_actions'); // Check for get actions // ------------------------------------- if (Request::get('action')) { // Switch actions // ------------------------------------- switch (Request::get('action')) { // Add chunk // ------------------------------------- case "add_chunk": if (Request::post('add_file') || Request::post('add_file_and_exit')) { if (Security::check(Request::post('csrf'))) { if (trim(Request::post('name')) == '') { $errors['file_empty_name'] = __('Required field', 'themes'); } if (file_exists($chunk_path . Security::safeName(Request::post('name'), null, false) . '.chunk.php')) { $errors['file_exists'] = __('This chunk already exists', 'themes'); } if (count($errors) == 0) { // Save chunk File::setContent($chunk_path . Security::safeName(Request::post('name'), null, false) . '.chunk.php', Request::post('content')); Notification::set('success', __('Your changes to the chunk <i>:name</i> have been saved.', 'themes', array(':name' => Security::safeName(Request::post('name'), null, false)))); if (Request::post('add_file_and_exit')) { Request::redirect('index.php?id=themes'); } else { Request::redirect('index.php?id=themes&action=edit_chunk&filename=' . Security::safeName(Request::post('name'), null, false)); } } } else { die('Request was denied because it contained an invalid security token. Please refresh the page and try again.'); } } // Save fields if (Request::post('name')) { $name = Request::post('name'); } else { $name = ''; } if (Request::post('content')) { $content = Request::post('content'); } else { $content = ''; } // Display view View::factory('box/themes/views/backend/add')->assign('name', $name)->assign('content', $content)->assign('errors', $errors)->assign('action', 'chunk')->display(); break; // Add template // ------------------------------------- // Add template // ------------------------------------- case "add_template": if (Request::post('add_file') || Request::post('add_file_and_exit')) { if (Security::check(Request::post('csrf'))) { if (trim(Request::post('name')) == '') { $errors['file_empty_name'] = __('Required field', 'themes'); } if (file_exists($template_path . Security::safeName(Request::post('name'), null, false) . '.template.php')) { $errors['file_exists'] = __('This template already exists', 'themes'); } if (count($errors) == 0) { // Save chunk File::setContent($template_path . Security::safeName(Request::post('name'), null, false) . '.template.php', Request::post('content')); Notification::set('success', __('Your changes to the chunk <i>:name</i> have been saved.', 'themes', array(':name' => Security::safeName(Request::post('name'), null, false)))); if (Request::post('add_file_and_exit')) { Request::redirect('index.php?id=themes'); } else { Request::redirect('index.php?id=themes&action=edit_template&filename=' . Security::safeName(Request::post('name'), null, false)); } } } else { die('Request was denied because it contained an invalid security token. Please refresh the page and try again.'); } } // Save fields if (Request::post('name')) { $name = Request::post('name'); } else { $name = ''; } if (Request::post('content')) { $content = Request::post('content'); } else { $content = ''; } // Display view View::factory('box/themes/views/backend/add')->assign('name', $name)->assign('content', $content)->assign('errors', $errors)->assign('action', 'template')->display(); break; // Add styles // ------------------------------------- // Add styles // ------------------------------------- case "add_styles": if (Request::post('add_file') || Request::post('add_file_and_exit')) { if (Security::check(Request::post('csrf'))) { if (trim(Request::post('name')) == '') { $errors['file_empty_name'] = __('Required field', 'themes'); } if (file_exists($style_path . Security::safeName(Request::post('name'), null, false) . '.css')) { $errors['file_exists'] = __('This styles already exists', 'themes'); } if (count($errors) == 0) { // Save chunk File::setContent($style_path . Security::safeName(Request::post('name'), null, false) . '.css', Request::post('content')); Notification::set('success', __('Your changes to the styles <i>:name</i> have been saved.', 'themes', array(':name' => Security::safeName(Request::post('name'), null, false)))); // Clean Monstra TMP folder. Monstra::cleanTmp(); // Increment Styles version Stylesheet::stylesVersionIncrement(); if (Request::post('add_file_and_exit')) { Request::redirect('index.php?id=themes'); } else { Request::redirect('index.php?id=themes&action=edit_styles&filename=' . Security::safeName(Request::post('name'), null, false)); } } } else { die('Request was denied because it contained an invalid security token. Please refresh the page and try again.'); } } // Save fields if (Request::post('name')) { $name = Request::post('name'); } else { $name = ''; } if (Request::post('content')) { $content = Request::post('content'); } else { $content = ''; } // Display view View::factory('box/themes/views/backend/add')->assign('name', $name)->assign('content', $content)->assign('errors', $errors)->assign('action', 'styles')->display(); break; // Add script // ------------------------------------- // Add script // ------------------------------------- case "add_script": if (Request::post('add_file') || Request::post('add_file_and_exit')) { if (Security::check(Request::post('csrf'))) { if (trim(Request::post('name')) == '') { $errors['file_empty_name'] = __('Required field', 'themes'); } if (file_exists($script_path . Security::safeName(Request::post('name'), null, false) . '.js')) { $errors['file_exists'] = __('This script already exists', 'themes'); } if (count($errors) == 0) { // Save chunk File::setContent($script_path . Security::safeName(Request::post('name'), null, false) . '.js', Request::post('content')); Notification::set('success', __('Your changes to the script <i>:name</i> have been saved.', 'themes', array(':name' => Security::safeName(Request::post('name'), null, false)))); // Clean Monstra TMP folder. Monstra::cleanTmp(); // Increment Javascript version Javascript::javascriptVersionIncrement(); if (Request::post('add_file_and_exit')) { Request::redirect('index.php?id=themes'); } else { Request::redirect('index.php?id=themes&action=edit_script&filename=' . Security::safeName(Request::post('name'), null, false)); } } } else { die('Request was denied because it contained an invalid security token. Please refresh the page and try again.'); } } // Save fields if (Request::post('name')) { $name = Request::post('name'); } else { $name = ''; } if (Request::post('content')) { $content = Request::post('content'); } else { $content = ''; } // Display view View::factory('box/themes/views/backend/add')->assign('name', $name)->assign('content', $content)->assign('errors', $errors)->assign('action', 'script')->display(); break; // Edit chunk // ------------------------------------- // Edit chunk // ------------------------------------- case "edit_chunk": // Save current chunk action if (Request::post('edit_file') || Request::post('edit_file_and_exit')) { if (Security::check(Request::post('csrf'))) { if (trim(Request::post('name')) == '') { $errors['file_empty_name'] = __('Required field', 'themes'); } if (file_exists($chunk_path . Security::safeName(Request::post('name'), null, false) . '.chunk.php') and Security::safeName(Request::post('chunk_old_name'), null, false) !== Security::safeName(Request::post('name'), null, false)) { $errors['file_exists'] = __('This chunk already exists', 'themes'); } // Save fields if (Request::post('content')) { $content = Request::post('content'); } else { $content = ''; } if (count($errors) == 0) { $chunk_old_filename = $chunk_path . Request::post('chunk_old_name') . '.chunk.php'; $chunk_new_filename = $chunk_path . Security::safeName(Request::post('name'), null, false) . '.chunk.php'; if (!empty($chunk_old_filename)) { if ($chunk_old_filename !== $chunk_new_filename) { rename($chunk_old_filename, $chunk_new_filename); $save_filename = $chunk_new_filename; } else { $save_filename = $chunk_new_filename; } } else { $save_filename = $chunk_new_filename; } // Save chunk File::setContent($save_filename, Request::post('content')); Notification::set('success', __('Your changes to the chunk <i>:name</i> have been saved.', 'themes', array(':name' => basename($save_filename, '.chunk.php')))); if (Request::post('edit_file_and_exit')) { Request::redirect('index.php?id=themes'); } else { Request::redirect('index.php?id=themes&action=edit_chunk&filename=' . Security::safeName(Request::post('name'), null, false)); } } } else { die('Request was denied because it contained an invalid security token. Please refresh the page and try again.'); } } if (Request::post('name')) { $name = Request::post('name'); } else { $name = File::name(Request::get('filename')); } $content = File::getContent($chunk_path . Request::get('filename') . '.chunk.php'); // Display view View::factory('box/themes/views/backend/edit')->assign('content', $content)->assign('name', $name)->assign('errors', $errors)->assign('action', 'chunk')->display(); break; // Edit Template // ------------------------------------- // Edit Template // ------------------------------------- case "edit_template": // Save current chunk action if (Request::post('edit_file') || Request::post('edit_file_and_exit')) { if (Security::check(Request::post('csrf'))) { if (trim(Request::post('name')) == '') { $errors['file_empty_name'] = __('Required field', 'themes'); } if (file_exists($template_path . Security::safeName(Request::post('name'), null, false) . '.template.php') and Security::safeName(Request::post('template_old_name'), null, false) !== Security::safeName(Request::post('name'), null, false)) { $errors['template_exists'] = __('This template already exists', 'themes'); } // Save fields if (Request::post('content')) { $content = Request::post('content'); } else { $content = ''; } if (count($errors) == 0) { $template_old_filename = $template_path . Request::post('template_old_name') . '.template.php'; $template_new_filename = $template_path . Security::safeName(Request::post('name'), null, false) . '.template.php'; if (!empty($template_old_filename)) { if ($template_old_filename !== $template_new_filename) { rename($template_old_filename, $template_new_filename); $save_filename = $template_new_filename; } else { $save_filename = $template_new_filename; } } else { $save_filename = $template_new_filename; } // Save chunk File::setContent($save_filename, Request::post('content')); Notification::set('success', __('Your changes to the template <i>:name</i> have been saved.', 'themes', array(':name' => basename($save_filename, '.template.php')))); if (Request::post('edit_file_and_exit')) { Request::redirect('index.php?id=themes'); } else { Request::redirect('index.php?id=themes&action=edit_template&filename=' . Security::safeName(Request::post('name'), null, false)); } } } else { die('Request was denied because it contained an invalid security token. Please refresh the page and try again.'); } } if (Request::post('name')) { $name = Request::post('name'); } else { $name = File::name(Request::get('filename')); } $content = File::getContent($chunk_path . Request::get('filename') . '.template.php'); // Display view View::factory('box/themes/views/backend/edit')->assign('content', $content)->assign('name', $name)->assign('errors', $errors)->assign('action', 'template')->display(); break; // Edit Styles // ------------------------------------- // Edit Styles // ------------------------------------- case "edit_styles": // Save current chunk action if (Request::post('edit_file') || Request::post('edit_file_and_exit')) { if (Security::check(Request::post('csrf'))) { if (trim(Request::post('name')) == '') { $errors['file_empty_name'] = __('Required field', 'themes'); } if (file_exists($style_path . Security::safeName(Request::post('name'), null, false) . '.css') and Security::safeName(Request::post('styles_old_name'), null, false) !== Security::safeName(Request::post('name'), null, false)) { $errors['file_exists'] = __('This styles already exists', 'themes'); } // Save fields if (Request::post('content')) { $content = Request::post('content'); } else { $content = ''; } if (count($errors) == 0) { $styles_old_filename = $style_path . Request::post('styles_old_name') . '.css'; $styles_new_filename = $style_path . Security::safeName(Request::post('name'), null, false) . '.css'; if (!empty($styles_old_filename)) { if ($styles_old_filename !== $styles_new_filename) { rename($styles_old_filename, $styles_new_filename); $save_filename = $styles_new_filename; } else { $save_filename = $styles_new_filename; } } else { $save_filename = $styles_new_filename; } // Save chunk File::setContent($save_filename, Request::post('content')); Notification::set('success', __('Your changes to the styles <i>:name</i> have been saved.', 'themes', array(':name' => basename($save_filename, '.css')))); // Clean Monstra TMP folder. Monstra::cleanTmp(); // Increment Styles version Stylesheet::stylesVersionIncrement(); if (Request::post('edit_file_and_exit')) { Request::redirect('index.php?id=themes'); } else { Request::redirect('index.php?id=themes&action=edit_styles&filename=' . Security::safeName(Request::post('name'), null, false)); } } } else { die('Request was denied because it contained an invalid security token. Please refresh the page and try again.'); } } if (Request::post('name')) { $name = Request::post('name'); } else { $name = File::name(Request::get('filename')); } $content = File::getContent($style_path . Request::get('filename') . '.css'); // Display view View::factory('box/themes/views/backend/edit')->assign('content', $content)->assign('name', $name)->assign('errors', $errors)->assign('action', 'styles')->display(); break; // Edit Script // ------------------------------------- // Edit Script // ------------------------------------- case "edit_script": // Save current chunk action if (Request::post('edit_file') || Request::post('edit_file_and_exit')) { if (Security::check(Request::post('csrf'))) { if (trim(Request::post('name')) == '') { $errors['file_empty_name'] = __('Required field', 'themes'); } if (file_exists($script_path . Security::safeName(Request::post('name'), null, false) . '.js') and Security::safeName(Request::post('script_old_name'), null, false) !== Security::safeName(Request::post('name'), null, false)) { $errors['file_exists'] = __('This script already exists', 'themes'); } // Save fields if (Request::post('content')) { $content = Request::post('content'); } else { $content = ''; } if (count($errors) == 0) { $script_old_filename = $script_path . Request::post('script_old_name') . '.js'; $script_new_filename = $script_path . Security::safeName(Request::post('name'), null, false) . '.js'; if (!empty($script_old_filename)) { if ($script_old_filename !== $script_new_filename) { rename($script_old_filename, $script_new_filename); $save_filename = $script_new_filename; } else { $save_filename = $script_new_filename; } } else { $save_filename = $script_new_filename; } // Save chunk File::setContent($save_filename, Request::post('content')); Notification::set('success', __('Your changes to the script <i>:name</i> have been saved.', 'themes', array(':name' => basename($save_filename, '.js')))); // Clean Monstra TMP folder. Monstra::cleanTmp(); // Increment Javascript version Javascript::javascriptVersionIncrement(); if (Request::post('edit_file_and_exit')) { Request::redirect('index.php?id=themes'); } else { Request::redirect('index.php?id=themes&action=edit_script&filename=' . Security::safeName(Request::post('name'), null, false)); } } } else { die('Request was denied because it contained an invalid security token. Please refresh the page and try again.'); } } if (Request::post('name')) { $name = Request::post('name'); } else { $name = File::name(Request::get('filename')); } $content = File::getContent($script_path . Request::get('filename') . '.js'); // Display view View::factory('box/themes/views/backend/edit')->assign('content', $content)->assign('name', $name)->assign('errors', $errors)->assign('action', 'script')->display(); break; // Delete chunk // ------------------------------------- // Delete chunk // ------------------------------------- case "delete_chunk": if (Security::check(Request::get('token'))) { File::delete($chunk_path . Request::get('filename') . '.chunk.php'); Notification::set('success', __('Chunk <i>:name</i> deleted', 'themes', array(':name' => File::name(Request::get('filename'))))); Request::redirect('index.php?id=themes'); } else { die('Request was denied because it contained an invalid security token. Please refresh the page and try again.'); } break; // Delete styles // ------------------------------------- // Delete styles // ------------------------------------- case "delete_styles": if (Security::check(Request::get('token'))) { File::delete($style_path . Request::get('filename') . '.css'); Notification::set('success', __('Styles <i>:name</i> deleted', 'themes', array(':name' => File::name(Request::get('filename'))))); // Clean Monstra TMP folder. Monstra::cleanTmp(); // Increment Styles version Stylesheet::stylesVersionIncrement(); Request::redirect('index.php?id=themes'); } else { die('Request was denied because it contained an invalid security token. Please refresh the page and try again.'); } break; // Delete script // ------------------------------------- // Delete script // ------------------------------------- case "delete_script": if (Security::check(Request::get('token'))) { File::delete($script_path . Request::get('filename') . '.js'); Notification::set('success', __('Script <i>:name</i> deleted', 'themes', array(':name' => File::name(Request::get('filename'))))); // Clean Monstra TMP folder. Monstra::cleanTmp(); // Increment Javascript version Javascript::javascriptVersionIncrement(); Request::redirect('index.php?id=themes'); } else { die('Request was denied because it contained an invalid security token. Please refresh the page and try again.'); } break; // Delete template // ------------------------------------- // Delete template // ------------------------------------- case "delete_template": if (Security::check(Request::get('token'))) { File::delete($template_path . Request::get('filename') . '.template.php'); Notification::set('success', __('Template <i>:name</i> deleted', 'themes', array(':name' => File::name(Request::get('filename'))))); Request::redirect('index.php?id=themes'); } break; // Clone styles // ------------------------------------- // Clone styles // ------------------------------------- case "clone_styles": if (Security::check(Request::get('token'))) { File::setContent(THEMES_SITE . DS . $current_site_theme . DS . 'css' . DS . Request::get('filename') . '_clone_' . date("Ymd_His") . '.css', File::getContent(THEMES_SITE . DS . $current_site_theme . DS . 'css' . DS . Request::get('filename') . '.css')); // Clean Monstra TMP folder. Monstra::cleanTmp(); // Increment Styles version Stylesheet::stylesVersionIncrement(); Request::redirect('index.php?id=themes'); } break; // Clone script // ------------------------------------- // Clone script // ------------------------------------- case "clone_script": if (Security::check(Request::get('token'))) { File::setContent(THEMES_SITE . DS . $current_site_theme . DS . 'js' . DS . Request::get('filename') . '_clone_' . date("Ymd_His") . '.js', File::getContent(THEMES_SITE . DS . $current_site_theme . DS . 'js' . DS . Request::get('filename') . '.js')); // Clean Monstra TMP folder. Monstra::cleanTmp(); // Increment Javascript version Javascript::javascriptVersionIncrement(); Request::redirect('index.php?id=themes'); } break; // Clone template // ------------------------------------- // Clone template // ------------------------------------- case "clone_template": if (Security::check(Request::get('token'))) { File::setContent(THEMES_SITE . DS . $current_site_theme . DS . Request::get('filename') . '_clone_' . date("Ymd_His") . '.template.php', File::getContent(THEMES_SITE . DS . $current_site_theme . DS . Request::get('filename') . '.template.php')); Request::redirect('index.php?id=themes'); } break; // Clone chunk // ------------------------------------- // Clone chunk // ------------------------------------- case "clone_chunk": if (Security::check(Request::get('token'))) { File::setContent(THEMES_SITE . DS . $current_site_theme . DS . Request::get('filename') . '_clone_' . date("Ymd_His") . '.chunk.php', File::getContent(THEMES_SITE . DS . $current_site_theme . DS . Request::get('filename') . '.chunk.php')); Request::redirect('index.php?id=themes'); } break; } } else { // Display view View::factory('box/themes/views/backend/index')->assign('themes_site', $themes_site)->assign('themes_admin', $themes_admin)->assign('templates', $templates)->assign('chunks', $chunks)->assign('styles', $styles)->assign('scripts', $scripts)->assign('current_site_theme', $current_site_theme)->assign('current_admin_theme', $current_admin_theme)->display(); } }
/** * Imports the elements of the form object into a template file and * returns the output * * @param string $template File location of template file * @return string */ public function printTemplate($template) { if (empty($this->id)) { $this->loadId(); } $value = $this->getInputStringArray(); if ($this->ajax_post) { $form_post = Javascript::factory('form_post'); $form_post->parseForm($this); } ob_start(); extract($value); include $template; $content = ob_get_contents(); ob_end_clean(); return $content; }
/** * Método qeu gera um alerta e redireciona o usuário para a tela de lohin */ private function redirectToLogin() { echo Javascript::alert("Desculpe, você não esta logado ou não possue acesso a URL informada"); die(Javascript::window_location(base_url("logout"))); }
/** * Método que faz a edição de um registro * @param int $registroCod O código de identificação do registro */ public function edit_registro($registroCod = FALSE) { $codRegistro = (int) $registroCod; if (!$codRegistro && !$this->getFiltros()->shadowbox) { echo Javascript::alert('O registro informado é inválido'); echo Javascript::close(); echo Javascript::shadowboxClose(); return; } $fapRegistro = new Kernel_Models_Fap(); $fapSubTipo = new Kernel_Models_Fap(); $registro = $fapRegistro->getObject('pk_fap_registro=' . $codRegistro); if (!$registro) { echo Javascript::alert('O registro informado é inválido'); echo Javascript::close(); echo Javascript::shadowboxClose(); return; } $this->setData('tiposRegistros', $fapSubTipo->selectAll("fap.fap_tipo.pk_fap_tipo < 7 " . "or fap.fap_tipo.pk_fap_tipo = 16 or fap.fap_tipo.pk_fap_tipo > 22"))->setData('registro', $registro)->setData('professor', $this->professores->selectUsuarioProfessor($registro->fk_usuario_professor)->fetchObject())->printView(); }
/** * Método que lista os ultimos itens vistos de acordo com os parametros informados * @param array $ids Um array contendo os ids das consultas de acordo com o arquivo de configurações * @param stdClass $parametros Um array contendo os parametros usados na busca * @return array Retorna uma array contendo como chave os ids informados e como valor atribuído a esta chave o ultimo registro de acordo com os parametros informados */ public function getUltimos(array $ids, array $parametros) { $this->setParametros($parametros)->definirParametros(); $where = "(consulta_id='" . implode("' or consulta_id='", $ids) . "') "; $where .= "and parametros='{$this->parametros}'"; $retorno = $this->select($where); if ($retorno) { while ($row = $retorno->fetchObject()) { $this->ultimosValores[$row->consulta_id] = $row->ult_valor; } } else { $this->createTebala(); die(Javascript::reload()); } return $this->ultimosValores; }