コード例 #1
0
 function show($view, $loc = null, $title = '')
 {
     $template = new template('loginmodule', $view, $loc);
     $template->assign('title', $title);
     if (pathos_sessions_loggedIn()) {
         global $user, $db;
         $template->assign('loggedin', 1);
         $template->assign('user', $user);
         // Generate display name as username if the first and last name fields are blank.
         $display_name = $user->firstname . ' ' . $user->lastname;
         if (trim($display_name) == '') {
             $display_name = $user->username;
         }
         $template->assign('displayname', $display_name);
         // Need to check for groups and whatnot
         if ($db->countObjects('groupmembership', 'member_id=' . $user->id . ' AND is_admin=1')) {
             $template->assign('is_group_admin', 1);
         } else {
             $template->assign('is_group_admin', 0);
         }
     } else {
         $template->assign("loggedin", 0);
     }
     $template->output($view);
 }
コード例 #2
0
 public function run()
 {
     $tpl = new template();
     $id = (int) $_GET['id'];
     if ($id > 0) {
         $lead = $this->getLead($id);
         // Comments
         $comments = new comments();
         if (isset($_POST['comment']) === true) {
             $values = array('text' => $_POST['text'], 'date' => date("Y-m-d H:i:s"), 'userId' => $_SESSION['userdata']['id'], 'moduleId' => $id, 'commentParent' => $_POST['father']);
             $comments->addComment($values, 'lead');
         }
         // files
         $file = new files();
         if (isset($_POST['upload'])) {
             if (isset($_FILES['file'])) {
                 $file->upload($_FILES, 'lead', $id);
                 $tpl->setNotification('FILE_UPLOADED', 'success');
             } else {
                 $tpl->setNotification('NO_FILE', 'error');
             }
         }
         $files = new files();
         $tpl->assign('files', $files->getFilesByModule('lead', $id));
         $tpl->assign('comments', $comments->getComments('lead', $id));
         $tpl->assign('contactInfo', $this->getLeadContact($id));
         $tpl->assign('lead', $lead);
     } else {
         $tpl->display('general.error');
     }
     $tpl->display('leads.showLead');
 }
コード例 #3
0
 /**
  * run - display template and edit data
  *
  * @access public
  */
 public function run()
 {
     $tpl = new template();
     $helper = new helper();
     $values = array('description' => '', 'dateFrom' => '', 'dateTo' => '', 'allDay' => '');
     if (isset($_POST['save']) === true) {
         if (isset($_POST['allDay']) === true) {
             $allDay = 'true';
         } else {
             $allDay = 'false';
         }
         if (isset($_POST['dateFrom']) === true && isset($_POST['timeFrom']) === true) {
             $dateFrom = $helper->date2timestamp($_POST['dateFrom'], $_POST['timeFrom']);
         }
         if (isset($_POST['dateTo']) === true && isset($_POST['timeTo']) === true) {
             $dateTo = $helper->date2timestamp($_POST['dateTo'], $_POST['timeTo']);
         }
         $values = array('description' => $_POST['description'], 'dateFrom' => $dateFrom, 'dateTo' => $dateTo, 'allDay' => $allDay);
         if ($values['description'] !== '') {
             if ($helper->validateTime($_POST['timeFrom']) === true) {
                 $this->addEvent($values);
                 $msgKey = $tpl->setNotification('SAVE_SUCCESS', 'success');
             } else {
                 $tpl->setNotification('WRONG_TIME_FORMAT', 'error');
             }
         } else {
             $tpl->setNotification('NO_DESCRIPTION', 'error');
         }
         $tpl->assign('values', $values);
     }
     $tpl->assign('helper', $helper);
     $tpl->display('calendar.addEvent');
 }
コード例 #4
0
 /**
  * run - display template and edit data
  *
  * @access public
  */
 public function run()
 {
     $tpl = new template();
     //Only admins
     if ($_SESSION['userdata']['role'] == 'admin') {
         if (isset($_GET['id']) === true) {
             $id = (int) $_GET['id'];
             $msgKey = '';
             if ($this->hasTickets($id) === true) {
                 $msgKey = 'CLIENT_HAS_TICKETS';
             } else {
                 if (isset($_POST['del']) === true) {
                     $this->deleteClient($id);
                     $msgKey = 'CLIENT_DELETED';
                 }
             }
             //Assign vars
             $tpl->assign('client', $this->getClient($id));
             $tpl->assign('msg', $msgKey);
             $tpl->display('clients.delClient');
         } else {
             $tpl->display('general.error');
         }
     } else {
         $tpl->display('general.error');
     }
 }
コード例 #5
0
function form_builder_content_handler(&$sm)
{
    $um =& $sm->get_url_manager();
    $sm->set_theme();
    $sm->_template->set_template_file(VIVVO_FS_ROOT . VIVVO_TEMPLATE_DIR . 'frame/default.tpl');
    $content_template = new template($sm, $sm->_template);
    require_once dirname(__FILE__) . '/form_builder.class.php';
    $form_list =& new FormBuilderForms_list($sm);
    $form =& $form_list->get_form_by_id($um->get_param('search_fid'));
    $content_template->assign('form', $form);
    if ($form) {
        $form_element_list =& new FormBuilderFields_list($sm);
        $form_element_list->get_elements_by_form_id($form->id);
        $upload = false;
        foreach ($form_element_list->list as $element) {
            if ($element->get_type() == 'file_upload') {
                $upload = true;
                break;
            }
        }
        $content_template->assign('form_elements', $form_element_list->list);
        $content_template->assign('form_has_file_upload', $upload);
    }
    $action = $um->get_param('action');
    if ($upload && !empty($action)) {
        if (!empty($form->message_url)) {
            $content_template->assign('message_url', $form->message_url);
        }
        $content_template->set_template_file(VIVVO_FS_TEMPLATE_ROOT . VIVVO_TEMPLATE_DIR . 'box/plugin_form_builder.tpl');
    } else {
        $content_template->set_template_file(VIVVO_FS_TEMPLATE_ROOT . VIVVO_TEMPLATE_DIR . 'system/box_default/box_form.tpl');
    }
    $sm->_template->assign_template('PAGE_CONTENT', $content_template);
}
コード例 #6
0
 /**
  * run - display template and edit data
  *
  * @access public
  *
  */
 public function run()
 {
     $tpl = new template();
     $tpl->assign('role', $_SESSION['userdata']['role']);
     $tpl->assign('allProjects', $this->getUserProjects());
     $tpl->display('projects.showAll');
 }
コード例 #7
0
 /**
  * run - display template and edit data
  *
  * @access public
  *
  */
 public function run()
 {
     $tpl = new template();
     $infoKey = '';
     //Build values array
     $values = array('name' => '', 'alias' => '', 'modules' => array());
     if (isset($_POST['save'])) {
         $modules = '';
         foreach ($_POST['modules'] as $row) {
             $modules .= $row . ',';
         }
         $values = array('name' => $_POST['name'], 'alias' => $_POST['alias'], 'modules' => $modules);
         if ($values['name'] !== '') {
             $helper = new helper();
             if ($values['alias'] !== '') {
                 $this->newSystemOrg($values);
                 $infoKey = '<p>Erfolgreich hinzugefügt</p>';
                 $values['modules'] = explode(',', $values['modules']);
             } else {
                 $infoKey = 'Keine Beschreibung angegeben';
             }
         } else {
             $infoKey = 'Keinen Alias angegeben';
         }
     }
     //Assign vars
     $tpl->assign('modules', $this->getAllModules());
     $tpl->assign('info', $infoKey);
     $tpl->assign('values', $values);
     $tpl->display('setting.newSystemOrg');
 }
コード例 #8
0
 /**
  * run - display template and edit data
  *
  * @access public
  *
  */
 public function run()
 {
     $tpl = new template();
     //Only Admins
     if ($_SESSION['userdata']['role'] == 'admin') {
         if (isset($_GET['id']) === true) {
             $id = (int) $_GET['id'];
             $user = $this->getUser($id);
             $msgKey = '';
             //Delete User
             if (isset($_POST['del']) === true) {
                 $this->deleteUser($id);
                 $msgKey = 'USER_DELETED';
             }
             //Assign variables
             $tpl->assign('msg', $msgKey);
             $tpl->assign('user', $user);
             $tpl->display('users.delUser');
         } else {
             $tpl->display('general.error');
         }
     } else {
         $tpl->display('general.error');
     }
 }
コード例 #9
0
 function show($view, $loc = null, $title = '')
 {
     global $db;
     $template = new template('listingmodule', $view, $loc);
     if (!defined('SYS_SORTING')) {
         require_once BASE . 'subsystems/sorting.php';
     }
     if (!defined('SYS_FILES')) {
         require_once BASE . 'subsystems/files.php';
     }
     $directory = 'files/listingmodule/' . $loc->src;
     if (!file_exists(BASE . $directory)) {
         $err = pathos_files_makeDirectory($directory);
         if ($err != SYS_FILES_SUCCESS) {
             $template->assign('noupload', 1);
             $template->assign('uploadError', $err);
         }
     }
     $listings = $db->selectObjects('listing', "location_data='" . serialize($loc) . "'");
     for ($i = 0; $i < count($listings); $i++) {
         if ($listings[$i]->file_id == 0) {
             $listings[$i]->picpath = '';
         } else {
             $file = $db->selectObject('file', 'id=' . $listings[$i]->file_id);
             $listings[$i]->picpath = $file->directory . '/' . $file->filename;
         }
     }
     //sort the listings by their rank
     usort($listings, 'pathos_sorting_byRankAscending');
     $template->register_permissions(array('administrate', 'configure'), $loc);
     $template->assign('listings', $listings);
     $template->assign('moduletitle', $title);
     $template->output();
 }
コード例 #10
0
 public function run()
 {
     // Hier instanzieren wir die Template Engine
     $tpl = new template();
     $users = $this->getUsers();
     $user = '';
     if (isset($_POST['user']) === true && $_POST['user'] != "") {
         $user = htmlentities($_POST['user']);
     }
     if (isset($_POST['save']) === true && $_POST['save'] != "") {
         if (isset($_POST['menu']) === true) {
             $menu = $_POST['menu'];
         } else {
             $menu = array();
         }
         $info = 'Änderungen gespeichert';
         $this->deleteAllRelations($user);
         $this->insertRelations($menu, $user);
     } else {
         $info = '';
     }
     $tpl->assign('users', $users);
     $tpl->assign('user', $user);
     $tpl->assign('info', $info);
     $tpl->assign('menu', $this->getMenu($user));
     $tpl->display('setting.userMenu');
 }
コード例 #11
0
 function show($view, $loc = null, $title = '')
 {
     if (pathos_permissions_check('administrate', $loc) || pathos_permissions_check('create', $loc) || pathos_permissions_check('edit', $loc) || pathos_permissions_check('delete', $loc)) {
         $template = new template('htmltemplatemodule', $view, $loc);
         if (!defined('SYS_FILES')) {
             require_once BASE . 'subsystems/files.php';
         }
         $directory = 'files/htmltemplatemodule/' . $loc->src;
         if (!file_exists(BASE . $directory)) {
             $err = pathos_files_makeDirectory($directory);
             if ($err != SYS_FILES_SUCCESS) {
                 $template->assign('noupload', 1);
                 $template->assign('uploadError', $err);
             }
         }
         global $db;
         $templates = $db->selectObjects('htmltemplate');
         for ($i = 0; $i < count($templates); $i++) {
             $assocs = $db->selectObjects('htmltemplateassociation', 'template_id=' . $templates[$i]->id);
             if (count($assocs) == 1 && $assocs[0]->global == 1) {
                 $templates[$i]->global_assoc = 1;
             } else {
                 $templates[$i]->global_assoc = 0;
                 $templates[$i]->associations = $assocs;
             }
         }
         $template->assign('moduletitle', $title);
         $template->assign('templates', $templates);
         $template->register_permissions(array('administrate', 'create', 'edit', 'delete'), pathos_core_makeLocation('htmltemplatemodule'));
         $template->output();
     }
 }
コード例 #12
0
 /**
  * run - display template and edit data
  *
  * @access public
  *
  */
 public function run()
 {
     $tpl = new template();
     $infoKey = '';
     //Build values array
     $values = array('name' => '', 'parent' => '', 'module' => '', 'action' => '', 'icon' => '');
     if (isset($_POST['save'])) {
         if (isset($_POST['module'])) {
             $module = str_replace('index.php?act=', '', $_POST['module']);
             $module = explode('.', $module);
             $action = $module[1];
             $module = $module[0];
             $values = array('name' => $_POST['name'], 'parent' => $_POST['parent'], 'module' => $module, 'action' => $action, 'icon' => $_POST['icon']);
             $this->addMenu($values);
             $tpl->setNotification('New menu item successfully created', 'success');
             // $infoKey = '<p>Erfolgreich hinzugefügt</p>';
         } else {
             $tpl->setNotification('MISSING_FIELDS', 'error');
         }
     }
     $getModuleLinks = $this->getAllModulesAsLinks();
     $tpl->assign('wholeMenu', $this->getWholeMenu());
     $tpl->assign('moduleLinks', $getModuleLinks);
     $tpl->assign('info', $infoKey);
     $tpl->assign('values', $values);
     $tpl->assign('applications', $this->applications);
     $tpl->display('setting.addMenu');
 }
コード例 #13
0
 public function run()
 {
     $tpl = new template();
     $language = new language();
     $language->setModule('leads');
     $language->readIni();
     if (isset($_POST['save'])) {
         if (isset($_POST['name']) && isset($_POST['money']) && isset($_POST['referralSource'])) {
             $refValue = '';
             if ($_POST['referralValueOther'] != '') {
                 $refValue = $_POST['referralValueOther'];
             } else {
                 if ($_POST['referralSource'] == 5 && $_POST['referralValueClient'] > 0) {
                     $refValue = $_POST['referralValueClient'];
                 }
             }
             $values = array('name' => $_POST['name'], 'refSource' => $_POST['referralSource'], 'refValue' => $refValue, 'potentialMoney' => $_POST['money'], 'creatorId' => $_SESSION['userdata']['id']);
             $contact = array('name' => $_POST['clientName'], 'street' => $_POST['street'], 'zip' => $_POST['zip'], 'city' => $_POST['city'], 'state' => $_POST['state'], 'country' => $_POST['country'], 'phone' => $_POST['phone'], 'email' => $_POST['email'], 'internet' => $_POST['internet']);
             if ($this->isLead($values['name']) !== true) {
                 $leadId = $this->addLead($values);
                 $this->addLeadContact($contact, $leadId);
                 $tpl->setNotification('EDIT_SUCCESS', 'success');
             } else {
                 $tpl->setNotification('LEAD_EXISTS', 'error');
             }
         } else {
             $tpl->setNotification('MISSING_FIELDS', 'error');
         }
     }
     $client = new clients();
     $tpl->assign('referralSources', $this->getReferralSources());
     $tpl->assign('clients', $client->getAll());
     $tpl->display('leads.addLead');
 }
コード例 #14
0
 /**
  * run - display template and edit data
  *
  * @access public
  *
  */
 public function run()
 {
     $tpl = new template();
     $action = base64_decode($_GET['action']);
     $infoKey = '';
     $roles = $this->getRoles();
     $tabRights = $this->getTabRights($action);
     if (isset($_POST['saveTabs'])) {
         $i = 0;
         foreach ($tabRights as $key => $value) {
             if (isset($_POST['' . $key . '-select']) === true) {
                 $arrayRoles = $_POST['' . $key . '-select'];
                 $moduleRoles = '';
                 foreach ($_POST['' . $key . '-select'] as $row2) {
                     $moduleRoles .= $row2 . '|';
                 }
                 $values[$i]['action'] = $action;
                 $values[$i]['tab'] = $key;
                 $values[$i]['tabRights'] = $moduleRoles;
                 $i++;
             }
         }
         $this->saveTabRights($action, $values);
         $infoKey = "Tab Rechte gespeichert";
         $tabRights = $this->getTabRights($action);
     }
     //Assign vars
     $tpl->assign('action', $action);
     $tpl->assign('tabArray', $tabRights);
     $tpl->assign('roles', $roles);
     $tpl->assign('info', $infoKey);
     $tpl->display('setting.editTabRights');
 }
コード例 #15
0
 public function run()
 {
     $tpl = new template();
     $id = (int) $_GET['id'];
     $users = new users();
     $clients = new clients();
     if ($id && $id > 0) {
         $lead = $this->getLead($id);
         $contact = $this->getLeadContact($id);
         $values = array('user' => $contact['email'], 'password' => '', 'firstname' => '', 'lastname' => '', 'phone' => $contact['phone'], 'role' => 3, 'clientId' => $lead['clientId']);
         if (isset($_POST['save'])) {
             if (isset($_POST['user']) && isset($_POST['firstname']) && isset($_POST['lastname'])) {
                 $hasher = new PasswordHash(8, TRUE);
                 $values = array('user' => $_POST['user'], 'password' => $hasher->HashPassword($_POST['password']), 'firstname' => $_POST['firstname'], 'lastname' => $_POST['lastname'], 'phone' => $_POST['phone'], 'role' => $_POST['role'], 'clientId' => $_POST['clientId']);
                 if ($users->usernameExist($values['user']) !== true) {
                     $users->addUser($values);
                     $tpl->setNotification('USER_CREATED', 'success');
                 } else {
                     $tpl->setNotification('USERNAME_EXISTS', 'error');
                 }
             } else {
                 $tpl->setNotification('MISSING_FIELDS', 'error');
             }
         }
         $tpl->assign('values', $values);
         $tpl->assign('clients', $clients->getAll());
         $tpl->assign('roles', $users->getRoles());
         $tpl->display('leads.convertToUser');
     } else {
         $tpl->display('general.error');
     }
 }
コード例 #16
0
 function show($view, $loc, $title = '')
 {
     $template = new template('imagemanagermodule', $view, $loc);
     $uilevel = 99;
     // MAX
     if (exponent_sessions_isset("uilevel")) {
         $uilevel = exponent_sessions_get("uilevel");
     }
     $template->assign('show', defined('SELECTOR') || $uilevel > UILEVEL_PREVIEW ? 1 : 0);
     if (!defined('SYS_FILES')) {
         include_once BASE . 'subsystems/files.php';
     }
     $directory = 'files/imagemanagermodule/' . $loc->src;
     if (!file_exists(BASE . $directory)) {
         $err = exponent_files_makeDirectory($directory);
         if ($err != SYS_FILES_SUCCESS) {
             $template->assign('noupload', 1);
             $template->assign('uploadError', $err);
         }
     }
     global $db;
     $location = serialize($loc);
     if (!isset($_SESSION['image_cache'][$location])) {
         $items = $db->selectObjects("imagemanageritem", "location_data='" . serialize($loc) . "'");
         $_SESSION['image_cache'][$location] = $items;
     } else {
         $items = $_SESSION['image_cache'][$location];
     }
     $files = $db->selectObjectsIndexedArray("file", "directory='{$directory}'");
     $template->assign('items', $items);
     $template->assign('files', $files);
     $template->assign('moduletitle', $title);
     $template->register_permissions(array('administrate', 'post', 'edit', 'delete'), $loc);
     $template->output();
 }
コード例 #17
0
ファイル: class.menu.php プロジェクト: DevelopIdeas/leantime
 public function run()
 {
     $tpl = new template();
     $tpl->assign('menu', $this);
     $tpl->assign('menus', $this->getMenus());
     $tpl->display('general.menu');
 }
コード例 #18
0
 /**
  * run - display template and edit data
  *
  * @access public
  *
  */
 public function run()
 {
     $tpl = new template();
     //Assign vars
     $tpl->assign('menu', $this->getWholeMenu());
     $tpl->assign('applications', $this->applications);
     $tpl->display('setting.showAllMenu');
 }
コード例 #19
0
    public function run()
    {
        $tpl = new template();
        $file = 'config/configuration.php';
        if (file_exists($file) === true) {
            if (substr(decoct(fileperms($file)), 2) != 777) {
                $tpl->assign('info', 'configuration.php nicht beschreibbar');
            }
            $config = new config();
            $values = array('sitename' => $config->sitename, 'dbHost' => $config->dbHost, 'dbUser' => $config->dbUser, 'dbDatabase' => $config->dbDatabase, 'dbPassword' => $config->dbPassword, 'userFilePath' => $config->userFilePath, 'maxFileSize' => $config->maxFileSize, 'email' => $config->email, 'adminUserName' => $config->adminUserName, 'adminUserPassword' => $config->adminUserPassword, 'adminFirstname' => $config->adminFirstname, 'adminLastname' => $config->adminLastname, 'adminEmail' => $config->adminEmail, 'sessionpassword' => $config->sessionpassword);
            if (isset($_POST['save'])) {
                $fileContent = '<?php
							class config
							{
								/* General */
								public $sitename = "' . htmlspecialchars($_POST['sitename']) . '";
								/* Database */
								public $dbHost="' . htmlspecialchars($_POST['host']) . '";
								public $dbUser="******";
								public $dbPassword="******";
								public $dbDatabase="' . htmlspecialchars($_POST['database']) . '";
								
								public $adminUserName = "******";
								public $adminUserPassword = "******";
								public $adminFirstname = "' . htmlspecialchars($_POST['adminFirstname']) . '";
								public $adminLastname = "' . htmlspecialchars($_POST['adminLastname']) . '";
								public $adminEmail = "' . htmlspecialchars($_POST['adminEmail']) . '";
								
								/* Fileupload */
								public $userFilePath="' . htmlspecialchars($_POST['path']) . '";
								public $maxFileSize = "' . htmlspecialchars($_POST['filesize']) . '";
								
								/* Sessions */
								public $sessionpassword = "******";
								
								/* Email */
								public $email = "' . htmlspecialchars($_POST['email']) . '";
							
							}
							?>';
                if (substr(decoct(fileperms($file)), 2) == 777) {
                    $fp = fopen($file, "w+");
                    fputs($fp, $fileContent);
                    fclose($fp);
                    $values = array('sitename' => htmlspecialchars($_POST['sitename']), 'dbHost' => htmlspecialchars($_POST['host']), 'dbUser' => htmlspecialchars($_POST['username']), 'dbPassword' => htmlspecialchars($_POST['password']), 'dbDatabase' => htmlspecialchars($_POST['database']), 'userFilePath' => htmlspecialchars($_POST['path']), 'maxFileSize' => htmlspecialchars($_POST['filesize']), 'email' => htmlspecialchars($_POST['email']), 'adminUserName' => htmlspecialchars($_POST['adminUserName']), 'adminUserPassword' => htmlspecialchars($_POST['adminUserPassword']), 'adminFirstname' => htmlspecialchars($_POST['adminFirstname']), 'adminLastname' => htmlspecialchars($_POST['adminLastname']), 'adminEmail' => htmlspecialchars($_POST['adminEmail']), 'sessionpassword' => $values['sessionpassword']);
                    $tpl->assign('info', 'Einstellungen gespeichert');
                } else {
                    $tpl->assign('info', 'configuration.php nicht beschreibbar');
                }
            }
            $tpl->assign('values', $values);
            $tpl->display('setting.editSettings');
        } else {
            $tpl->display('general.error');
        }
    }
コード例 #20
0
 function show($view, $loc = null, $title = "")
 {
     $loc = pathos_core_makeLocation('filemanagermodule');
     global $db;
     $collections = $db->selectObjects('file_collection');
     $template = new template('filemanagermodule', $view, $loc);
     $template->assign('collections', $collections);
     $template->assign('moduletitle', $title);
     $template->output();
 }
コード例 #21
0
 function show($view, $loc = null, $title = '')
 {
     $ui_levels = exponent_sessions_get('uilevels');
     if (count($ui_levels)) {
         $template = new template('UISwitchermodule', $view, $loc);
         $template->assign('levels', $ui_levels);
         $default = exponent_sessions_isset('uilevel') ? exponent_sessions_get('uilevel') : max(array_keys($ui_levels));
         $template->assign('default_level', $default);
         $template->output();
     }
 }
コード例 #22
0
 function show($view, $location = null, $title = '')
 {
     global $user;
     global $db;
     $template = new template('SWFModule', $view, $location);
     $template->assign('moduletitle', $title);
     if (defined('PREVIEW_READONLY') && !defined('SELECTOR')) {
         return;
     }
     if (!defined('SYS_FILES')) {
         require_once BASE . 'subsystems/files.php';
     }
     $directory = 'files/SWFModule';
     if (!file_exists(BASE . $directory)) {
         $err = exponent_files_makeDirectory($directory);
         if ($err != SYS_FILES_SUCCESS) {
             $template->assign('noupload', 1);
             $template->assign('uploadError', $err);
         }
     }
     $data = $db->selectObject('swfitem', "location_data='" . serialize($location) . "'");
     if ($data == null) {
         $data->_noflash = 1;
         $data->_align = 'center';
     } else {
         $data->_noflash = 0;
         switch ($data->alignment) {
             case 1:
                 $data->_align = 'left';
                 break;
             case 2:
                 $data->_align = 'right';
                 break;
             default:
                 $data->_align = 'center';
                 break;
         }
         $file = $db->selectObject('file', 'id=' . $data->swf_id);
         if ($file && is_readable(BASE . $file->directory . '/' . $file->filename)) {
             $data->_flashurl = $file->directory . '/' . $file->filename;
         } else {
             $data->_flashurl = '';
         }
         $file = $db->selectObject('file', 'id=' . $data->alt_image_id);
         if ($file && is_readable(BASE . $file->directory . '/' . $file->filename)) {
             $data->_noflashurl = $file->directory . '/' . $file->filename;
         } else {
             $data->_noflashurl = '';
         }
     }
     $template->assign('data', $data);
     $template->register_permissions(array('administrate', 'configure'), $location);
     $template->output();
 }
コード例 #23
0
/**
 * Smarty {fileuploadcontrol} function plugin
 *
 * Type:     function<br>
 * Name:     fileuploadcontrol<br>
 * Purpose:  display a file upload control
 *
 * @param         $params
 * @param \Smarty $smarty
 */
function smarty_function_fileuploadcontrol($params, &$smarty)
{
    global $db;
    $files = $db->selectObjects('file', 'item_id="' . $params['id'] . '" AND item_type="' . $params['type'] . '"');
    $template = new template('cermi', '_main');
    $template->assign('files', $files);
    $template->assign('item_type', $params['type']);
    $template->assign('item_id', $params['id']);
    $html = $template->render();
    echo $html;
}
コード例 #24
0
 function show($view, $loc = null, $title = "")
 {
     $ui_levels = pathos_sessions_get("uilevels");
     if (count($ui_levels)) {
         $template = new template("uiswitchermodule", $view, $loc);
         $template->assign("levels", $ui_levels);
         $default = pathos_sessions_isset("uilevel") ? pathos_sessions_get("uilevel") : max(array_keys($ui_levels));
         $template->assign("default_level", $default);
         $template->output();
     }
 }
コード例 #25
0
 /**
  * run - display template and edit data
  *
  * @access public
  *
  */
 public function run()
 {
     $tpl = new template();
     $dateFrom = date("Y-m-d");
     $dateTo = date("Y-m-d");
     $tpl->assign('calendar', $this->getCalendar($_SESSION['userdata']['id']));
     $tpl->assign('gCalLink', $this->getMyGoogleCalendars());
     $tpl->assign('ticketEditDates', $this->getTicketEditDates());
     $tpl->assign('ticketWishDates', $this->getTicketWishDates());
     $tpl->assign('dates', $this->getAllDates($dateFrom, $dateTo));
     $tpl->display('calendar.showMyCalendar');
 }
コード例 #26
0
 function show($view, $loc = null, $title = '')
 {
     $template = new template('previewmodule', $view, $loc);
     $level = 99;
     if (pathos_sessions_isset('uilevel')) {
         $level = pathos_sessions_get('uilevel');
     }
     $template->assign('editMode', pathos_sessions_loggedIn() && $level != UILEVEL_PREVIEW);
     $template->assign('title', $title);
     $template->assign('previewMode', $level == UILEVEL_PREVIEW);
     $template->output($view);
 }
コード例 #27
0
 public function run()
 {
     $login = new login(session::getSID());
     if ($login->logged_in() === true) {
         $user = new users();
         $profilePicture = $user->getProfilePicture($_SESSION['userdata']['id']);
         $tpl = new template();
         $tpl->assign("profilePicture", $profilePicture);
         $tpl->assign("userName", $_SESSION['userdata']['name']);
         $tpl->assign("userEmail", $_SESSION['userdata']['mail']);
         $tpl->display("general.loginInfo");
     }
 }
コード例 #28
0
 /**
  * run - display template and edit data
  *
  * @access public
  *
  */
 public function run()
 {
     $tpl = new template();
     //Only Admins
     if ($_SESSION['userdata']['role'] == 'admin') {
         //Assign vars
         $tpl->assign('allUsers', $this->getAll());
         $tpl->assign('admin', true);
         $tpl->assign('roles', $this->getRoles());
         $tpl->display('users.showAll');
     } else {
         $tpl->display('general.error');
     }
 }
コード例 #29
0
 /**
  * run - display template and edit data
  *
  * @access public
  *
  */
 public function run()
 {
     $tpl = new template();
     if (isset($_GET['id']) === true) {
         $id = (int) $_GET['id'];
         $row = $this->getRole($id);
         $infoKey = '';
         //Get relations to menue
         $menues = $this->getDefaultMenu($id);
         //Build values array
         $values = array('roleName' => $row['roleName'], 'roleDescription' => $row['roleDescription'], 'menu' => $menues, 'sysOrg' => $row['sysOrg'], 'template' => $row['template']);
         if (isset($_POST['save'])) {
             if (isset($_POST['menu'])) {
                 $menu = $_POST['menu'];
             } else {
                 $menu[0] = '';
             }
             $values = array('roleName' => $_POST['roleName'], 'roleDescription' => $_POST['roleDescription'], 'menu' => $menu, 'sysOrg' => $_POST['sysOrg'], 'template' => $_POST['template']);
             if ($values['roleName'] !== '') {
                 $helper = new helper();
                 if ($this->roleAliasExist($values['roleName'], $id) === false) {
                     if ($values['roleDescription'] !== '') {
                         $this->editRole($values, $id);
                         $infoKey = '<p>Erfolgreich bearbeitet</p>';
                         $row = $this->getRole($id);
                         //Get relations to menue
                         $menues = $this->getDefaultMenu($id);
                         //Build values array
                         $values = array('roleName' => $row['roleName'], 'roleDescription' => $row['roleDescription'], 'menu' => $menues, 'sysOrg' => $row['sysOrg'], 'template' => $row['template']);
                     } else {
                         $infoKey = 'Keine Beschreibung angegeben';
                     }
                 } else {
                     $infoKey = 'Rolle existiert bereits';
                 }
             } else {
                 $infoKey = 'Keinen Rollen-Alias angegeben';
             }
         }
         //Assign vars
         $tpl->assign('info', $infoKey);
         $tpl->assign('values', $values);
         $tpl->assign('templates', $this->getAllTemplates());
         $tpl->assign('sysOrgs', $this->getAllSystemOrganisations());
         $tpl->assign('menu', $this->getWholeMenu());
         $tpl->display('setting.editRole');
     } else {
         $tpl->display('general.error');
     }
 }
コード例 #30
0
 /**
  * run - display template and edit data
  *
  * @access public
  */
 public function run()
 {
     $tpl = new template();
     //Only admins and employees
     if ($_SESSION['userdata']['role'] == 'admin' || $_SESSION['userdata']['role'] == 'employee') {
         if ($_SESSION['userdata']['role'] == 'admin') {
             $tpl->assign('admin', true);
         }
         $tpl->assign('allClients', $this->getAll());
         $tpl->display('clients.showAll');
     } else {
         $tpl->display('general.error');
     }
 }