コード例 #1
0
ファイル: abstract.php プロジェクト: raeldc/com_learn
	/**
	 * Sanitize a variable or data collection
	 *
	 * @param	mixed	Data to be sanitized
	 * @return	mixed	The sanitized data
	 */
	public final function sanitize($data)
	{
		if($this->_walk && (is_array($data) || is_object($data))) 
		{
			$arr = (array)$data;
				
			foreach($arr as $key => $value) 
			{
				if(is_array($data)) {
					$data[$key] = $this->sanitize($value);
				}
				
				if(is_object($data)) {
					$data->$key = $this->sanitize($value);	
				}
			}
		}
		else
		{
			$context = $this->_chain->getContext();
			$context->data = $data;
			
			$data = $this->_chain->run('sanitize', $context);
		}
		
		return $data;
	}
コード例 #2
0
 /**
  * Constructor
  *
  * @param object $translator
  * @param object $legacyContext
  */
 public function __construct($translator, $legacyContext)
 {
     $this->translator = $translator;
     $this->contextLegacy = $legacyContext->getContext();
     $this->configuration = $this->getConfiguration();
     $this->currency = $this->contextLegacy->currency;
 }
コード例 #3
0
 /**
  * Constructor.
  *
  * @param object $router
  * @param object $translator
  * @param object $shopContextAdapter
  * @param object $countryDataprovider
  * @param object $currencyDataprovider
  * @param object $groupDataprovider
  * @param object $legacyContext
  */
 public function __construct($router, $translator, $shopContextAdapter, $countryDataprovider, $currencyDataprovider, $groupDataprovider, $legacyContext, $customerDataprovider)
 {
     $this->router = $router;
     $this->translator = $translator;
     $this->context = $legacyContext;
     $this->locales = $legacyContext->getLanguages();
     $this->shops = $this->formatDataChoicesList($shopContextAdapter->getShops(), 'id_shop');
     $this->countries = $this->formatDataChoicesList($countryDataprovider->getCountries($this->locales[0]['id_lang']), 'id_country');
     $this->currencies = $this->formatDataChoicesList($currencyDataprovider->getCurrencies(), 'id_currency');
     $this->groups = $this->formatDataChoicesList($groupDataprovider->getGroups($this->locales[0]['id_lang']), 'id_group');
     $this->currency = $legacyContext->getContext()->currency;
     $this->customerDataprovider = $customerDataprovider;
 }
コード例 #4
0
ファイル: ProductShipping.php プロジェクト: M03G/PrestaShop
 /**
  * Constructor
  *
  * @param object $translator
  * @param object $legacyContext
  * @param object $warehouseDataProvider
  * @param object $carrierDataProvider
  */
 public function __construct($translator, $legacyContext, $warehouseDataProvider, $carrierDataProvider)
 {
     $this->translator = $translator;
     $this->legacyContext = $legacyContext;
     $this->currency = $legacyContext->getContext()->currency;
     $this->locales = $this->legacyContext->getLanguages();
     $this->warehouses = $warehouseDataProvider->getWarehouses();
     $carriers = $carrierDataProvider->getCarriers($this->locales[0]['id_lang'], false, false, false, null, $carrierDataProvider->getAllCarriersConstant());
     $this->carriersChoices = [];
     foreach ($carriers as $carrier) {
         $this->carriersChoices[$carrier['name'] . ' (' . $carrier['delay'] . ')'] = $carrier['id_reference'];
     }
 }
コード例 #5
0
ファイル: ProductPrice.php プロジェクト: M03G/PrestaShop
 /**
  * Constructor
  *
  * @param object $translator
  * @param object $taxDataProvider
  * @param object $router
  * @param object $shopContextAdapter
  * @param object $countryDataprovider
  * @param object $currencyDataprovider
  * @param object $groupDataprovider
  * @param object $legacyContext
  * @param object $customerDataprovider
  */
 public function __construct($translator, $taxDataProvider, $router, $shopContextAdapter, $countryDataprovider, $currencyDataprovider, $groupDataprovider, $legacyContext, $customerDataprovider)
 {
     $this->translator = $translator;
     $this->router = $router;
     $this->configuration = $this->getConfiguration();
     $this->shopContextAdapter = $shopContextAdapter;
     $this->countryDataprovider = $countryDataprovider;
     $this->currencyDataprovider = $currencyDataprovider;
     $this->groupDataprovider = $groupDataprovider;
     $this->customerDataprovider = $customerDataprovider;
     $this->legacyContext = $legacyContext;
     $this->tax_rules_rates = $taxDataProvider->getTaxRulesGroupWithRates();
     $this->eco_tax_rate = $taxDataProvider->getProductEcotaxRate();
     $this->currency = $legacyContext->getContext()->currency;
     $this->tax_rules = $this->formatDataChoicesList($taxDataProvider->getTaxRulesGroups(true), 'id_tax_rules_group');
 }
コード例 #6
0
ファイル: controller.php プロジェクト: ookwudili/chisimba
 function __showtoolsactivity()
 {
     $startDate = $this->getParam('startdate');
     $endDate = $this->getParam('enddate');
     $objModules = $this->getObject('modules', 'modulecatalogue');
     $plugins = $objModules->getListContextPlugins();
     $contextcode = $this->getParam("contextcode");
     if ($contextcode == null) {
         $contextcode = $this->contextCode;
     }
     $context = $this->objContext->getContext($contextcode);
     $objUserActivity = $this->getObject('dbuseractivity');
     $data = $objUserActivity->getToolsActivity($startDate, $endDate, $contextcode, $plugins);
     $this->setVarByRef("data", $data);
     $this->setVarByRef("startdate", $startDate);
     $this->setVarByRef("enddate", $endDate);
     $this->setVarByRef("coursetitle", $context['title']);
     $this->setVarByRef("contextcode", $context['contextcode']);
     return "toolsactivity_tpl.php";
 }
コード例 #7
0
ファイル: controller.php プロジェクト: ookwudili/chisimba
 /**
  * Method to process delete confirmation
  */
 private function __deleteconfirm()
 {
     $contextCode = $this->getParam('contextcode');
     $context = $this->objContext->getContext($contextCode);
     if ($context == FALSE) {
         return $this->nextAction(NULL, array('error' => 'deletenoneexistingcourse', 'context' => $contextCode));
     } else {
         if ($contextCode != $this->getSession('deletecontext')) {
             return $this->nextAction(NULL, array('error' => 'incompletedelete', 'context' => $contextCode));
         }
         $deleteConfirm = $this->getParam('deleteconfirm', 'no');
         if ($deleteConfirm == 'yes') {
             $result = $this->objContext->deleteContext($contextCode);
             $result = $result ? 'y' : 'n';
             return $this->nextAction(NULL, array('message' => 'contextdeleted', 'context' => $contextCode, 'title' => $context['title'], 'result' => $result));
         } else {
             return $this->nextAction(NULL, array('message' => 'deletecancelled', 'context' => $contextCode));
         }
     }
 }
コード例 #8
0
 /**
  * Method to format a context
  * @oaram string username
  */
 public function formatSelectedContext($contextCode)
 {
     $context = $this->objDBContext->getContext($contextCode);
     $objDisplayContext = $this->getObject('displaycontext', 'context');
     return $objDisplayContext->formatContextDisplayBlock($context, FALSE, FALSE) . '<br />';
 }
コード例 #9
0
 /**
  * Constructor
  *
  * @param object $translator
  * @param object $legacyContext
  */
 public function __construct($translator, $legacyContext)
 {
     $this->translator = $translator;
     $this->contextLegacy = $legacyContext->getContext();
 }
コード例 #10
0
 /**
  * Get the path of a node
  *
  * the path first element is the root node
  * the last node is $node itself
  * @param object $node
  * @return array()
  */
 public function getPath($node)
 {
     // ACTIVE ?
     $qb = $this->createQueryBuilder('node');
     $qb->where($qb->expr()->lte('node.lft', $node->getLft()))->andWhere($qb->expr()->gte('node.rgt', $node->getRgt()))->andWhere('node.context = :context')->orderBy('node.lft', 'ASC');
     /*
     if (isset($config['root'])) {
         $rootId = $wrapped->getPropertyValue($config['root']);
         $qb->andWhere($rootId === null ?
             $qb->expr()->isNull('node.'.$config['root']) :
             $qb->expr()->eq('node.'.$config['root'], is_string($rootId) ? $qb->expr()->literal($rootId) : $rootId)
         );
     }
     */
     $query = $qb->getQuery()->setParameter('context', $node->getContext());
     return $query->getResult();
 }
コード例 #11
0
 /**
  * Constructor
  *
  * @param object $translator
  * @param object $contextLegacy
  * @param object $currencyAdapter
  */
 public function __construct($translator, $contextLegacy, $currencyAdapter)
 {
     $this->translator = $translator;
     $this->contextLegacy = $contextLegacy->getContext();
     $this->currencyAdapter = $currencyAdapter;
 }