public function insertPermisoRol() { $submenu = new SubMenu(); foreach ($submenu->findAll() as $value) { $sql = "INSERT INTO " . $this->table . " (id_rol,id_submenu,id_menu) "; $sql .= "VALUES ('" . $this->id . "','" . $value['id'] . "','" . $value['id_menu'] . "')"; $stmt = DB::execute($sql); } }
protected function build(PageBody &$body, SubMenu &$submenu) { $submenu->addLink("Sign in", "#", TRUE); $submenu->addLink("Sign up", "#"); $submenu->addLink("Forget Password", "#"); $loginForm = new Form("login"); $loginForm->addInput(Input::textInput("email", "Enter your Email:")); $loginForm->addInput(Input::textInput("password", "Enter your Password:")); $body->addToCenter($loginForm); }
protected function build(PageBody &$body, SubMenu &$submenu) { $this->pageName = "Event List"; $submenu->addLink("Add new Event", "#"); $submenu->addLink("Show Event", "#"); $submenu->addLink("Edit", "#"); $submenu->addLink("Delete", "#"); // show a list of events on a table $events = Database::get("Event"); if (isset($events)) { $table = new HtmlTable(); $table->setHead(["#", "Name", "Info"]); foreach ($events as $id => $event) { $table->addRow([$id, '<a href="?page=Event&event=' . $id . '">' . $event->name . '</a>', $event->address]); } $body->addToCenter($table); } else { $body->addToCenter(new Message("There is no event to show", Message::INFO)); } }
function nav_html() { $permiso = new Permiso(); $menu = new Menu(); $submenu = new SubMenu(); $submenu->setOrder(" ORDER BY orden"); echo "\n\t<div class='nav-wrapper blue row'>\n \t<ul id='nav-mobile' class='side-nav left'>"; foreach ($menu->findAll() as $value) { if ($permiso->getPermisos($_SESSION['id_rol'], $value['id'])) { echo "<li><a class='dropdown-button' href='#!' data-activates='" . $value['ver'] . "'>" . $value['ver'] . "</a></li>"; echo "<ul id='" . $value['ver'] . "' class='dropdown-content'>"; foreach ($permiso->getPermisos($_SESSION['id_rol'], $value['id']) as $valueSub) { $m = $submenu->find($valueSub['id_submenu']); echo "<li><a class='blue-text' href='" . $m[0]['link'] . "'>" . $m[0]['ver'] . "</a></li>"; } echo "</ul>"; } } echo "\n </ul>\n <div class='opUsuario dropdown valign-wrapper right'>\n \tAdministrador<img src='img/yuna.jpg' alt='' class='circle responsive-img right' style='height:2.5rem; margin-top:1em;margin-left:1rem;'></div>\n\t</div>"; }
protected function build(PageBody &$body, SubMenu &$submenu) { $form = new Form("Test"); //$form->addInput("list1", "list", "Exsample List:", ["1", "2", "3"]); $form->addInput(Input::textInput("input1", "Enter your name: ")); $form->addInput(Input::selectInput("list1", "Example List:", ["A", "B", "C"])); //$form->addInput(Input::dateInput("date", "choose a date: ")); $left = new CustomHTML(' <div class="list-group"> <a href="#" class="list-group-item active">Home</a> <a href="#" class="list-group-item">Profile</a> <a href="#" class="list-group-item">Messages</a> </div>'); $submenu->addLink("Home", "?page=home"); $submenu->addLink("Login", "?page=login"); $submenu->addLink("Top", "#top"); $submenu->addLink("Down", "#down"); $right = new CustomHTML(' <div class="panel panel-default"> <div class="panel-heading">Panel heading without title</div> <div class="panel-body"> Panel content </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Panel title</h3> </div> <div class="panel-body"> Panel content </div> </div>'); $body->addToLeft($left); $body->addToRight($right); $body->addToCenter($form); $body->addToTop(new Message("This is a test page", Message::INFO)); if (isset($_POST['list1'])) { $body->addToTop(new Message("the value of list1=" . $_POST['list1'], Message::SUCCESS)); } }
// Copyright 2008-2010 SQLFusion LLC info@sqlfusion.com /**COPYRIGHTS**/ /* * Marketing configuration * This is a configuration file for the Marketing plugin. * It loads class and sets hooks * * @package EmailMarketing * @author Philippe Lewicki <*****@*****.**> * @license ##License## * @version 0.1 * @date 2010-11-08 */ $cfg_plugin_expense_uri = "/Tab/Expense/"; $cfg_plugin_expense_path = "plugin/Expense/"; define('OFUZ_LOG_PLUGIN_EXPENSE', true); // Classes include_once $cfg_plugin_expense_path . "class/Expense.class.php"; include_once $cfg_plugin_expense_path . "class/ExpenseImport.class.php"; include_once $cfg_plugin_expense_path . "class/BlockTmpExpenseMenu.class.php"; // Hook for the block object $GLOBALS['cfg_block_placement']['All'][] = "BlockTmpExpenseMenu"; // $GLOBALS['cfg_block_placement']['WebForm'][] = "BlockWebFormList"; // $GLOBALS['cfg_block_placement']['MEmailTemplate'][] = "BlockEmailTemplateList"; $plugin_expense_menu = new SubMenu(); $plugin_expense_menu->addMenuItem("All", $cfg_plugin_expense_uri . "All")->addMenuItem("Add New Expense", $cfg_plugin_expense_uri . "Add")->addMenuItem("Import", "/Tab/Expense/Import")->addMenuItem("Profit & Loss", "/Tab/Expense/ProfitAndLoss"); // Hook to display the Tab (they are real page just without the .php) $GLOBALS['cfg_tab_placement']->append(new Tab("Expense")); $GLOBALS['cfg_tab_placement']->next(); $GLOBALS['cfg_tab_placement']->current()->setTabName("Expenses")->setMessage("welcome_expenses")->setPages(array("All", "Add", "Import", "ImportManual"))->setMenu($plugin_expense_menu)->setDefaultPage("All");
<? require_once './view/html.php'; $menu = new Menu(); $submenu = new SubMenu(); $permiso = new Permiso(); $submenu->setOrder(" ORDER BY orden"); if ($_GET['op']=='insert') { $submenu->setIdMenu($_POST['id_menu']); $submenu->setVer($_POST['ver']); $submenu->setLink($_POST['link']); $submenu->insert(); $id_menu=$submenu->findLast(); $permiso->setId($id_menu[0]['id']); $permiso->setIdMenu($id_menu[0]['id_menu']); $permiso->insertPermisoMenu(); } if ($_GET['op']=='delete') { $submenu->delete($_GET['id']); $permiso->deletePermisoMenu($_GET['id']); } $m = $menu->find($_GET['id']); ?> <!DOCTYPE html> <html> <head> <?php
<?php /** * * @author Francisco Yure Pereira de Araujo <*****@*****.**> * @since 2014-04-21 * */ require_once 'IComponentMenu.class.php'; require_once 'Menu.class.php'; require_once 'SubMenu.class.php'; require_once 'Item.class.php'; $menu = new Menu(); $subMenu = new SubMenu(); $subMenu2 = new SubMenu(); $item1 = new Item('#link-item1', 'Item 1'); $item2 = new Item('#link-item2', 'Item 2'); $item3 = new Item('#link-item3', 'Item 3'); $item4 = new Item('#link-item4', 'Item 4'); $menu->addChild($item1); $menu->addChild($item2); $menu->addChild($item3); $menu->addChild($item4); $subMenu2->addChild($item1); $subMenu2->addChild($item2); $subMenu2->addChild($item3); $subMenu2->addChild($item4); $subMenu->addChild($item1); $subMenu->addChild($item2); $subMenu->addChild($subMenu2); $subMenu->addChild($item3);
protected function build(PageBody &$body, SubMenu &$submenu) { //var_dump($_SESSION['db']); $subPage = isset($_GET['subpage']) ? $_GET['subpage'] : ''; if (isset($_GET['event'])) { $this->event = Database::getRow('Event', $_GET['event']); $this->event->id = $_GET['event']; // for testing $this->pageName = $this->event->name; //var_dump($this->event); } if ($this->event == null) { $body->addToTop(new Message("No Event", Message::DANGER)); } $submenu->addLink("Event Details", "?page=Event&event=" . $this->event->id, $subPage == ''); $submenu->addLink("Update Event", "?page=Event&event=" . $this->event->id . "&subpage=update", $subPage == 'update'); $submenu->addSplitter(); $submenu->addLink("Send Email Invitation", "?page=Event&event=" . $this->event->id . "&subpage=send", $subPage == 'send'); $submenu->addLink("Add VIP Participant", "#"); $submenu->addSplitter(); $submenu->addLink("Show All Participants", "#", false, false, 100); $submenu->addLink("Show Missing Participants", "#", false, false, 90); $submenu->addLink("Show Event Attendances", "#", false, false, 10); $submenu->addSplitter(); $submenu->addLink("Build Schedule", "#"); $submenu->addLink("Send Schedule", "#"); $submenu->addLink("Start Timer", "#"); $submenu->addSplitter(); $submenu->addDangerLink("Delete Event", "#"); $body->addToTop(new CustomHTML("\n <div class='page-header'>\n <h1> " . $this->event->name . " <small>" . $this->event->address . "</small></h1>\n </div>\n ")); if ($subPage == '') { $body->addToCenter(new CustomHTML("\n <dl class='dl-horizontal' style='font-size:18px'>\n <dt>Name</dt>\n <dd>" . $this->event->name . "</dd>\n <dt>Address</dt>\n <dd>" . $this->event->address . "</dd>\n </dl>\n ")); } else { if ($subPage == 'update') { $form = new Form("Event"); $form->addInput(Input::textInput("eventName", "Event Name", $this->event->name)); $form->addInput(Input::textareaInput("eventAddress", "Event Address", $this->event->address)); $body->addToCenter($form); } else { if ($subPage == 'send') { $form = new Form("Event"); $form->addInput(Input::tokenInput("emails", "Send To:")); $form->addInput(Input::textInput("subject", "Subject", "Invitation to " . $this->event->name)); $form->addInput(Input::textareaInput("message", "Message")); $body->addToCenter($form); } } } // $table = new HtmlTable(); // $table->addRow(["Name", $this->event->name]); // $table->addRow(["Address", $this->event->address]); // // $body->addToCenter($table); }
<? require_once './view/html.php'; $rol = new Rol(); $permiso = new Permiso(); $submenu = new SubMenu(); $menu = new Menu(); if (isset($_GET['id'])) $rec = $rol->find($_GET['id']); ?> <!DOCTYPE html> <html> <head> <?php head_html(); ?> <script type="text/javascript"> var nameTable='permiso'; </script> <style type="text/css"> body {padding-top: 1em; padding-bottom: 1em; overflow: auto;} </style> </head> <body> <? if (!isset($_GET['id'])) { ?> <div class='content'><h4>Seleccione un rol</h4></div> <? } else { ?> <div class='row'> <h4><? echo ucfirst(strtolower($rec[0]['nombre'])); ?></h4> <table class="bordered hoverable">
tab enable disable is with setTabName("SamplePlugIn") setting menu is with setTabName("Sample Plugin Setting"); block with TabContentSample **/ // Plug-in Definition // status : devel, alpha, beta, rc, stable $plugins_info['SamplePlugin'] = array('name' => 'Sample Plugin', 'description' => 'This is a sample description', 'version' => '0.0.1', 'status' => 'beta', 'tabs' => array('SamplePlugin'), 'settings' => array('Sample Plugin Setting'), 'blocks' => array('BlockSample')); //'plugins' => Array('SamplePlugin'), // We include here our Block Object include_once "plugin/SamplePlugIn/class/BlockSample.class.php"; include_once "plugin/SamplePlugIn/class/SamplePlugIn.class.php"; $cfg_sample_plugin_path = "/Tab/SamplePlugIn/"; // Hook for the block object $GLOBALS['cfg_block_placement']['TabContentSample'][] = "BlockSample"; $plugin_sample_menu = new SubMenu(); $plugin_sample_menu->addMenuItem("page 1", $cfg_sample_plugin_path . "TabContentSample")->addMenuItem("page 2", $cfg_sample_plugin_path . "TabContentSamplePage2"); // Hook to display the Tab (they are real page just without the .php) $GLOBALS['cfg_tab_placement']->append(new Tab("SamplePlugIn")); $GLOBALS['cfg_tab_placement']->next(); $GLOBALS['cfg_tab_placement']->current()->setTabName("SamplePlugIn")->setTitle("You are on the Sample Plugin")->setPages(array("TabContentSample", "TabContentSamplePage2"))->setMenu($plugin_sample_menu)->setMessage('welcome_sample_plugin')->setDefaultPage("TabContentSample"); // Hook to display this plug-in Configuration in the tab Settings. $GLOBALS['cfg_setting_tab_placement']->append(new TabSetting("SamplePlugIn")); $GLOBALS['cfg_setting_tab_placement']->next(); $GLOBALS['cfg_setting_tab_placement']->current()->setTabName("Sample Plugin Setting")->setTitle("Sample Plug In Setting or configuration sample")->setPages(array("SettingContentSample"))->setDefaultPage("SettingContentSample"); // Register the SamplePage, its just a plug-in Page not linked to a Tab or SettingTab. $GLOBALS['cfg_plugin_page']->append(new PlugIn("SamplePlugIn")); $GLOBALS['cfg_plugin_page']->next(); $GLOBALS['cfg_plugin_page']->current()->setPages(array("SamplePage")); //By default the menu will display in all pages of your plug-in //To set specify which menu display on which page use this array
// blocks include_once "plugin/Marketing/class/BlockMarketing.class.php"; include_once "plugin/Marketing/class/BlockWebFormList.class.php"; include_once "plugin/Marketing/class/BlockEmailTemplateList.class.php"; define('OFUZ_LOG_RUN_PLUGIN_MARKETING', true); $cfg_plugin_mkt_path = "/Tab/Marketing/"; // Hook for the block object $GLOBALS['cfg_block_placement']['AutoResponderEmailEdit'][] = "BlockMarketing"; $GLOBALS['cfg_block_placement']['WebForm'][] = "BlockWebFormList"; $GLOBALS['cfg_block_placement']['MEmailTemplate'][] = "BlockEmailTemplateList"; $GLOBALS['cfg_plugin_eventmultiple_placement']['contacts'][] = array('name' => 'Send a Message', 'confirm' => ' ', 'event' => 'ContactMailing->eventGetForMailMerge', 'action' => ' ', 'plugin' => 'Marketing'); // Array('name'=> 'Send a Message ', // 'confirm' => '', // 'event' => 'ContactMailing->eventGetForMailMerge', // 'action' => ''); $plugin_marketing_menu = new SubMenu(); $plugin_marketing_menu->addMenuItem("WebForms", "/Tab/Marketing/WebForm")->addMenuItem("Auto Responders", "/Tab/Marketing/AutoResponder")->addMenuItem("Email Template", "/Tab/Marketing/MEmailTemplate"); // Hook to display the Tab (they are real page just without the .php) $GLOBALS['cfg_tab_placement']->append(new Tab("Marketing")); $GLOBALS['cfg_tab_placement']->next(); $GLOBALS['cfg_tab_placement']->current()->setTabName("Marketing")->setMessage("welcome_marketing")->setPages(array("TabContentMarketing", "WebForm", "WebFormUrl", "MEmailTemplate", "settings_auto_responder_add", "settings_auto_responder", "AutoResponder", "AutoResponderEmail", "AutoResponderEmailEdit", "settings_auto_responder_edit", "SendMessage", "SaveTemplate"))->setMenu($plugin_marketing_menu)->setDefaultPage("MEmailTemplate"); // Use this array to customize the display of the menu in the pages. // $GLOBALS['cfg_submenu_placement']['TabContentMarketing'] = $plugin_marketing_menu; // $GLOBALS['cfg_submenu_placement']['AutoResponder'] = $plugin_marketing_menu; // $GLOBALS['cfg_submenu_placement']['AutoResponderEmail'] = $plugin_marketing_menu; // $GLOBALS['cfg_submenu_placement']['AutoResponderEmailEdit'] = $plugin_marketing_menu; // $GLOBALS['cfg_submenu_placement']['WebForm'] = $plugin_marketing_menu; // $GLOBALS['cfg_submenu_placement']['WebFormURL'] = $plugin_marketing_menu; // $GLOBALS['cfg_submenu_placement']['MEmailTemplate'] = $plugin_marketing_menu; $GLOBALS['cfg_submenu_placement']['SendMessage'] = ''; $GLOBALS['cfg_submenu_placement']['SaveTemplate'] = '';