• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Shineisp_Commons_Utilities类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Shineisp_Commons_Utilities的典型用法代码示例。如果您正苦于以下问题:PHP Shineisp_Commons_Utilities类的具体用法?PHP Shineisp_Commons_Utilities怎么用?PHP Shineisp_Commons_Utilities使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Shineisp_Commons_Utilities类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: init

 public function init()
 {
     // Set the custom decorator
     $this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
     $translate = Shineisp_Registry::get('Zend_Translate');
     $this->addElement('text', 'creationdate', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Date'), 'title' => $translate->_('eg: 01/11/2010'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat()));
     $this->addElement('text', 'expiringdate', array('filters' => array('StringTrim'), 'label' => $translate->_('Expiry Date'), 'title' => $translate->_('eg: 01/11/2011'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat()));
     $this->addElement('text', 'paymentdate', array('filters' => array('StringTrim'), 'label' => $translate->_('Payment Date'), 'title' => $translate->_('eg: 01/11/2010'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat()));
     $this->addElement('select', 'category_id', array('label' => $translate->_('Category'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->getElement('category_id')->setAllowEmpty(false)->setMultiOptions(PurchaseCategories::getList());
     $this->addElement('select', 'method_id', array('label' => $translate->_('Payment Method'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->getElement('method_id')->setAllowEmpty(false)->setMultiOptions(PaymentsMethods::getList());
     $this->addElement('text', 'number', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Number'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'company', array('filters' => array('StringTrim'), 'label' => $translate->_('Company'), 'required' => true, 'title' => $translate->_('eg: Google inc.'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'total_net', array('filters' => array('StringTrim'), 'label' => $translate->_('Total Net'), 'required' => true, 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'total_vat', array('filters' => array('StringTrim'), 'label' => $translate->_('Total VAT'), 'required' => true, 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('text', 'total', array('filters' => array('StringTrim'), 'label' => $translate->_('Total'), 'required' => true, 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->addElement('textarea', 'note', array('filters' => array('StringTrim'), 'label' => $translate->_('Note'), 'decorators' => array('Bootstrap'), 'class' => 'col-lg-12 form-control'));
     // If the browser client is an Apple client hide the file upload html object
     if (false == Shineisp_Commons_Utilities::isAppleClient()) {
         $MBlimit = Settings::findbyParam('adminuploadlimit');
         $Byteslimit = Shineisp_Commons_Utilities::MB2Bytes($MBlimit);
         $filetypes = Settings::findbyParam('adminuploadfiletypes', 'Admin');
         $file = $this->createElement('file', 'document', array('label' => $translate->_('Document'), 'decorators' => array('File', array('ViewScript', array('viewScript' => 'partials/file.phtml', 'placement' => false))), 'description' => $translate->_('Select the document to upload. Files allowed are (%s) - Max %s', $filetypes, Shineisp_Commons_Utilities::formatSizeUnits($Byteslimit)), 'data-classButton' => 'btn btn-primary', 'data-input' => 'false', 'class' => 'filestyle'));
         $file->addValidator('Extension', false, $filetypes)->addValidator('Size', false, $Byteslimit)->addValidator('Count', false, 1);
         $file->setValueDisabled(true);
         $file->setRequired(false);
         $this->addElement($file);
     }
     $this->addElement('select', 'status_id', array('label' => $translate->_('Status'), 'required' => true, 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
     $this->getElement('status_id')->setAllowEmpty(false)->setMultiOptions(Statuses::getList('orders'));
     $this->addElement('hidden', 'purchase_id');
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:33,代码来源:PurchasesForm.php


示例2: saveConfig

 /**
 * Save the setup data
 * @param array $dbconfig
 * @param array $preferences
 * 
 * <?xml version="1.0" encoding="UTF-8"?>
 		<shineisp>
 			<config>
 				<database>
 					<hostname>localhost</hostname>
 					<db>shineisp</db>
 					<username>shineisp</username>
 					<password>shineisp2013</password>
 				</database>
 			</config>
 		</shineisp>
 */
 public static function saveConfig($dbconfig, $version = null)
 {
     try {
         $xml = new SimpleXMLElement('<shineisp></shineisp>');
         if (!empty($version)) {
             $xml->addAttribute('version', $version);
         }
         $xml->addAttribute('setupdate', date('Ymdhis'));
         $config = $xml->addChild('config');
         // Database Configuration
         $database = $config->addChild('database');
         $database->addChild('hostname', $dbconfig->hostname);
         $database->addChild('username', $dbconfig->username);
         $database->addChild('password', $dbconfig->password);
         $database->addChild('database', $dbconfig->database);
         // Get the xml string
         $xmlstring = $xml->asXML();
         // Prettify and save the xml configuration
         $dom = new DOMDocument();
         $dom->loadXML($xmlstring);
         $dom->formatOutput = true;
         $dom->saveXML();
         // Save the config xml file
         if (@$dom->save(APPLICATION_PATH . "/configs/config.xml")) {
             Shineisp_Commons_Utilities::log("Update ShineISP config xml file");
             return true;
         } else {
             throw new Exception("Error on saving the xml file in " . APPLICATION_PATH . "/configs/config.xml <br/>Please check the folder permissions");
         }
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
     return false;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:51,代码来源:Settings.php


示例3: checkFields

 protected function checkFields()
 {
     parent::checkFields();
     if ($this->amount == NULL) {
         throw new IgfsMissingParException("Missing amount");
     }
     if ($this->refTranID == NULL) {
         if ($this->pan == NULL) {
             if ($this->payInstrToken == NULL) {
                 Shineisp_Commons_Utilities::logs("---> Missing refTranID", 'bnl_igfs.log');
             }
         }
     }
     return false;
     if ($this->pan != NULL) {
         // Se è stato impostato il pan verifico...
         if ($this->pan == "") {
             Shineisp_Commons_Utilities::logs("---> Missing pan", 'bnl_igfs.log');
         }
         return false;
     }
     if ($this->payInstrToken != NULL) {
         // Se è stato impostato il payInstrToken verifico...
         if ($this->payInstrToken == "") {
             Shineisp_Commons_Utilities::logs("---> Missing payInstrToken", 'bnl_igfs.log');
         }
         return false;
     }
     if ($this->pan != NULL or $this->payInstrToken != NULL) {
         if ($this->currencyCode == NULL) {
             Shineisp_Commons_Utilities::logs("---> Missing currencyCode", 'bnl_igfs.log');
         }
         return false;
     }
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:35,代码来源:CgCredit.php


示例4: init

 public function init()
 {
     $NS = new Zend_Session_Namespace('Default');
     $translate = Shineisp_Registry::get('Zend_Translate');
     // Set the custom decorator
     $this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
     $this->addElement('select', 'domain_id', array('decorators' => array('Bootstrap'), 'required' => false, 'label' => $translate->_('Domain'), 'description' => $translate->_('Choose the domain name reference'), 'class' => 'form-control large-input'));
     $this->getElement('domain_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Domains::getList(true, $NS->customer['customer_id']));
     $this->addElement('text', 'subject', array('filters' => array('StringTrim'), 'required' => false, 'decorators' => array('Bootstrap'), 'title' => $translate->_('Write here a subject of the issue.'), 'label' => $translate->_('Subject'), 'description' => $translate->_('Write here the domain name or a simple description of the problem.'), 'class' => 'form-control large-input'));
     $this->addElement('textarea', 'note', array('filters' => array('StringTrim'), 'label' => $translate->_('Body Message'), 'decorators' => array('Bootstrap'), 'description' => $translate->_('Write here all the information.'), 'rows' => '8', 'class' => 'form-control wysiwyg-simple'));
     $this->addElement('select', 'status', array('filters' => array('StringTrim'), 'label' => $translate->_('Set the issue status'), 'decorators' => array('Bootstrap'), 'class' => 'form-control large-input', 'multioptions' => array('' => '', Statuses::id("solved", "tickets") => $translate->_('Solved'), Statuses::id("closed", "tickets") => $translate->_('Closed'))));
     $this->addElement('select', 'category_id', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Category'), 'description' => 'Select a category.', 'class' => 'form-control large-input'));
     $this->getElement('category_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(TicketsCategories::getList(true));
     if (false == Shineisp_Commons_Utilities::isAppleClient()) {
         $MBlimit = Settings::findbyParam('useruploadlimit');
         $Types = Settings::findbyParam('useruploadfiletypes');
         if (empty($MBlimit)) {
             $MBlimit = 1;
         }
         if (empty($Types)) {
             $Types = "zip,jpg";
         }
         $Byteslimit = Shineisp_Commons_Utilities::MB2Bytes($MBlimit);
         $file = $this->createElement('file', 'attachments', array('label' => $translate->_('Attachment'), 'description' => $translate->_('Select the document to upload. Files allowed are (%s) - Max %s', $Types, Shineisp_Commons_Utilities::formatSizeUnits($Byteslimit))));
         $file->addValidator('Extension', false, $Types)->addValidator('Size', false, $Byteslimit)->addValidator('Count', false, 1);
         $this->addElement($file);
     } else {
         $this->addElement('hidden', 'attachments');
     }
     $this->addElement('submit', 'submit', array('label' => $translate->_('Send help request'), 'decorators' => array('Bootstrap'), 'class' => 'btn btn-primary btn-lg'));
     $this->addElement('hidden', 'ticket_id');
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:32,代码来源:TicketsForm.php


示例5: callbackAction

 /**
  * callbackAction
  * This method isn't called from the project 
  * but it is called from a bank gateway service 
  * in order to set as payed the order processed
  *	 
  * IMPORTANT:
  * This method was within the /default/orders controller and it has been moved here
  * because the access to the /default/orders is denied without an authentication process
  * /default/common controller is accessible without login process.
  */
 public function callbackAction()
 {
     $request = $this->getRequest();
     $response = $request->getParams();
     if (!empty($response['custom']) && is_numeric(trim($response['custom']))) {
         // Getting the md5 value in order to match with the class name.
         $classrequest = $request->gateway;
         // Orderid back from the bank
         $order_id = trim($response['custom']);
         // Get the bank selected using the MD5 code
         $bank = Banks::findbyMD5($classrequest);
         if (!empty($bank[0]['classname'])) {
             if (!empty($bank[0]['classname']) && class_exists($bank[0]['classname'])) {
                 $class = $bank[0]['classname'];
                 $payment = new $class($response['custom']);
                 // Check if the method "Response" exists in the Payment class and send all the bank information to the payment module
                 if (method_exists($class, "Response")) {
                     Shineisp_Commons_Utilities::logs("Callback called: {$class}\nParameters: " . json_encode($response), "payments.log");
                     $payment->Callback($response);
                 }
             }
         }
     }
     die;
 }
开发者ID:moay,项目名称:shineisp,代码行数:36,代码来源:CommonController.php


示例6: preStmtExecute

 public function preStmtExecute(Doctrine_Event $event)
 {
     // Check if the administrator has enabled the query logging feature
     if (Settings::findbyParam('debug_queries')) {
         $breadcrumps = array();
         $query = $event->getQuery();
         $params = $event->getParams();
         $callers = array_reverse(debug_backtrace(), true);
         $callers = array_slice($callers, 4, count($callers) - 10);
         foreach ($callers as $caller) {
             $class = !empty($caller['class']) ? $caller['class'] : null;
             $breadcrumps[] = $class . "->" . $caller['function'];
         }
         $strBreadcrump = "System: " . implode(" / ", $breadcrumps);
         //the below makes some naive assumptions about the queries being logged
         while (sizeof($params) > 0) {
             $param = array_shift($params);
             if (!is_numeric($param)) {
                 $param = sprintf("'%s'", $param);
             }
             $query = substr_replace($query, $param, strpos($query, '?'), 1);
         }
         Shineisp_Commons_Utilities::log($query, "queries.log");
         Shineisp_Commons_Utilities::log($strBreadcrump, "debug.log", Zend_Log::DEBUG);
         // Increase query counter
         $queryCount = Shineisp_Registry::isRegistered('querycount') ? Shineisp_Registry::get('querycount') : 0;
         $queryCount = $queryCount + 1;
         Shineisp_Registry::set('querycount', $queryCount);
     }
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:30,代码来源:QueriesLogger.php


示例7: eu_check

 private function eu_check()
 {
     $isp = Shineisp_Registry::get('ISP');
     $VIES = new SoapClient($this->vies_soap_url);
     if ($VIES) {
         try {
             $r = $VIES->checkVat(array('countryCode' => $this->countryCode, 'vatNumber' => $this->vat));
             foreach ($r as $chiave => $valore) {
                 $this->viesOutput[$chiave] = $valore;
             }
             return $r->valid;
         } catch (SoapFault $e) {
             $ret = $e->faultstring;
             $regex = '/\\{ \'([A-Z_]*)\' \\}/';
             $n = preg_match($regex, $ret, $matches);
             $ret = !empty($matches[1]) ? $matches[1] : $ret;
             $faults = array('INVALID_INPUT' => 'The provided CountryCode is invalid or the VAT number is empty', 'SERVICE_UNAVAILABLE' => 'The SOAP service is unavailable, try again later', 'MS_UNAVAILABLE' => 'The Member State service is unavailable, try again later or with another Member State', 'TIMEOUT' => 'The Member State service could not be reached in time, try again later or with another Member State', 'SERVER_BUSY' => 'The service cannot process your request. Try again later.');
             $ret = $faults[$ret];
             // adding a log message
             Shineisp_Commons_Utilities::log("Response from VIES: " . $ret);
             $subject = 'Invalid VAT code';
             $body = "Response from VIES: " . $ret;
             Shineisp_Commons_Utilities::SendEmail($isp->email, $isp->email, null, $subject, $body);
             return false;
         }
     } else {
         $subject = 'Connect to VIES';
         $body = "Impossible to connect with VIES";
         Shineisp_Commons_Utilities::SendEmail($isp->email, $isp->email, null, $subject, $body);
         // adding a log message
         Shineisp_Commons_Utilities::log("Response from VIES: " . $ret);
         return false;
     }
     return true;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:35,代码来源:Vat.php


示例8: showblock

 /**
  * showblock
  * Handle the XML Blocks 
  * @param unknown_type $side
  */
 public function showblock($side)
 {
     $ns = new Zend_Session_Namespace('Admin');
     $languageID = Languages::get_language_id($ns->lang);
     $record = array();
     $blocks = array();
     // Get the main variables
     $module = Zend_Controller_Front::getInstance()->getRequest()->getModuleName();
     $controller = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();
     $action = Zend_Controller_Front::getInstance()->getRequest()->getActionName();
     $customskin = Settings::findbyParam('adminskin');
     $skin = !empty($customskin) ? $customskin : "base";
     // call the placeholder view helper for each side parsed
     echo $this->view->placeholder($side);
     // Get all the xml blocks
     $xmlblocks = Shineisp_Commons_Layout::getBlocks($module, $side, $controller, $skin);
     if (!empty($xmlblocks)) {
         $blocks['reference'] = $xmlblocks;
     }
     if (!empty($blocks['reference'])) {
         $blocks['reference'] = Shineisp_Commons_Utilities::columnSort($blocks['reference'], 'position');
     }
     if (isset($blocks['reference']['block'])) {
         $this->Iterator($blocks['reference'], $side);
     } elseif (isset($blocks['reference'][0])) {
         foreach ($blocks['reference'] as $block) {
             $this->Iterator($block, $side);
         }
     }
     $this->view->module = $module;
     $this->view->controller = $controller;
     $this->view->action = $action;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:38,代码来源:Blocks.php


示例9: errorAction

 public function errorAction()
 {
     $errors = $this->_getParam('error_handler');
     $mex = $this->_getParam('mex');
     // Ajax controll
     if (Shineisp_Commons_Utilities::isAjax()) {
         echo json_encode($errors->exception->getMessage());
         die;
     }
     switch ($errors->type) {
         case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
             // 404 error -- controller or action not found
             $this->getResponse()->setHttpResponseCode(404);
             $this->view->message = 'Controller has been not found';
             break;
         case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
             // 404 error -- controller or action not found
             $this->getResponse()->setHttpResponseCode(404);
             $this->view->message = 'Action has been not found';
             break;
         default:
             // application error
             $this->getResponse()->setHttpResponseCode(500);
             $this->view->message = $errors->exception->getMessage();
             break;
     }
     if (!empty($mex)) {
         $this->view->message .= "<br/><b>{$mex}</b>";
     }
     // Save the error message in the log file errors.log
     $errormessage = $errors->type . ": " . $errors->exception->getMessage();
     Shineisp_Commons_Utilities::log($errormessage);
     $this->view->exception = $errors->exception;
     $this->view->request = $errors->request;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:35,代码来源:ErrorController.php


示例10: init

 public function init()
 {
     $this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
     $this->addElement('select', 'locale', array('decorators' => array('Bootstrap'), 'label' => 'Language', 'class' => 'form-control', 'multioptions' => Languages::getLanguageFiles(PUBLIC_PATH . "/languages")));
     $this->addElement('textarea', 'agreement', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'class' => 'form-control', 'label' => 'Agreements', 'rows' => '10', 'value' => Shineisp_Commons_Utilities::readfile(PUBLIC_PATH . "/../LICENSE")));
     $this->addElement('select', 'chkagreement', array('decorators' => array('Bootstrap'), 'label' => 'I agree with the legal terms', 'class' => 'form-control', 'multioptions' => array(1 => 'YES, I agree with the legal terms', 0 => 'NO, I disagree with these legal terms')));
     $this->addElement('submit', 'submit', array('label' => 'Continue', 'decorators' => array('Bootstrap'), 'class' => 'btn btn-primary btn-lg'));
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:8,代码来源:LocalizationForm.php


示例11: checkFields

 protected function checkFields()
 {
     parent::checkFields();
     if ($this->shopID == NULL || "" == $this->shopID) {
         Shineisp_Commons_Utilities::logs("---> Missing shopID", 'bnl_igfs.log');
     }
     return false;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:8,代码来源:BaseIgfsCgTran.php


示例12: gravatar

 public function gravatar($email, $width = 60)
 {
     if (!is_numeric($width)) {
         $width = 60;
     }
     if (Shineisp_Commons_Utilities::isEmail($email)) {
         return Shineisp_Commons_Gravatar::get_gravatar($email, $width);
     }
     return false;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:10,代码来源:Gravatar.php


示例13: checkFields

 protected function checkFields()
 {
     parent::checkFields();
     if ($this->amount == NULL) {
         Shineisp_Commons_Utilities::logs("---> Missing amount", 'bnl_igfs.log');
     }
     return false;
     if ($this->refTranID == NULL) {
         Shineisp_Commons_Utilities::logs("---> Missing refTranID", 'bnl_igfs.log');
     }
     return false;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:12,代码来源:CgVoidAuth.php


示例14: indexAction

 /**
  * Load all the resources
  * @see Zend_Controller_Action::preDispatch()
  */
 public function indexAction()
 {
     $session = new Zend_Session_Namespace('setup');
     $session->permissions = false;
     $dirs = array();
     $errors = array();
     $applicationfolder = true;
     $publicfolder = true;
     $dirs[] = PUBLIC_PATH;
     $dirs[] = PUBLIC_PATH . "/media/";
     $dirs[] = PUBLIC_PATH . "/documents/";
     $dirs[] = PUBLIC_PATH . "/logs/";
     $dirs[] = PUBLIC_PATH . "/imports/";
     $dirs[] = PUBLIC_PATH . "/tmp/";
     $dirs[] = PUBLIC_PATH . "/cache/";
     $dirs[] = APPLICATION_PATH . "/configs/";
     $dirs[] = APPLICATION_PATH . "/configs/data/";
     $dirs[] = APPLICATION_PATH . "/configs/data/sql/";
     // create all the directories
     foreach ($dirs as $dir) {
         if (!is_dir($dir)) {
             if (!@mkdir($dir)) {
                 $errors[] = $dir;
             }
         } else {
             if (!Shineisp_Commons_Utilities::isWritable($dir)) {
                 $errors[] = $dir;
             }
         }
     }
     // check the public directory
     if (Shineisp_Commons_Utilities::isWritable(PUBLIC_PATH)) {
         $this->view->public_folder = true;
     } else {
         $this->view->public_folder = false;
         $publicfolder = false;
     }
     // check the application config data directory
     if (Shineisp_Commons_Utilities::isWritable(APPLICATION_PATH . "/configs/data/")) {
         $this->view->application_folder = true;
     } else {
         $this->view->application_folder = false;
         $applicationfolder = false;
     }
     $this->view->errors = $errors;
     if ($publicfolder & $applicationfolder && count($errors) == 0) {
         $session->permissions = true;
         $this->_helper->redirector('index', 'localization', 'setup');
     } else {
         return $this->_helper->viewRenderer('index');
     }
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:56,代码来源:CheckerController.php


示例15: googleproductsAction

 /**
  * Export the products by the Google Product Atom Export
  * @author Shine Software
  * @return xml 
  */
 public function googleproductsAction()
 {
     // Calling Google Product Extension
     Zend_Feed_Writer::addPrefixPath('Shineisp_Feed_Writer_Extension_', 'Shineisp/Feed/Writer/Extension/');
     Zend_Feed_Writer::registerExtension('Google');
     $isp = Shineisp_Registry::get('ISP');
     $feed = new Zend_Feed_Writer_Feed();
     $feed->setTitle($isp->company);
     $feed->setLink($isp->website);
     $feed->setFeedLink($isp->website . '/atom/products', 'atom');
     $feed->addAuthor(array('name' => $isp->manager, 'email' => $isp->email, 'uri' => $isp->website));
     $feed->setDateModified(time());
     $feed->setGenerator("ShineISP Atom Extension");
     $products = Products::getAllRss();
     // 		print_r($products);
     // 		die;
     foreach ($products as $product) {
         // Get the google categories
         $categories = ProductsCategories::getGoogleCategories($product['categories']);
         $cattype = Products::get_text_categories($product['categories']);
         // Create the product entries
         $entry = $feed->createEntry();
         $entry->setTitle($product['ProductsData'][0]['name']);
         $entry->setProductType(Products::get_text_categories($product['categories']));
         $entry->setBrand($isp->company);
         $entry->setAvailability(true);
         $entry->setLink($isp->website . "/" . $product['uri'] . ".html");
         // Custom Attributes Google Product Extension
         if (!empty($product['ProductsMedia'][0]['path'])) {
             $entry->setImageLink($isp->website . str_replace(" ", "%20", $product['ProductsMedia'][0]['path']));
         }
         if (!empty($product['uri'])) {
             $entry->setProductId($product['uri']);
         }
         if (!empty($categories[0]['googlecategs'])) {
             $entry->setCategory($categories[0]['googlecategs']);
         }
         $price = Products::getPriceSuggested($product['product_id'], true);
         $entry->setPrice($price);
         $entry->setCondition('new');
         $entry->setDateModified(time());
         $entry->setDescription(strip_tags($product['ProductsData'][0]['shortdescription']));
         $feed->addEntry($entry);
     }
     $feed = $feed->export('atom');
     // Feed Fixing for google products
     $feed = $this->googlefixes($feed);
     Shineisp_Commons_Utilities::writefile($feed, "documents", "googleproducts.xml");
     die($feed);
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:55,代码来源:AtomController.php


示例16: indexAction

 public function indexAction()
 {
     $NS = new Zend_Session_Namespace('Default');
     if (!empty($NS->customer)) {
         $this->view->dashboard = true;
     } else {
         $this->view->dashboard = false;
     }
     $this->view->mex = $this->getRequest()->getParam('mex');
     $this->view->mexstatus = $this->getRequest()->getParam('status');
     $this->view->customer = $NS->customer;
     $this->view->headTitle()->prepend($NS->customer['lastname'] . " " . $NS->customer['firstname']);
     // Clean up the tmp folder
     Shineisp_Commons_Utilities::cleantmp();
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:15,代码来源:DashboardController.php


示例17: getAll

 /**
  * Get all statuses
  * 
  * @return object $statuses
  */
 public static function getAll()
 {
     $out = array();
     $records = Doctrine_Query::create()->from('Statuses s')->execute(array(), Doctrine_Core::HYDRATE_ARRAY);
     // normalize data
     foreach ($records as $record) {
         $section = strtolower($record['section']);
         $code = strtolower($record['code']);
         // code as key
         $out[$section][$code] = $record;
         // status_id as key
         $out['id:' . $record['status_id']] = $record;
         // PHP BUG: See Statuses::getById
     }
     return Shineisp_Commons_Utilities::array2object($out);
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:21,代码来源:Statuses.php


示例18: createEntry

 /**
  * Add one or more entries. Note that entries must
  * be manually added once created.
  */
 private function createEntry($feed, $title, $descritption, $link, $dateCreated = null, $dateModified = null)
 {
     if (!empty($title)) {
         $entry = $feed->createEntry();
         $entry->setTitle($title);
         if (!empty($descritption)) {
             $descritption = strip_tags($descritption);
             $entry->setDescription(Shineisp_Commons_Utilities::CropSentence($descritption, 300, "..."));
         }
         $entry->setLink($link);
         $entry->setDateModified(!empty($dateModified) ? $dateModified : time());
         $entry->setDateCreated(!empty($dateCreated) ? $dateCreated : time());
         $feed->addEntry($entry);
     }
     return $feed;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:20,代码来源:RssController.php


示例19: simplegrid

 public function simplegrid($data)
 {
     $this->view->module = Zend_Controller_Front::getInstance()->getRequest()->getModuleName();
     $this->view->controller = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();
     $this->view->action = Zend_Controller_Front::getInstance()->getRequest()->getActionName();
     if (isset($data['records'])) {
         // Name of the table, useful for the jQuery pager
         $this->view->name = !empty($data['name']) ? $data['name'] : "table_" . Shineisp_Commons_Uuid::generate();
         // Index of the table
         $this->view->id = !empty($this->view->fields[0]) && is_numeric($data['records'][0][$this->view->fields[0]]) ? $data['records'][0][$this->view->fields[0]] : "0";
         // All the records
         $this->view->records = $data['records'];
         // Create the header using the field name if the columns variable is not set
         if (empty($data['columns'])) {
             $data['columns'] = array();
             if (!empty($data['records'][0])) {
                 // Get all the fields
                 $items = Shineisp_Commons_Utilities::array_flatten($data['records'][0]);
                 $fields = array_keys($items);
                 foreach ($fields as $field) {
                     if (strpos($field, "_id") === false) {
                         // When a record is called using the HYDRATE_SCALAR mode the table aliases are attached in the field name
                         // In this way we delete the first part of the field name. For instance: o_name --> name
                         $arrfield = explode("_", $field);
                         $field = count($arrfield) > 0 ? $arrfield[count($arrfield) - 1] : $field;
                         $data['columns'][] = ucfirst(Shineisp_Registry::getInstance()->Zend_Translate->translate($field));
                     }
                 }
             }
         }
         $this->view->columns = $data['columns'];
         // If these options are true a link appear for each row in a table
         $this->view->view = !empty($data['view']) ? $data['view'] : false;
         $this->view->edit = !empty($data['edit']) ? $data['edit'] : false;
         $this->view->delete = !empty($data['delete']) ? $data['delete'] : false;
         $this->view->targetlink = !empty($data['targetlink']) ? $data['targetlink'] : null;
         // If you need more action use this parameter Array{'url'=>'name'}
         // for instance $actions['/admin/customers'] = "Customers";
         // the label customers will be translated
         $this->view->actions = !empty($data['actions']) ? $data['actions'] : false;
         $this->view->onclick = !empty($data['onclick']) ? $data['onclick'] : false;
     } else {
         $this->view->records = "";
     }
     // Path of the template
     return $this->view->render('partials/simplegrid.phtml');
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:47,代码来源:Simplegrid.php


示例20: preDispatch

 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     $this->_init($request);
     // 		echo Zend_Controller_Front::getInstance()->getRouter()->getCurrentRouteName();
     // 		Zend_Debug::dump(Zend_Controller_Front::getInstance()->getRequest()->getParams());
     // if the current user role is not allowed to do something
     $resource = $this->_module . ":" . $this->_controller;
     $allowed_resources[] = "default:error";
     $allowed_resources[] = "api:index";
     $allowed_resources[] = "api:request";
     $allowed_resources[] = "admin:index";
     $allowed_resources[] = "admin:login";
     $allowed_resources[] = "system:index";
     $allowed_resources[] = "system:cron";
     $allowed_resources[] = "system:tasks";
     $allowed_resources[] = "setup:index";
     $allowed_resources[] = "setup:checker";
     $allowed_resources[] = "setup:database";
     $allowed_resources[] = "setup:localization";
     $allowed_resources[] = "setup:preferences";
     $allowed_resources[] = "setup:summary";
     // Exclude the system index controller and the default error controller for a formal ACL check
     if (in_array($resource, $allowed_resources)) {
         return true;
     }
     // 		Zend_Debug::dump($resource);
     // 		Zend_Debug::dump($this->_currentRole);
     // Check if the user is an Administrator and let him free to access to all the resources
     if ($this->_currentRole == "administrator") {
         return true;
     }
     if ($this->_currentRole == "guest" && $this->_module == "default") {
         return true;
     }
     if (!$this->_acl->isAllowed($this->_currentRole, $resource, "allow")) {
         if ('guest' == $this->_currentRole) {
             Shineisp_Commons_Utilities::log("Login: The role '" . $this->_currentRole . "' has not sufficient permissions to access the resource '{$resource}'. The user has been redirected to the login page.");
             $request->setControllerName('login');
             $request->setActionName('index');
         } else {
             Shineisp_Commons_Utilities::log("Login: The role '" . $this->_currentRole . "' is not allowed to access to the {$resource}. It is redirected to the no authentication page.");
             $request->setControllerName('login');
             $request->setActionName('noauth');
         }
     }
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:46,代码来源:Acl.php



注:本文中的Shineisp_Commons_Utilities类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Shineisp_Registry类代码示例发布时间:2022-05-23
下一篇:
PHP Shindig_Config类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap