Пример #1
0
 public function routeShutdown(Zend_Controller_Request_Abstract $request)
 {
     $useModule = array('default', 'mice');
     if (in_array($request->getModuleName(), $useModule) and $this->getRequest()->getParam('language') != 'scripts') {
         Zend_Db_Table_Abstract::setDefaultAdapter(Zend_Registry::get('read'));
     } else {
         Zend_Db_Table_Abstract::setDefaultAdapter(Zend_Registry::get('write'));
     }
     if (in_array($request->getModuleName(), $useModule) and $this->getRequest()->getParam('language') != 'scripts') {
         $language = $this->getRequest()->getParam('language');
         if (empty($language)) {
             $language = 'id';
         }
         // Model
         $dictionaryDb = new Model_DbTable_Dictionary();
         $languageDb = new Model_DbTable_Language();
         // Data
         $dictionary = $dictionaryDb->getDictionaryArray($language);
         $languageId = $languageDb->getIdByName($language);
         try {
             // Translator Zend
             $translate = new Zend_Translate('array', $dictionary, $language);
             // Set registry
             Zend_Registry::set('Zend_Translate', $translate);
             Zend_Registry::set('language', $language);
             Zend_Registry::set('languageId', $languageId['language_id']);
             Zend_Registry::set('languageText', $languageId['language_text']);
         } catch (Zend_Translate_Exception $zte) {
         } catch (Zend_Exception $ze) {
         }
     }
 }
 public function init()
 {
     parent::init();
     $this->view->assets = $this->_request->getBaseUrl();
     define("LIMIT", 7);
     //konstanta untuk mengatur jumlah content per page
     define("NUM_LINKS", 7);
     //konstanta untuk mengatur jumlah link page
     $getLang = new Model_DbTable_Language();
     $lang = $getLang->getNameById($this->_languageId);
     $this->lang = $lang->language_name;
     $this->_helper->layout->setLayout('one-column');
     //$destinationDesc = new Model_DbTable_DestinationDescription;
     //$a = $destinationDesc->getNameById(33,1);
     //
     //echo $a;
 }
Пример #3
0
 protected function _sendEmail($msg, $fromName, $fromEmail, $subject, $toEmail)
 {
     // Inisialisasi Zend_Mail_Transport
     $transport = new Zend_Mail_Transport_Smtp(SMTP_HOST, array('port' => 25));
     $transport->EOL = "\r\n";
     Zend_Mail::setDefaultTransport($transport);
     // Buat Zend_Mail properti
     $mail = new Zend_Mail();
     $mail->setFrom($fromEmail, $fromName);
     $mail->setSubject($subject);
     // Cek email tujuan
     if (is_array($toEmail)) {
         for ($i = 0; $i < count($toEmail); $i++) {
 public function listlang()
 {
     $getLang = new Model_DbTable_Language();
     $lang = $getLang->getAllLang();
     return $lang;
 }