コード例 #1
0
 /**
  * Executes a select based on input query parts array
  *
  * @param    array   $queryParts Query parts array
  * @param    boolean $debug
  * @return   pointer        MySQL select result pointer / DBAL object
  * @see exec_SELECTquery()
  */
 public static function exec_SELECT_queryArray($queryParts, $debug = false)
 {
     $res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
     if ($GLOBALS['TYPO3_DB']->sql_error() || $debug === true) {
         $debug = array();
         $debug['queryParts'] = $queryParts;
         $debug['sql'] = self::SELECT_queryArray($queryParts);
         $debug['error'] = $GLOBALS['TYPO3_DB']->sql_error();
         $debug['php'] = tx_t3devapi_miscellaneous::get_caller_method();
         tx_t3devapi_miscellaneous::debug($debug, $GLOBALS['TYPO3_DB']->sql_error());
     }
     return $res;
 }
コード例 #2
0
 /**
  * This function get all configurations from ts, flexform, getpost...
  *
  * @param boolean $debug
  * @return array
  */
 public function getArrayConfig($debug = false)
 {
     // TYPOSCRIPT = template with plugin.tx_xxxx_pi1.xxxx = xxxx
     $arrayConfig = $this->conf;
     // Init and get the flexform data of the plugin
     $this->pi_initPIflexForm();
     $flexConfig = array();
     $piFlexForm = array();
     $piFlexForm = $this->cObj->data['pi_flexform'];
     if (isset($piFlexForm['data'])) {
         foreach ($piFlexForm['data'] as $sheet => $data) {
             foreach ($data as $lang => $value) {
                 foreach ($value as $key => $val) {
                     $flexConfig[$key] = $this->pi_getFFvalue($piFlexForm, $key, $sheet);
                 }
             }
         }
     }
     // test contentId to know if this content is concerned by piVars
     $arrayConfig['contentId'] == $this->cObj->data['uid'] ? $arrayConfig['piVars'] = 1 : ($arrayConfig['piVars'] = 0);
     // add "ext_conf_template.txt"
     if ($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$this->extKey]) {
         $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$this->extKey]);
         $arrayConfig = array_merge($arrayConfig, $extConf);
     }
     // add the pi config "plugin.tx_xxxx_pi1 = xxxx" which is not imported in the $conf
     if (is_array($GLOBALS['TSFE']->tmpl->setup['plugin.'][$this->prefixId . '.'])) {
         $arrayConfig = array_merge($arrayConfig, $GLOBALS['TSFE']->tmpl->setup['plugin.'][$this->prefixId . '.']);
     }
     // add $piVars
     $arrayConfig = array_merge($arrayConfig, $this->piVars);
     // merge TYPOSCRIPT with FLEXFORM
     $arrayConfig = array_merge($flexConfig, $arrayConfig);
     if ($debug == true) {
         tx_t3devapi_miscellaneous::debug($arrayConfig);
     }
     return $arrayConfig;
 }
コード例 #3
0
 /**
  * Template rendering for subdatas and principal datas
  *
  * @param array   $templateMarkers
  * @param string  $templateSection
  * @param boolean $debug
  * @return string HTML code
  */
 public function renderAllTemplate($templateMarkers, $templateSection, $debug = false)
 {
     // Check if the template is loaded
     if (!$this->templateContent) {
         return false;
     }
     // Check argument
     if (!is_array($templateMarkers)) {
         return false;
     }
     if ($debug === true) {
         tx_t3devapi_miscellaneous::debug($templateMarkers, 'Markers for ' . $templateSection);
     }
     $content = '';
     if (is_array($templateMarkers[0])) {
         foreach ($templateMarkers as $markers) {
             $content .= $this->renderAllTemplate($markers, $templateSection, $debug);
         }
     } else {
         $content = $this->renderSingle($templateMarkers, $templateSection);
     }
     return $this->cleanTemplate($content);
 }