Exemplo n.º 1
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');
 }
Exemplo n.º 2
0
 public function getAll($notifyId = 0)
 {
     if ($notifyId == 0) {
         $notifyId = $this->getMaxId();
         $notifyId++;
     }
     $notifications = array("error" => false, "error_code" => ERROR_SUCCESS, "notifyId" => $notifyId, "notifications" => array());
     $stmt = $this->db->prepare("SELECT * FROM notifications WHERE notifyToId = (:notifyToId) AND id < (:notifyId) ORDER BY id DESC LIMIT 20");
     $stmt->bindParam(':notifyToId', $this->requestFrom, PDO::PARAM_INT);
     $stmt->bindParam(':notifyId', $notifyId, PDO::PARAM_INT);
     if ($stmt->execute()) {
         if ($stmt->rowCount() > 0) {
             while ($row = $stmt->fetch()) {
                 $time = new language($this->db, $this->language);
                 if ($row['notifyFromId'] == 0) {
                     $profileInfo = array("id" => 0, "state" => 0, "username" => "", "fullname" => "", "lowPhotoUrl" => "/img/profile_default_photo.png");
                 } else {
                     $profile = new profile($this->db, $row['notifyFromId']);
                     $profileInfo = $profile->get();
                     unset($profile);
                 }
                 $data = array("id" => $row['id'], "type" => $row['notifyType'], "itemId" => $row['itemId'], "fromUserId" => $profileInfo['id'], "fromUserState" => $profileInfo['state'], "fromUserUsername" => $profileInfo['username'], "fromUserFullname" => $profileInfo['fullname'], "fromUserPhotoUrl" => $profileInfo['lowPhotoUrl'], "createAt" => $row['createAt'], "timeAgo" => $time->timeAgo($row['createAt']));
                 array_push($notifications['notifications'], $data);
                 $notifications['notifyId'] = $row['id'];
                 unset($data);
             }
         }
     }
     return $notifications;
 }
Exemplo n.º 3
0
 /**
  * Fetches the product and adds it as an article to the klarna class. No need to return any data.
  * Articles need to be set for fraud purpose, incorrect article means no_risk invoice. Hereby klarna will not take any risks.
  *
  * @param mixed $mProductId The product identified. Either int or string. Adapted according shop functionality
  * @param Klarna $oKlarna The Klarna class object. Used to set any articles
  * @return void
  */
 protected function fetchProduct($mProductId)
 {
     global $currencies, $currency;
     include DIR_WS_CLASSES . 'language.php';
     $lng = new language();
     if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {
         $lng->set_language($HTTP_GET_VARS['language']);
     } else {
         $lng->get_browser_language();
     }
     $language = $lng->language['directory'];
     $languages_id = $lng->language['id'];
     $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int) $mProductId . "' and pd.products_id = p.products_id and pd.language_id = '" . (int) $languages_id . "'");
     $aProduct_info = tep_db_fetch_array($product_info_query);
     $sArtNo = MODULE_PAYMENT_KLARNA_ARTNO == 'id' || MODULE_PAYMENT_KLARNA_ARTNO == '' ? $aProduct_info['id'] : $aProduct_info['name'];
     $iTax = tep_get_tax_rate($aProduct_info['products_tax_class_id']);
     if (DISPLAY_PRICE_WITH_TAX == 'true') {
         $iPrice_with_tax = $currencies->get_value($currency) * $aProduct_info['products_price'];
     } else {
         $iPrice_with_tax = $currencies->get_value($currency) * $aProduct_info['products_price'] * ($iTax / 100 + 1);
     }
     // Add goods
     $this->oKlarna->addArticle(1, $sArtNo, $aProduct_info['products_name'], $iPrice_with_tax, $iTax, 0, KlarnaFlags::INC_VAT);
     $this->iSum += $iPrice_with_tax;
 }
Exemplo n.º 4
0
 private static function getRightListSub($rights, $setRights, $rid, $modul, $modul_name, $template, $RIGHT)
 {
     $str = '';
     reset($rights);
     while (list($key, $val) = each($rights)) {
         if ($val['mr_parent_id'] == $rid && $val['mr_mod_id'] == $modul) {
             $tmp = self::getRightListSub($rights, $setRights, $val['mr_id'], $modul, $modul_name, $template, $RIGHT);
             if (!empty($setRights) && array_key_exists($val['mr_id'], $setRights)) {
                 $checked = 'checked';
                 $value = $setRights[$val['mr_id']];
             } else {
                 $checked = '';
                 $value = 0;
             }
             page::assign("subright", $tmp);
             page::assign("right", $val['mr_name']);
             page::assign("right_id", $val['mr_id']);
             page::assign("checked", $checked);
             page::assign("value", $value);
             $pos = strpos($val['mr_name'], ' ');
             if ($pos) {
                 $lang_id = substr($val['mr_name'], 0, $pos);
                 $domain_id = substr($val['mr_name'], $pos + 1, strlen($val['mr_name']) - $pos);
                 $domain = new domain($domain_id);
                 $lang = new language($lang_id);
                 page::assign("right_name", $domain->getName() . ' (' . $lang->getName() . ')');
             } else {
                 $right_name = isset($RIGHT[$modul_name][$val['mr_name']]) ? $RIGHT[$modul_name][$val['mr_name']] : $val['mr_name'];
                 page::assign("right_name", $right_name);
             }
             $str .= page::parse($template);
         }
     }
     return $str;
 }
 function listAvailableOrderingsForAdmin(&$config)
 {
     $this->init();
     $this->lang->init($GLOBALS['BE_USER']->uc['lang']);
     // get orderings
     $fieldLabel = $this->lang->sL('LLL:EXT:ke_search/locallang_db.php:tx_kesearch_index.relevance');
     $notAllowedFields = 'uid,pid,tstamp,crdate,cruser_id,starttime,endtime,fe_group,targetpid,content,params,type,tags,abstract,language,orig_uid,orig_pid,hash';
     if (!$config['config']['relevanceNotAllowed']) {
         $config['items'][] = array($fieldLabel . ' UP', 'score asc');
         $config['items'][] = array($fieldLabel . ' DOWN', 'score desc');
     }
     $res = $GLOBALS['TYPO3_DB']->sql_query('SHOW COLUMNS FROM tx_kesearch_index');
     while ($col = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
         if (TYPO3_VERSION_INTEGER >= 7000000) {
             $isInList = TYPO3\CMS\Core\Utility\GeneralUtility::inList($notAllowedFields, $col['Field']);
         } else {
             $isInList = t3lib_div::inList($notAllowedFields, $col['Field']);
         }
         if (!$isInList) {
             $file = $GLOBALS['TCA']['tx_kesearch_index']['columns'][$col['Field']]['label'];
             $fieldLabel = $this->lang->sL($file);
             $config['items'][] = array($fieldLabel . ' UP', $col['Field'] . ' asc');
             $config['items'][] = array($fieldLabel . ' DOWN', $col['Field'] . ' desc');
         }
     }
 }
Exemplo n.º 6
0
function getSiteLanguage($get = null)
{
    $default = array('dir' => 'dutch', 'id' => '1', 'code' => 'nl');
    if (!tep_session_is_registered('language') || isset($_GET['language'])) {
        if (!tep_session_is_registered('language')) {
            tep_session_register('language');
            tep_session_register('languages_id');
            tep_session_register('languages_code');
        }
        include DIR_WS_CLASSES . 'language.php';
        $lng = new language();
        if (isset($_GET['language']) && tep_not_null($_GET['language'])) {
            $lng->set_language($_GET['language']);
        } else {
            $lng->get_browser_language();
            if (empty($lng)) {
                $lng->set_language(DEFAULT_LANGUAGE);
            }
        }
        $default = array('dir' => $lng->language['directory'], 'id' => $lng->language['id'], 'code' => $lng->language['code']);
    }
    if ($get && isset($default[$get])) {
        return $default[$get];
    }
    return $default;
}
Exemplo n.º 7
0
 public function __construct()
 {
     $this->BASE_FILE = ROOT_URL . 'Membre.php';
     $this->lng = language::getinstance()->GetLngBlock('membre');
     parent::__construct();
     $this->page_title = $this->lng['page_title'];
 }
Exemplo n.º 8
0
 public function __construct()
 {
     $this->BASE_FILE = ROOT_URL . 'pillage.php';
     $this->ress = DataEngine::a_ressources();
     $this->lng = language::getinstance()->GetLngBlock('pillage');
     parent::__construct();
 }
Exemplo n.º 9
0
 public function process()
 {
     if (!parent::process()) {
         $this->redirectNoSession();
     }
     $containers = array();
     $containerClassFiles = scandir(\base_config::$baseDir . '/inc/dashcontainers/');
     foreach ($containerClassFiles as $containerClassFile) {
         if (strpos($containerClassFile, '.php') === false) {
             continue;
         }
         $containerClassFile = str_replace('.php', '', $containerClassFile);
         $containerObject = new $containerClassFile($this);
         if (is_a($containerObject, '\\interfaces\\dashcontainer')) {
             $containerPosition = $containerObject->getPosition();
             if (isset($containers[$containerPosition])) {
                 $containerPosition++;
             }
             $containers[$containerPosition] = new \model\dashboard_container($containerObject->getBoxName(), $containerObject->getBoxHeadline(), $containerObject->getBoxContent(), $containerObject->getSize(), $containerObject->getHeight());
         } else {
             $message = \language::replaceLanguageConstant(\language::returnLanguageConstant('DASH_CONTAINER_INSTANCE'), array('{{dashcontainer}}' => $containerClassFile));
             \messages::registerError($message);
         }
     }
     if (count($containers) >= 1) {
         ksort($containers);
     }
     $view = new \model\view_acp('dashboard');
     $view->assign('statsContainers', $containers);
     $view->render();
 }
Exemplo n.º 10
0
 public function process()
 {
     if (!parent::process()) {
         $this->redirectNoSession();
     }
     if (!is_null($this->getRequestVar('affiliateDelList'))) {
         $affiliateIds = $this->getRequestVar('affiliateDelList');
         foreach ($affiliateIds as $affiliateId) {
             $affiliate = new \model\affiliate($this->getDbconnection(), $this->filterRequest($affiliateId, array(1, 4, 7)));
             $affiliate->delete();
         }
         $this->redirect('affiliate/list', array('affiliatedeleted=yes'));
     }
     $affiliateList = new \model\affiliate_list($this->getDbconnection());
     $affiliateList->setGroupByCategory(true);
     if (!is_null($this->getRequestVar('affiliateadded'))) {
         \messages::registerMessage(\language::returnLanguageConstant('SAVE_SUCCESS_ADDAFFILIATE'));
     }
     if (!is_null($this->getRequestVar('affiliateedited'))) {
         \messages::registerMessage(\language::returnLanguageConstant('SAVE_SUCCESS_EDITAFFILIATE'));
     }
     if (!is_null($this->getRequestVar('affiliatedeleted'))) {
         \messages::registerMessage(\language::returnLanguageConstant('DELETE_SUCCESS_AFFILIATES'));
     }
     $view = new \model\view_acp('affiliate_list');
     $view->assign('theList', $affiliateList->getAffiliates());
     $view->assign('dtMask', $this->getSysconfig()->getDateTimeMask());
     $view->render();
 }
Exemplo n.º 11
0
 public function process()
 {
     if (!parent::process()) {
         $this->redirectNoSession();
     }
     $category = new \model\category($this->getDbconnection());
     if (!is_null($this->getRequestVar('submupload'))) {
         $newFile = new \model\file();
         $icon = $newFile->uploadFile();
         $category->setIconPath($icon);
     }
     if (!is_null($this->getRequestVar('category'))) {
         $data = $this->getRequestVar('category');
         foreach ($data as $key => $value) {
             $data[$key] = $this->filterRequest($value, array(1, 4, 7));
         }
         $category->setName($data['name']);
         $category->setIconPath($data['iconPath']);
         $category->setIsPrivate($data['isPrivate']);
         if ($category->save()) {
             $this->redirect('category/list', array('categoryadded=yes'));
         } else {
             \messages::registerError(\language::returnLanguageConstant('SAVE_FAILED_CATEGORY'));
         }
     } else {
         $category->setIsPrivate(0);
     }
     $view = new \model\view_acp('category_editor');
     $view->assign('category', $category);
     $view->assign('editormode', 0);
     $view->assign('headlinetext', \language::returnLanguageConstant('HL_CATEGORIES_ADD'));
     $view->render();
 }
Exemplo n.º 12
0
 public function __construct()
 {
     parent::__construct();
     $lng = language::getinstance()->GetLngBlock('dataengine');
     $this->CronPattern = $lng['wormholes_cron'];
     $this->lastrun = DataEngine::config_key('wormhole_cleaning', 'lastrun');
 }
Exemplo n.º 13
0
 public function process()
 {
     if (!parent::process()) {
         $this->redirectNoSession();
     }
     $categoryId = $this->getRequestVar('categoryid', array(1, 4, 7));
     if (is_null($categoryId)) {
         $this->redirect('category/list');
     }
     $category = new \model\category($this->getDbconnection(), $categoryId);
     if (!is_null($this->getRequestVar('category'))) {
         $data = $this->getRequestVar('category');
         foreach ($data as $key => $value) {
             $data[$key] = $this->filterRequest($value, array(1, 4, 7));
         }
         $category->setName($data['name']);
         $category->setIconPath($data['iconPath']);
         $category->setIsPrivate($data['isPrivate']);
         if ($category->update()) {
             $this->redirect('category/list', array('categoryedited=yes'));
         } else {
             \messages::registerError(\language::returnLanguageConstant('SAVE_FAILED_CATEGORY'));
         }
     }
     $view = new \model\view_acp('category_editor');
     $view->assign('category', $category);
     $view->assign('editormode', 1);
     $view->assign('systemmode', $this->getSysconfig()->getSystemMode());
     $view->assign('headlinetext', \language::returnLanguageConstant('HL_CATEGORIES_EDIT'));
     $view->assign('dtMask', $this->getSysconfig()->getDateTimeMask());
     $view->render();
 }
Exemplo n.º 14
0
 public function __construct()
 {
     $this->BASE_FILE = ROOT_URL . "Carte.php";
     $this->map = map::getinstance();
     $this->lng = language::getinstance()->GetLngBlock('carte');
     parent::__construct();
 }
Exemplo n.º 15
0
 public function runUpdate($fileList = array())
 {
     $view = new \model\view_installer('updater');
     $view->assign('version', $this->sysconfig->getSysVersion());
     include \base_config::$baseDir . '/version.php';
     $this->updateConfigKey('sysVersion', $afltrVersion);
     if (file_exists(\base_config::$updateCache)) {
         @unlink(\base_config::$updateCache);
     }
     $fileDeleteList = array('/inc/model/model_base.php', '/inc/model/dashcontainerbox.php', '/inc/lib/jquery/jquery-1.10.2.min.js');
     foreach ($fileDeleteList as $fileDelete) {
         if (file_exists(\base_config::$baseDir . $fileDelete)) {
             @unlink(\base_config::$baseDir . $fileDelete);
         }
     }
     $file = new \model\file();
     if (is_dir(base_config::$baseDir . '/inc/lib/lightbox')) {
         $file->deleteRecursive(base_config::$baseDir . '/inc/lib/lightbox');
     }
     if (is_dir(base_config::$baseDir . '/inc/lib/jquery_ui')) {
         $file->deleteRecursive(base_config::$baseDir . '/inc/lib/jquery_ui');
     }
     if (!file_exists(base_config::$uploadDir . '/banners')) {
         mkdir(base_config::$uploadDir . '/banners');
     }
     $this->createConfigKey('timeZone', 'Europe/Berlin');
     $newVersion = $this->dbconnection->select("config", "config_value", "config_key LIKE 'sysVersion'");
     \messages::registerMessage(\language::returnLanguageConstant('UPDATE_SUCCESS'), true);
     $view->assign('newVersion', $newVersion[0]['config_value']);
     $view->assign('fileList', $fileList);
     $view->render();
 }
Exemplo n.º 16
0
 public function process()
 {
     if (!parent::process()) {
         $this->redirectNoSession();
     }
     if (!is_null($this->getRequestVar('submupload'))) {
         $newFile = new \model\file();
         $newFile->uploadFile(\base_config::$bannerDir);
     }
     if (!is_null($this->getRequestVar('fileDelList'))) {
         $deleted = false;
         $files = $this->getRequestVar('fileDelList');
         foreach ($files as $fileName) {
             $file = new \model\file($fileName, \base_config::$bannerDir);
             if ($file->delete()) {
                 $deleted = true;
             }
         }
         if ($deleted) {
             \messages::registerMessage(\language::returnLanguageConstant('DELETE_SUCCESS_FILES'));
         }
     }
     $fileList = new \model\file_list(\base_config::$bannerDir);
     $view = new \model\view_acp('banner_list');
     $view->assign('fileList', $fileList->getFileList());
     $view->assign('dtMask', $this->getSysconfig()->getDateTimeMask());
     $view->render();
 }
Exemplo n.º 17
0
 /**
  * @return language
  */
 public static function getinstance()
 {
     if (!self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
 public function GetCustomPerms()
 {
     $lng = language::getinstance()->GetLngBlock(LNG_CODE, SCANNER_PATH);
     $value = array();
     $value[1000] = $lng['conf_perms'];
     $value['ADVANCED_SCANNER'] = $lng['conf_perms_global'];
     return $value;
 }
Exemplo n.º 19
0
 public function __construct()
 {
     $this->BASE_FILE = ROOT_URL . 'cartographie.php';
     $this->BASE_GET = Get_string();
     $this->lng = language::getinstance()->GetLngBlock('cartographie');
     $this->SetheaderInput();
     parent::__construct();
 }
Exemplo n.º 20
0
 public function __construct()
 {
     $this->lng = language::getinstance()->GetLngBlock('ownuniverse');
     foreach (DataEngine::a_ressources() as $v) {
         $this->ressourcesnames[$v['Field']] = $v['Nom'];
     }
     $this->BatimentsName = DataEngine::a_batiments();
     $this->parser = parser::getinstance();
 }
Exemplo n.º 21
0
 public function run()
 {
     $tpl = new template();
     $id = (int) $_GET['id'];
     $language = new language();
     $language->setModule('leads');
     $language->readIni();
     if ($id > 0) {
         if (isset($_POST['delete'])) {
             $this->deleteLead($id);
             $tpl->setNotification($language->lang_echo('LEAD_DELETED'), 'success');
         }
         $tpl->assign('lead', $this->getLead($id));
     } else {
         $tpl->display('general.error');
     }
     $tpl->display('leads.deleteLead');
 }
Exemplo n.º 22
0
 /**
  * Loads the language data and returns the corresponding translator instance.
  *
  * @return language
  */
 protected function getInitializedTranslator()
 {
     if ($this->translator === NULL) {
         if (isset($GLOBALS['LANG'])) {
             $this->translator = $GLOBALS['LANG'];
         } else {
             $this->translator = t3lib_div::makeInstance('language');
             if (isset($GLOBALS['BE_USER'])) {
                 $this->translator->init($GLOBALS['BE_USER']->uc['lang']);
             } else {
                 $this->translator->init('default');
             }
         }
         $this->translator->includeLLFile(t3lib_extMgm::extPath('lang') . 'locallang_general.xml');
         $this->translator->includeLLFile(t3lib_extMgm::extPath('seminars') . 'locallang_db.xml');
         $this->includeAdditionalLanguageFiles();
     }
     return $this->translator;
 }
Exemplo n.º 23
0
 function create_plugin_instance()
 {
     global $oLang, $aLang;
     $dbconn =& oosDBGetConn();
     $oostable =& oosDBGetTables();
     $aPages = oos_get_pages();
     if (!isset($_SESSION['language']) || isset($_GET['language'])) {
         MyOOS_CoreApi::requireOnce('classes/class_language.php');
         $oLang = new language();
         if (isset($_GET['language']) && oos_is_not_null($_GET['language'])) {
             $oLang->set($_GET['language']);
         } else {
             $oLang->get_browser_language();
         }
     }
     $sLanguage = oos_var_prep_for_os($_SESSION['language']);
     include 'includes/languages/' . $sLanguage . '.php';
     return true;
 }
Exemplo n.º 24
0
    function create_plugin_instance() {
      global $oLang, $aLang;

      if (!isset($_SESSION['language']) || isset($_GET['language'])) {

        MyOOS_CoreApi::requireOnce('classes/class_language.php');

        $oLang = new language();

        if (isset($_GET['language']) && !empty($_GET['language'])) {
          $oLang->set($_GET['language']);
        } else {
          $oLang->get_browser_language();
        }
      }

      return true;

    }
Exemplo n.º 25
0
 public function __construct()
 {
     $this->BASE_FILE = ROOT_URL . 'Cartedetail.php';
     $this->lng = language::getinstance()->GetLngBlock('cartedetails');
     $this->bulle1 = bulle($this->lng['bulle1']);
     $this->bulle2 = bulle($this->lng['bulle2']);
     $this->lngtype = language::getinstance()->GetLngBlock('dataengine');
     $this->lngtype = $this->lngtype['types']['imgurl'];
     parent::__construct();
 }
Exemplo n.º 26
0
 /**
  * Returns the configuration for the flex forms field
  * "showRegistrationFieldsInRegistrationList" with the selectable database
  * columns.
  *
  * @param array[] $configuration the flex forms configuration
  *
  * @return array[] the modified flex forms configuration including the selectable database columns
  */
 public function getShowRegistrationFieldsInRegistrationList(array $configuration)
 {
     foreach ($this->getColumnsOfTable('tx_seminars_attendances') as $column) {
         $label = $this->language->getLL('label_' . ($column == 'uid' ? 'registration_' : '') . $column);
         if ($label == '') {
             $label = $column;
         }
         $configuration['items'][] = array(0 => $label, 1 => $column);
     }
     return $configuration;
 }
Exemplo n.º 27
0
 /**
  * Default data for main page.
  */
 public function init()
 {
     // title is globally also for 404 pages.
     $serial_title = property::getInstance()->get('seo_title');
     $serial_desc = property::getInstance()->get('seo_description');
     $serial_keywords = property::getInstance()->get('seo_keywords');
     $this->metadata['title'][] = $serial_title[language::getInstance()->getUseLanguage()];
     if (router::getInstance()->isMain()) {
         $this->metadata['description'][] = $serial_desc[language::getInstance()->getUseLanguage()];
         $this->metadata['keywords'][] = $serial_keywords[language::getInstance()->getUseLanguage()];
     }
     $this->metadata['global_title'] = $serial_title[language::getInstance()->getUseLanguage()];
 }
Exemplo n.º 28
0
 public function process()
 {
     $affiliate = new \model\affiliate($this->getDbconnection());
     if (!is_null($this->getRequestVar('submsave')) && !is_null($this->getRequestVar('antiSpamAnswer'))) {
         if ($this->getRequestVar('antiSpamAnswer') === $this->getSysconfig()->getAntispamAnswer()) {
             $data = $this->getRequestVar('affiliate');
             foreach ($data as $key => $value) {
                 $data[$key] = $this->filterRequest($value, array(1, 4, 7));
             }
             $affiliate->setPageName($data['pageName']);
             $affiliate->setPageUrl($data['pageUrl']);
             $affiliate->setPageAdminName($data['pageAdminName']);
             $affiliate->setPageAdminEmail($data['pageAdminEmail']);
             $affiliate->setPageButton($data['pageButton']);
             $affiliate->setAffiliateCategory($data['affiliateCategory']);
             $affiliate->setAffiliateAddedTime(time());
             $affiliate->setAffiliateEditedTime(0);
             $affiliate->setAffiliateIsMarked(0);
             $affiliate->setAffiliateIsAccpted(0);
             if ($affiliate->save()) {
                 \messages::registerNotice(\language::returnLanguageConstant('APPLY_OK'));
                 $catgory = new \model\category($this->dbconnection, $affiliate->getAffiliateCategory());
                 $mailData = array('mailTo' => $this->getSysconfig()->getAdminMail(), 'mailSubject' => \language::replaceLanguageConstant(\language::returnLanguageConstant('APPLY_MAIL_SUBJECT'), array('{{affiliateKategory}}' => $catgory->getName())), 'mailText' => \language::replaceLanguageConstant(\language::returnLanguageConstant('APPLY_MAIL_TEXT'), array('{{name}}' => $affiliate->getPageAdminName(), '{{page}}' => $affiliate->getPageUrl(), '{{affiliateKategory}}' => $catgory->getName(), '{{acpLink}}' => \base_config::$rootPath)), 'mailFrom' => $affiliate->getPageAdminEmail());
                 \messages::sendEMail($mailData);
             } else {
                 \messages::registerError(\language::returnLanguageConstant('APPLY_FAILED'));
             }
             $affiliate = new \model\affiliate($this->getDbconnection());
         } else {
             \messages::registerError(\language::returnLanguageConstant('APPLY_FAILED_SPAM'));
         }
     }
     $categoryList = new \model\category_list($this->getDbconnection(), false);
     $categories = array();
     foreach ($categoryList->getCategories() as $category) {
         $categories[$category->getName()] = $category->getId();
     }
     $view = new \model\view_public('apply_form');
     $view->assign('affiliate', $affiliate);
     $view->assign('categories', $categories);
     $view->assign('antiSpamQuestion', $this->getSysconfig()->getAntispamQuestion());
     $view->assign('isNotUtf8', $this->isNotUtf8);
     $view->assign('systemVersion', $this->getSysconfig()->getSysVersion());
     $view->setReturnRender($this->returnRender);
     if ($this->returnRender) {
         $data = $view->render();
         return $data;
     }
     $view->render();
 }
Exemplo n.º 29
0
 public static function browser_language()
 {
     if (language::$browser_language === NULL) {
         language::$browser_language = '';
         $browser_languages = Kohana::user_agent('languages');
         foreach ($browser_languages as $language) {
             if (strlen($language) == 2 and array_key_exists($language, language::$available_languages)) {
                 language::$browser_language = strtolower($language);
                 break;
             }
         }
     }
     return language::$browser_language;
 }
Exemplo n.º 30
0
 public function process()
 {
     if (!parent::process()) {
         $this->redirectNoSession();
     }
     $file = new \model\file();
     if (!unlink(\base_config::$updateCache)) {
         \messages::logSystem('Unable to clear cache!');
         \messages::registerError(\language::returnLanguageConstant('CACHE_CLEARED_FAILED'));
     } else {
         \messages::registerMessage(\language::returnLanguageConstant('CACHE_CLEARED_OK'));
     }
     \messages::showMessages();
     die;
 }