public function layout() { global $route; $url = isset($_GET['url']) && $_GET['url'] != null ? $_GET['url'] : ""; if (array_key_exists($url, $route)) { $url = $route[$url]; } if ($url) { } $urlArr = explode('/', $url); // Get module $module = isset($urlArr[0]) && $urlArr[0] != null ? rtrim($urlArr[0]) : ""; // Get controller $controller = isset($urlArr[1]) && $urlArr[1] != null ? rtrim($urlArr[1]) : "index"; //Get action $action = isset($urlArr[2]) && $urlArr[2] != null ? rtrim($urlArr[2]) : "index"; // Load view $pathView = MODULE_PATH . $module . '/views/script/' . $module . '/' . $controller . '/' . $action . '.phtml'; if (file_exists($pathView)) { require_once $pathView; } else { setTemplate('404'); die; } }
public function __construct() { global $route; $url = isset($_GET['url']) ? $_GET['url'] : ""; if (array_key_exists($url, $route)) { $url = $route[$url]; } if ($url) { $urlArr = explode('/', $url); // Get module $module = isset($urlArr[0]) && $urlArr[0] != null ? rtrim($urlArr[0], "/") : ""; // Get controller $controller = isset($urlArr[1]) && $urlArr[1] != null ? rtrim($urlArr[1], "/") : "index"; // Get action $action = isset($urlArr[2]) && $urlArr[2] != null ? rtrim($urlArr[2], "/") : "index"; $controllerName = $controller . "Controller"; $actionName = $action . "Action"; // Load controller $pathController = MODULE_PATH . $module . "/controllers/" . ucfirst($controllerName) . ".php"; if (file_exists($pathController)) { require_once $pathController; $objController = new $controllerName(); if (method_exists($controllerName, $actionName)) { $objController->{$actionName}(); } else { setTemplate('404'); die; } } else { setTemplate('404'); die; } } }
public function setTpl($template) { return setTemplate($template); }
function _maskTemplateManager() { require_once _base_ . '/lib/lib.form.php'; require_once $GLOBALS['where_framework'] . '/lib/lib.field.php'; require_once _base_ . '/lib/lib.table.php'; $lang =& DoceboLanguage::createInstance('configuration', 'framework'); $field_man = new FieldList(); $html = ''; if (isset($_POST['save_and_refresh'])) { if (!sql_query("\r\n\t\t\tUPDATE " . $this->table . "\r\n\t\t\tSET param_value = '" . $_POST['templ_use_field'] . "'\r\n\t\t\tWHERE pack = 'main' AND param_name = 'templ_use_field'")) { $html .= getErrorUi('_ERROR_WHILE_SAVING_NEW_FIELD'); } else { setTemplate($_POST['templ_use_field']); } } $drop_field = array(); $drop_field = $field_man->getFlatAllFields(false, 'dropdown'); $drop_field[0] = $lang->def('_NO'); $html .= Form::getDropdown($lang->def('_TEMPL_USE_FIELD'), 'templ_use_field', 'templ_use_field', $drop_field, Get::sett('templ_use_field')); $html .= Form::getButton('save_and_refresh', 'save_and_refresh', $lang->def('_SAVE_AND_REFRESH')); if (Get::sett('templ_use_field') != 0) { $field_obj =& $field_man->getFieldInstance(Get::sett('templ_use_field')); if ($field_obj === NULL) { return $html . getErrorUi('_ERROR_WITH_THIS_FIELD'); } $assignement = array(); $query_template_assigned = "\r\n\t\t\tSELECT ref_id, template_code\r\n\t\t\tFROM " . $GLOBALS['prefix_fw'] . "_field_template\r\n\t\t\tWHERE id_common = '" . Get::sett('templ_use_field') . "'"; $re_templ_assigned = sql_query($query_template_assigned); while (list($ref_id, $template_code) = sql_fetch_row($re_templ_assigned)) { $assignement[$ref_id] = $template_code; } $son_value = $field_obj->getAllSon(); $template_list = getTemplateList(true); $default_template = getDefaultTemplate(); $tb_son = new Table(0, $lang->def('_ASSIGN_DROPDOWN_VALUE_TEMPLATE'), $lang->def('_ASSIGN_DROPDOWN_VALUE_TEMPLATE_SUMMARY')); $cont_h = array($lang->def('_VALUE'), $lang->def('_TEMPLATE_VALUE')); $type_h = array('', ''); $tb_son->setColsStyle($type_h); $tb_son->addHead($cont_h); while (list($id_son, $drop_son_name) = each($son_value)) { $cont = array('<label for="template_selected_' . $id_son . '">' . $drop_son_name . '</label>', Form::getInputDropdown('dropdown', 'template_selected_' . $id_son, 'template_selected[' . $id_son . ']', $template_list, isset($assignement[$id_son]) && isset($template_list[$assignement[$id_son]]) ? $assignement[$id_son] : $default_template, '')); $tb_son->addBody($cont); } $html .= $tb_son->getTable(); } return $html; }
/** * @param string the value to assign at 'ui.template' */ function setTemplate($new_template) { $this->setPreference('ui.template', $new_template); if ($this->id_user == getLogUserId() || Get::sett('templ_use_field') == 0) { setTemplate($new_template); } return true; }
/** * Import the Special Pages content */ function getAdvancedContent($new_data, $table, $report, $privacity) { global $wpdb; $db_table_name = $wpdb->prefix . 'import_intranet'; $query = "SELECT * FROM `{$db_table_name}` WHERE id_intraweb = '{$new_data->page_id}' AND type = '{$table}' "; $result = $wpdb->get_row($query); manageDataBaseErrors($wpdb); $page_root_id = rootIntranetPage(); $userId = getUserId($new_data->page_cr_uid); $post = array(); $post['post_name'] = $new_data->page_urlname; $post['post_title'] = $new_data->page_title; $post['post_status'] = $privacity; $post['post_type'] = 'page'; $post['post_author'] = $userId; $post['post_parent'] = $page_root_id; $queryData = "SELECT `con_type`, `con_data` FROM content_content WHERE con_pageid = '{$new_data->page_id}' AND con_active = 1 ORDER BY con_areaindex ASC "; $resultData = $wpdb->get_results($queryData); manageDataBaseErrors($wpdb); if ($resultData) { list($post['post_content'], $images) = parseAdvancedContent($resultData); } if ($result) { $post['ID'] = $result->id_wp_post; $update = wp_update_post($post); if ($update === false) { $report['error'][] = __('Error Updating Post content: ', 'intranet-importer') . ' ' . $new_data->page_title; } else { setTemplate($post['ID']); if (!empty($images)) { manageImagesForSpecialImages($images, $post['ID'], $post); } $report['update']++; } } else { $post_id = wp_insert_post($post); if (!$post_id) { $report['error'][] = __('Error inserting Post content: ', 'intranet-importer') . ' ' . $new_data->page_title; } else { setTemplate($post_id); if (!empty($images)) { manageImagesForSpecialImages($images, $post_id, $post); } insertDataOnIntranetImport($db_table_name, $new_data->page_id, $post_id, $table); $report['insert']++; } } return $report; }
/** * Reset the template to the default */ function resetTemplate() { unset($_SESSION['template']); setTemplate(getTemplate()); }
$mu = new minierp_users(); $user = $mu->login($user_name, $password_plain); if (is_array($user) && isset($user['id'])) { $_SESSION['logged_in'] = true; $session_userinfo = array(); $session_userinfo['id'] = $user['id']; $session_userinfo['username'] = $user['username']; $session_userinfo['email'] = $user['email']; $session_userinfo['status'] = $user['status']; $session_userinfo['users_image'] = is_file(DIR_WS_IMAGES . $user['users_image']) ? $user['users_image'] : 'user-default.png'; $_SESSION['user'] = serialize($session_userinfo); if ($user['template'] != $template_user && array_key_exists($user['template'], $template_user_array)) { $template_user = $user['template']; //$template_user_version = $template_user_prefix.$template_user_array[$template_user].$template_user_suffix; } setTemplate($template_user); //$redirect = (isset($_SESSION['redirect_login']) && $_SESSION['redirect_login']!='') ? $_SESSION['redirect_login'] : '******'; //header("Location: $redirect"); $redirect_upload_image = !is_file(DIR_WS_IMAGES . $user['users_image']) ? 'index.php?open=my-account&change=users_image&from=login' : $_SERVER['REQUEST_URI']; // header("Location: $_SERVER[REQUEST_URI]"); header("Location: {$redirect_upload_image}"); exit; } else { /* * WE HAVE FULLY DISABLED OUR DTI TOOLS WITH ALL PARTNERS use_class('dti', DIR_WS_CLASSES); $class_dti = new dti(); $dti_partners = $class_dti->miniERPlogin($user_name, $password_plain); if(!is_null($dti_partners) && is_array($dti_partners) && count($dti_partners)>0 && $dti_partners['dti_referrers_active']=='1') { $_SESSION['logged_in'] = true; $session_userinfo = array();
<?php //SUBMIT ACTION $changestatus = false; if (isset($_POST['me_action'])) { use_class('minierp_users'); $class_mu = new minierp_users(); if ($_POST['me_action'] == 'SAVETEMPLATE') { $new_template = tep_db_prepare_input($_POST['new_template']); $result = $class_mu->saveTemplate($session_userinfo['id'], $new_template); setTemplate($new_template); } elseif ($_POST['me_action'] == 'CHANGEPASSWORD') { $oldpass = tep_db_prepare_input($_POST['oldpass']); $newpass = tep_db_prepare_input($_POST['newpass']); if ($session_userinfo['status'] == 'DTI') { $filter = "dti_referrers_id={$session_userinfo['id']}"; $dti_partner_detail = $class_dti->retrieveReferrerDetail($referrer_id, $filter); if ($dti_partner_detail['dti_referrers_password'] != $oldpass) { $changestatus = false; } else { $sda = array('dti_referrers_password' => $newpass); $class_dti->update($session_userinfo['id'], $sda); $changestatus = true; } } else { $changestatus = $class_mu->changePassword($session_userinfo['id'], $oldpass, $newpass); } $result = $changestatus ? '1' : '0'; } elseif ($_POST['me_action'] == 'UPLOADIMAGE') { $user_id = tep_db_prepare_input($_POST['user_id']); $new_image = $class_mu->changeUsersImage($user_id, $_FILES['image']['tmp_name']);