当前位置: 首页>>代码示例>>PHP>>正文


PHP t3lib_div::intInRange方法代码示例

本文整理汇总了PHP中t3lib_div::intInRange方法的典型用法代码示例。如果您正苦于以下问题:PHP t3lib_div::intInRange方法的具体用法?PHP t3lib_div::intInRange怎么用?PHP t3lib_div::intInRange使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在t3lib_div的用法示例。


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

示例1: __construct

 /**
  * constructor for class tx_reports_report_status_Status
  *
  * @param	string	the status' title
  * @param	string	the status' value
  * @param	string	an optional message further describing the status
  * @param	integer	a severity level, one of
  */
 public function __construct($title, $value, $message = '', $severity = self::OK)
 {
     $this->title = (string) $title;
     $this->value = (string) $value;
     $this->message = (string) $message;
     $this->severity = t3lib_div::intInRange($severity, self::NOTICE, self::ERROR, self::OK);
 }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:15,代码来源:class.tx_reports_reports_status_status.php

示例2: _validateUserSearch

 /**
  * Validate User Search Options
  *
  * @param  array $options
  * @return void
  * @throws Zend_Service_Exception
  */
 protected function _validateUserSearch(array $options)
 {
     $validOptions = array('api_key', 'method', 'user_id', 'per_page', 'page', 'extras', 'min_upload_date', 'min_taken_date', 'max_upload_date', 'max_taken_date', 'safe_search');
     $this->_compareOptions($options, $validOptions);
     $options['per_page'] = t3lib_div::intInRange($options['per_page'], 1, 500, 10);
     if ($options['page']) {
         $options['page'] = intval($options['page']);
     }
 }
开发者ID:TYPO3-typo3org,项目名称:community,代码行数:16,代码来源:Flickr.php

示例3: forceIntegerInRange

 /**
  * Forces the integer $theInt into the boundaries of $min and $max.
  * If the $theInt is 'FALSE' then the $zeroValue is applied.
  *
  * @param integer $theInt Input value
  * @param integer $min Lower limit
  * @param integer $max Higher limit
  * @param integer $zeroValue Default value if input is FALSE.
  * @return integer The input value forced into the boundaries of $min and $max
  */
 public static function forceIntegerInRange($theInt, $min, $max = 2000000000, $zeroValue = 0)
 {
     $result = '';
     if (self::isEqualOrHigherSixZero()) {
         $result = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($theInt, $min, $max, $zeroValue);
     } elseif (class_exists('t3lib_utility_Math')) {
         $result = t3lib_utility_Math::forceIntegerInRange($theInt, $min, $max, $zeroValue);
     } else {
         $result = t3lib_div::intInRange($theInt, $min, $max, $zeroValue);
     }
     return $result;
 }
开发者ID:rafu1987,项目名称:t3bootstrap-project,代码行数:22,代码来源:Compatibility.php

示例4: normalizeArgumentToTimestamp

 /**
  * normalizes anything that describes a time
  * and sets it to be a timestamp
  * 
  * @param mixed $value
  * @return void
  */
 protected function normalizeArgumentToTimestamp($value)
 {
     if (empty($value)) {
         return;
     } elseif (is_numeric($value)) {
         return t3lib_div::intInRange($this->argumentName, 0);
     } elseif (is_string($value)) {
         return Tx_CzSimpleCal_Utility_StrToTime::strtotime($value);
     } elseif ($value instanceof DateTime) {
         return intval($value->format('U'));
     }
     return;
 }
开发者ID:TYPO3-typo3org,项目名称:community,代码行数:20,代码来源:CountController.php

示例5: user_itemMarkerArrayFunc

function user_itemMarkerArrayFunc($paramArray, $conf)
{
    echo 'xx';
    $markerArray = $paramArray[0];
    $lConf = $paramArray[1];
    $pObj =& $conf['parentObj'];
    // make a reference to the parent-object
    $row = $pObj->local_cObj->data;
    $imageNum = isset($lConf['imageCount']) ? $lConf['imageCount'] : 1;
    $imageNum = t3lib_div::intInRange($imageNum, 0, 100);
    $theImgCode = '';
    $imgs = t3lib_div::trimExplode(',', $row['image'], 1);
    $imgsCaptions = explode(chr(10), $row['imagecaption']);
    reset($imgs);
    $cc = 0;
    while (list(, $val) = each($imgs)) {
        if ($cc == $imageNum) {
            break;
        }
        if ($val) {
            $lConf['image.']['altText'] = '';
            // reset altText
            $lConf['image.']['altText'] = $lConf['image.']['altText'];
            // set altText to value from TS
            $lConf['image.']['file'] = 'uploads/pics/' . $val;
            switch ($lConf['imgAltTextField']) {
                case 'image':
                    $lConf['image.']['altText'] .= $val;
                    break;
                case 'imagecaption':
                    $lConf['image.']['altText'] .= $imgsCaptions[$cc];
                    break;
                default:
                    $lConf['image.']['altText'] .= $row[$lConf['imgAltTextField']];
            }
        }
        $theImgCode .= $pObj->local_cObj->wrap($pObj->local_cObj->IMAGE($lConf['image.']) . $pObj->local_cObj->stdWrap($imgsCaptions[$cc], $lConf['caption_stdWrap.']), $lConf['imageWrapIfAny_' . $cc]);
        $cc++;
    }
    $markerArray['###NEWS_IMAGE###'] = '';
    if ($cc) {
        $markerArray['###NEWS_IMAGE###'] = $pObj->local_cObj->wrap(trim($theImgCode), $lConf['imageWrapIfAny']);
    }
    $markerArray['###TEST###'] = '';
    return $markerArray;
}
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:46,代码来源:example_imageMarkerFunc.php

示例6: render

    /**
     * Rendering the cObject, HRULER
     *
     * @param	array		Array of TypoScript properties
     * @return	string		Output
     */
    public function render($conf = array())
    {
        $lineThickness = isset($conf['lineThickness.']) ? $this->cObj->stdWrap($conf['lineThickness'], $conf['lineThickness.']) : $conf['lineThickness'];
        $lineThickness = t3lib_div::intInRange($lineThickness, 1, 50);
        $lineColor = isset($conf['lineColor.']) ? $this->cObj->stdWrap($conf['lineColor'], $conf['lineColor.']) : $conf['lineColor'];
        if (!$lineColor) {
            $lineColor = 'black';
        }
        $spaceBefore = isset($conf['spaceLeft.']) ? intval($this->cObj->stdWrap($conf['spaceLeft'], $conf['spaceLeft.'])) : intval($conf['spaceLeft']);
        $spaceAfter = isset($conf['spaceRight.']) ? intval($this->cObj->stdWrap($conf['spaceRight'], $conf['spaceRight.'])) : intval($conf['spaceRight']);
        $tableWidth = isset($conf['tableWidth.']) ? intval($this->cObj->stdWrap($conf['tableWidth'], $conf['tableWidth.'])) : intval($conf['tableWidth']);
        if (!$tableWidth) {
            $tableWidth = '99%';
        }
        $theValue = '';
        $theValue .= '<table border="0" cellspacing="0" cellpadding="0"
			width="' . htmlspecialchars($tableWidth) . '"
			summary=""><tr>';
        if ($spaceBefore) {
            $theValue .= '<td width="1">
				<img src="' . $GLOBALS['TSFE']->absRefPrefix . 'clear.gif"
				width="' . $spaceBefore . '"
				height="1" alt="" title="" />
			</td>';
        }
        $theValue .= '<td bgcolor="' . $lineColor . '">
			<img src="' . $GLOBALS['TSFE']->absRefPrefix . 'clear.gif"
			width="1"
			height="' . $lineThickness . '"
			alt="" title="" />
		</td>';
        if ($spaceAfter) {
            $theValue .= '<td width="1">
				<img src="' . $GLOBALS['TSFE']->absRefPrefix . 'clear.gif"
				width="' . $spaceAfter . '"
				height="1" alt="" title="" />
			</td>';
        }
        $theValue .= '</tr></table>';
        if (isset($conf['stdWrap.'])) {
            $theValue = $this->cObj->stdWrap($theValue, $conf['stdWrap.']);
        }
        return $theValue;
    }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:50,代码来源:class.tslib_content_horizontalruler.php

示例7: main

 /**
  * @return  array
  */
 function main()
 {
     global $TYPO3_DB;
     // Initialize result array:
     $resultArray = array('message' => $this->cli_help['name'] . chr(10) . chr(10) . $this->cli_help['description'], 'headers' => array('index' => array('Full index of translation', 'NEEDS MUCH MORE WORK....', 1)), 'index' => array());
     $startingPoints = t3lib_div::intExplode(',', $this->cli_argValue('--pid'));
     $workspaceID = $this->cli_isArg('--workspace') ? t3lib_div::intInRange($this->cli_argValue('--workspace'), -1) : 0;
     $depth = $this->cli_isArg('--depth') ? t3lib_div::intInRange($this->cli_argValue('--depth'), 0) : 1000;
     if ($workspaceID != 0) {
         $GLOBALS['BE_USER']->setWorkspace($workspaceID);
         if ($GLOBALS['BE_USER']->workspace != $workspaceID) {
             die('Workspace ' . $workspaceID . ' did not exist!' . chr(10));
         }
     }
     $this->resultArray =& $resultArray;
     foreach ($startingPoints as $pidPoint) {
         if ($pidPoint >= 0) {
             $this->genTree($pidPoint, $depth, (int) $this->cli_argValue('--echotree'), 'main_parseTreeCallBack');
         }
     }
     return $resultArray;
 }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:25,代码来源:class.tx_l10nmgr_index.php

示例8: dbFileIcons

    /**
     * Prints the selector box form-field for the db/file/select elements (multiple)
     *
     * @param	string		Form element name
     * @param	string		Mode "db", "file" (internal_type for the "group" type) OR blank (then for the "select" type). Seperated with '|' a user defined mode can be set to be passed as param to the EB.
     * @param	string		Commalist of "allowed"
     * @param	array		The array of items. For "select" and "group"/"file" this is just a set of value. For "db" its an array of arrays with table/uid pairs.
     * @param	string		Alternative selector box.
     * @param	array		An array of additional parameters, eg: "size", "info", "headers" (array with "selector" and "items"), "noBrowser", "thumbnails"
     * @param	string		On focus attribute string
     * @param	string		$user_el_param Additional parameter for the EB
     * @return	string		The form fields for the selection.
     */
    function dbFileIcons($fName, $mode, $allowed, $itemArray, $selector = '', $params = array(), $onFocus = '', $userEBParam = '')
    {
        list($mode, $modeEB) = explode('|', $mode);
        $modeEB = $modeEB ? $modeEB : $mode;
        $disabled = '';
        if ($this->tceforms->renderReadonly || $params['readOnly']) {
            $disabled = ' disabled="disabled"';
        }
        // Sets a flag which means some JavaScript is included on the page to support this element.
        $this->tceforms->printNeededJS['dbFileIcons'] = 1;
        // INIT
        $uidList = array();
        $opt = array();
        $itemArrayC = 0;
        // Creating <option> elements:
        if (is_array($itemArray)) {
            $itemArrayC = count($itemArray);
            reset($itemArray);
            switch ($mode) {
                case 'db':
                    while (list(, $pp) = each($itemArray)) {
                        if ($pp['title']) {
                            $pTitle = $pp['title'];
                        } else {
                            if (function_exists('t3lib_BEfunc::getRecordWSOL')) {
                                $pRec = t3lib_BEfunc::getRecordWSOL($pp['table'], $pp['id']);
                            } else {
                                $pRec = t3lib_BEfunc::getRecord($pp['table'], $pp['id']);
                            }
                            $pTitle = is_array($pRec) ? $pRec[$GLOBALS['TCA'][$pp['table']]['ctrl']['label']] : NULL;
                        }
                        if ($pTitle) {
                            $pTitle = $pTitle ? t3lib_div::fixed_lgd_cs($pTitle, $this->tceforms->titleLen) : t3lib_BEfunc::getNoRecordTitle();
                            $pUid = $pp['table'] . '_' . $pp['id'];
                            $uidList[] = $pUid;
                            $opt[] = '<option value="' . htmlspecialchars($pUid) . '">' . htmlspecialchars($pTitle) . '</option>';
                        }
                    }
                    break;
                case 'folder':
                case 'file':
                    while (list(, $pp) = each($itemArray)) {
                        $pParts = explode('|', $pp);
                        $uidList[] = $pUid = $pTitle = $pParts[0];
                        $opt[] = '<option value="' . htmlspecialchars(rawurldecode($pParts[0])) . '">' . htmlspecialchars(rawurldecode($pParts[0])) . '</option>';
                    }
                    break;
                default:
                    while (list(, $pp) = each($itemArray)) {
                        $pParts = explode('|', $pp, 2);
                        $uidList[] = $pUid = $pParts[0];
                        $pTitle = $pParts[1] ? $pParts[1] : $pParts[0];
                        $opt[] = '<option value="' . htmlspecialchars(rawurldecode($pUid)) . '">' . htmlspecialchars(rawurldecode($pTitle)) . '</option>';
                    }
                    break;
            }
        }
        // Create selector box of the options
        $sSize = $params['autoSizeMax'] ? t3lib_div::intInRange($itemArrayC + 1, t3lib_div::intInRange($params['size'], 1), $params['autoSizeMax']) : $params['size'];
        if (!$selector) {
            $selector = '<select size="' . $sSize . '"' . $this->tceforms->insertDefStyle('group') . ' multiple="multiple" name="' . $fName . '_list" ' . $onFocus . $params['style'] . $disabled . '>' . implode('', $opt) . '</select>';
        }
        $icons = array('L' => array(), 'R' => array());
        if (!$params['readOnly']) {
            if (!$params['noBrowser']) {
                $aOnClick = 'setFormValueOpenBrowser(\'' . $modeEB . '\',\'' . ($fName . '|||' . $allowed . '|' . $userEBParam . '|') . '\'); return false;';
                $icons['R'][] = '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . '<img' . t3lib_iconWorks::skinImg($this->tceforms->backPath, 'gfx/insert3.gif', 'width="14" height="14"') . ' border="0" ' . t3lib_BEfunc::titleAltAttrib($this->tceforms->getLL('l_browse_' . ($mode === 'file' ? 'file' : 'db'))) . ' />' . '</a>';
            }
            if (!$params['dontShowMoveIcons']) {
                if ($sSize >= 5) {
                    $icons['L'][] = '<a href="#" onclick="setFormValueManipulate(\'' . $fName . '\',\'Top\'); return false;">' . '<img' . t3lib_iconWorks::skinImg($this->tceforms->backPath, 'gfx/group_totop.gif', 'width="14" height="14"') . ' border="0" ' . t3lib_BEfunc::titleAltAttrib($this->tceforms->getLL('l_move_to_top')) . ' />' . '</a>';
                }
                $icons['L'][] = '<a href="#" onclick="setFormValueManipulate(\'' . $fName . '\',\'Up\'); return false;">' . '<img' . t3lib_iconWorks::skinImg($this->tceforms->backPath, 'gfx/up.gif', 'width="14" height="14"') . ' border="0" ' . t3lib_BEfunc::titleAltAttrib($this->tceforms->getLL('l_move_up')) . ' />' . '</a>';
                $icons['L'][] = '<a href="#" onclick="setFormValueManipulate(\'' . $fName . '\',\'Down\'); return false;">' . '<img' . t3lib_iconWorks::skinImg($this->tceforms->backPath, 'gfx/down.gif', 'width="14" height="14"') . ' border="0" ' . t3lib_BEfunc::titleAltAttrib($this->tceforms->getLL('l_move_down')) . ' />' . '</a>';
                if ($sSize >= 5) {
                    $icons['L'][] = '<a href="#" onclick="setFormValueManipulate(\'' . $fName . '\',\'Bottom\'); return false;">' . '<img' . t3lib_iconWorks::skinImg($this->tceforms->backPath, 'gfx/group_tobottom.gif', 'width="14" height="14"') . ' border="0" ' . t3lib_BEfunc::titleAltAttrib($this->tceforms->getLL('l_move_to_bottom')) . ' />' . '</a>';
                }
            }
            // todo Clipboard
            $clipElements = $this->tceforms->getClipboardElements($allowed, $mode);
            if (count($clipElements)) {
                $aOnClick = '';
                #			$counter = 0;
                foreach ($clipElements as $elValue) {
                    if ($mode === 'file' or $mode === 'folder') {
                        $itemTitle = 'unescape(\'' . rawurlencode(tx_dam::file_basename($elValue)) . '\')';
                    } else {
//.........这里部分代码省略.........
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:101,代码来源:class.tx_dam_tcefunc.php

示例9: makeFieldTCA

    /**
     * Creates the TCA for fields
     *
     * @param	array		&$DBfields: array of fields (PASSED BY REFERENCE)
     * @param	array		$columns: $array of fields (PASSED BY REFERENCE)
     * @param	array		$fConf: field config
     * @param	string		$WOP: ???
     * @param	string		$table: tablename
     * @param	string		$extKey: extensionkey
     * @return	void
     */
    function makeFieldTCA(&$DBfields, &$columns, $fConf, $WOP, $table, $extKey)
    {
        if (!(string) $fConf['type']) {
            return;
        }
        $id = $table . '_' . $fConf['fieldname'];
        $version = class_exists('t3lib_utility_VersionNumber') ? t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version) : t3lib_div::int_from_ver(TYPO3_version);
        $configL = array();
        $t = (string) $fConf['type'];
        switch ($t) {
            case 'input':
            case 'input+':
                $isString = true;
                $configL[] = '\'type\' => \'input\',	' . $this->WOPcomment('WOP:' . $WOP . '[type]');
                if ($version < 4006000) {
                    $configL[] = '\'size\' => \'' . t3lib_div::intInRange($fConf['conf_size'], 5, 48, 30) . '\',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_size]');
                    if (intval($fConf['conf_max'])) {
                        $configL[] = '\'max\' => \'' . t3lib_div::intInRange($fConf['conf_max'], 1, 255) . '\',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_max]');
                    }
                } else {
                    $configL[] = '\'size\' => \'' . t3lib_utility_Math::forceIntegerInRange($fConf['conf_size'], 5, 48, 30) . '\',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_size]');
                    if (intval($fConf['conf_max'])) {
                        $configL[] = '\'max\' => \'' . t3lib_utility_Math::forceIntegerInRange($fConf['conf_max'], 1, 255) . '\',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_max]');
                    }
                }
                $evalItems = array();
                if ($fConf['conf_required']) {
                    $evalItems[0][] = 'required';
                    $evalItems[1][] = $WOP . '[conf_required]';
                }
                if ($t == 'input+') {
                    $isString = (bool) (!$fConf['conf_eval']) || t3lib_div::inList('alphanum,upper,lower', $fConf['conf_eval']);
                    $isDouble2 = (bool) (!$fConf['conf_eval']) || t3lib_div::inList('double2', $fConf['conf_eval']);
                    if ($fConf['conf_varchar'] && $isString) {
                        $evalItems[0][] = 'trim';
                        $evalItems[1][] = $WOP . '[conf_varchar]';
                    }
                    if ($fConf['conf_eval'] === 'int+') {
                        $configL[] = '\'range\' => array(\'lower\' => 0, \'upper\' => 1000),	' . $this->WOPcomment('WOP:' . $WOP . '[conf_eval] = int+ results in a range setting');
                        $fConf['conf_eval'] = 'int';
                    }
                    if ($fConf['conf_eval']) {
                        $evalItems[0][] = $fConf['conf_eval'];
                        $evalItems[1][] = $WOP . '[conf_eval]';
                    }
                    if ($fConf['conf_check']) {
                        $configL[] = '\'checkbox\' => \'' . ($isString ? '' : '0') . '\',	' . $this->WOPcomment('WOP:' . $WOP . '[conf_check]');
                    }
                    if ($fConf['conf_stripspace']) {
                        $evalItems[0][] = 'nospace';
                        $evalItems[1][] = $WOP . '[conf_stripspace]';
                    }
                    if ($fConf['conf_pass']) {
                        $evalItems[0][] = 'password';
                        $evalItems[1][] = $WOP . '[conf_pass]';
                    }
                    if ($fConf['conf_md5']) {
                        $evalItems[0][] = 'md5';
                        $evalItems[1][] = $WOP . '[conf_md5]';
                    }
                    if ($fConf['conf_unique']) {
                        if ($fConf['conf_unique'] == 'L') {
                            $evalItems[0][] = 'uniqueInPid';
                            $evalItems[1][] = $WOP . '[conf_unique] = Local (unique in this page (PID))';
                        }
                        if ($fConf['conf_unique'] == 'G') {
                            $evalItems[0][] = 'unique';
                            $evalItems[1][] = $WOP . '[conf_unique] = Global (unique in whole database)';
                        }
                    }
                    $wizards = array();
                    if ($fConf['conf_wiz_color']) {
                        $wizards[] = trim($this->sPS('
							' . $this->WOPcomment('WOP:' . $WOP . '[conf_wiz_color]') . '
							\'color\' => array(
								\'title\' => \'Color:\',
								\'type\' => \'colorbox\',
								\'dim\' => \'12x12\',
								\'tableStyle\' => \'border:solid 1px black;\',
								\'script\' => \'wizard_colorpicker.php\',
								\'JSopenParams\' => \'height=300,width=250,status=0,menubar=0,scrollbars=1\',
							),
						'));
                    }
                    if ($fConf['conf_wiz_link']) {
                        $wizards[] = trim($this->sPS('
							' . $this->WOPcomment('WOP:' . $WOP . '[conf_wiz_link]') . '
							\'link\' => array(
								\'type\' => \'popup\',
//.........这里部分代码省略.........
开发者ID:rafu1987,项目名称:t3bootstrap-project,代码行数:101,代码来源:class.tx_kickstarter_section_fields.php

示例10: fileContentParts

 /**
  * Creates an array with pointers to divisions of document.
  * ONLY for PDF files at this point. All other types will have an array with a single element with the value "0" (zero) coming back.
  *
  * @param	string		File extension
  * @param	string		Absolute filename (must exist and be validated OK before calling function)
  * @return	array		Array of pointers to sections that the document should be divided into
  */
 function fileContentParts($ext, $absFile)
 {
     $cParts = array(0);
     switch ($ext) {
         case 'pdf':
             // Getting pdf-info:
             $cmd = $this->app['pdfinfo'] . ' ' . escapeshellarg($absFile);
             exec($cmd, $res);
             $pdfInfo = $this->splitPdfInfo($res);
             unset($res);
             if (intval($pdfInfo['pages'])) {
                 $cParts = array();
                 // Calculate mode
                 if ($this->pdf_mode > 0) {
                     $iter = ceil($pdfInfo['pages'] / $this->pdf_mode);
                 } else {
                     $iter = t3lib_div::intInRange(abs($this->pdf_mode), 1, $pdfInfo['pages']);
                 }
                 // Traverse and create intervals.
                 for ($a = 0; $a < $iter; $a++) {
                     $low = floor($a * ($pdfInfo['pages'] / $iter)) + 1;
                     $high = floor(($a + 1) * ($pdfInfo['pages'] / $iter));
                     $cParts[] = $low . '-' . $high;
                 }
             }
             break;
     }
     return $cParts;
 }
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:37,代码来源:class.external_parser.php

示例11: generateConfig

 /**
  * Generates the configuration array by replacing constants and parsing the whole thing.
  * Depends on $this->config and $this->constants to be set prior to this! (done by processTemplate/runThroughTemplates)
  *
  * @return	void
  * @see t3lib_TSparser, start()
  */
 function generateConfig()
 {
     // Add default TS for all three code types:
     array_unshift($this->constants, '' . $GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_constants']);
     // Adding default TS/constants
     array_unshift($this->config, '' . $GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_setup']);
     // Adding default TS/setup
     array_unshift($this->editorcfg, '' . $GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_editorcfg']);
     // Adding default TS/editorcfg
     // Parse the TypoScript code text for include-instructions!
     $this->processIncludes();
     // These vars are also set lateron...
     $this->setup['resources'] = $this->resources;
     $this->setup['sitetitle'] = $this->sitetitle;
     // ****************************
     // Parse TypoScript Constants
     // ****************************
     // Initialize parser and match-condition classes:
     $constants = t3lib_div::makeInstance('t3lib_TSparser');
     $constants->breakPointLN = intval($this->ext_constants_BRP);
     $constants->setup = $this->const;
     $constants->setup = $this->mergeConstantsFromPageTSconfig($constants->setup);
     /* @var $matchObj t3lib_matchCondition_frontend */
     $matchObj = t3lib_div::makeInstance('t3lib_matchCondition_frontend');
     $matchObj->setSimulateMatchConditions($this->matchAlternative);
     $matchObj->setSimulateMatchResult((bool) $this->matchAll);
     // Traverse constants text fields and parse them
     foreach ($this->constants as $str) {
         $constants->parse($str, $matchObj);
     }
     // Read out parse errors if any
     $this->parserErrors['constants'] = $constants->errors;
     // Then flatten the structure from a multi-dim array to a single dim array with all constants listed as key/value pairs (ready for substitution)
     $this->flatSetup = array();
     $this->flattenSetup($constants->setup, '', '');
     // ***********************************************
     // Parse TypoScript Setup (here called "config")
     // ***********************************************
     // Initialize parser and match-condition classes:
     $config = t3lib_div::makeInstance('t3lib_TSparser');
     $config->breakPointLN = intval($this->ext_config_BRP);
     $config->regLinenumbers = $this->ext_regLinenumbers;
     $config->regComments = $this->ext_regComments;
     $config->setup = $this->setup;
     // Transfer information about conditions found in "Constants" and which of them returned true.
     $config->sections = $constants->sections;
     $config->sectionsMatch = $constants->sectionsMatch;
     // Traverse setup text fields and concatenate them into one, single string separated by a [GLOBAL] condition
     $all = '';
     foreach ($this->config as $str) {
         $all .= "\n[GLOBAL]\n" . $str;
     }
     // Substitute constants in the Setup code:
     if ($this->tt_track) {
         $GLOBALS['TT']->push('Substitute Constants (' . count($this->flatSetup) . ')');
     }
     $all = $this->substituteConstants($all);
     if ($this->tt_track) {
         $GLOBALS['TT']->pull();
     }
     // Searching for possible unsubstituted constants left (only for information)
     if (strstr($all, '{$')) {
         $theConstList = array();
         $findConst = explode('{$', $all);
         array_shift($findConst);
         foreach ($findConst as $constVal) {
             $constLen = t3lib_div::intInRange(strcspn($constVal, '}'), 0, 50);
             $theConstList[] = '{$' . substr($constVal, 0, $constLen + 1);
         }
         if ($this->tt_track) {
             $GLOBALS['TT']->setTSlogMessage(implode(', ', $theConstList) . ': Constants may remain un-substituted!!', 2);
         }
     }
     // Logging the textual size of the TypoScript Setup field text with all constants substituted:
     if ($this->tt_track) {
         $GLOBALS['TT']->setTSlogMessage('TypoScript template size as textfile: ' . strlen($all) . ' bytes');
     }
     // Finally parse the Setup field TypoScript code (where constants are now substituted)
     $config->parse($all, $matchObj);
     // Read out parse errors if any
     $this->parserErrors['config'] = $config->errors;
     // Transfer the TypoScript array from the parser object to the internal $this->setup array:
     $this->setup = $config->setup;
     if ($this->backend_info) {
         $this->setup_constants = $constants->setup;
         // Used for backend purposes only
     }
     // **************************************************
     // Parse Backend Editor Configuration (backend only)
     // **************************************************
     if ($this->parseEditorCfgField) {
         $editorcfg = t3lib_div::makeInstance('t3lib_TSparser');
         $editorcfg->breakPointLN = intval($this->ext_editorcfg_BRP);
//.........这里部分代码省略.........
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:101,代码来源:class.t3lib_tstemplate.php

示例12: getQuery

 /**
  * Creates and returns a SELECT query for records from $table and with conditions based on the configuration in the $conf array
  * Implements the "select" function in TypoScript
  *
  * @param	string		See ->exec_getQuery()
  * @param	array		See ->exec_getQuery()
  * @param	boolean		If set, the function will return the query not as a string but array with the various parts. RECOMMENDED!
  * @return	mixed		A SELECT query if $returnQueryArray is FALSE, otherwise the SELECT query in an array as parts.
  * @access private
  * @see CONTENT(), numRows()
  */
 function getQuery($table, $conf, $returnQueryArray = FALSE)
 {
     // Handle PDO-style named parameter markers first
     $queryMarkers = $this->getQueryMarkers($table, $conf);
     // replace the markers in the non-stdWrap properties
     foreach ($queryMarkers as $marker => $markerValue) {
         $properties = array('uidInList', 'selectFields', 'where', 'max', 'begin', 'groupBy', 'orderBy', 'join', 'leftjoin', 'rightjoin');
         foreach ($properties as $property) {
             if ($conf[$property]) {
                 $conf[$property] = str_replace('###' . $marker . '###', $markerValue, $conf[$property]);
             }
         }
     }
     // Construct WHERE clause:
     $conf['pidInList'] = isset($conf['pidInList.']) ? trim($this->stdWrap($conf['pidInList'], $conf['pidInList.'])) : trim($conf['pidInList']);
     // Handle recursive function for the pidInList
     if (isset($conf['recursive'])) {
         $conf['recursive'] = intval($conf['recursive']);
         if ($conf['recursive'] > 0) {
             foreach (explode(',', $conf['pidInList']) as $value) {
                 if ($value === 'this') {
                     $value = $GLOBALS['TSFE']->id;
                 }
                 $pidList .= $value . ',' . $this->getTreeList($value, $conf['recursive']);
             }
             $conf['pidInList'] = trim($pidList, ',');
         }
     }
     if (!strcmp($conf['pidInList'], '')) {
         $conf['pidInList'] = 'this';
     }
     $queryParts = $this->getWhere($table, $conf, TRUE);
     // Fields:
     $queryParts['SELECT'] = $conf['selectFields'] ? $conf['selectFields'] : '*';
     // Setting LIMIT:
     if ($conf['max'] || $conf['begin']) {
         $error = 0;
         // Finding the total number of records, if used:
         if (strstr(strtolower($conf['begin'] . $conf['max']), 'total')) {
             $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', $table, $queryParts['WHERE'], $queryParts['GROUPBY']);
             if ($error = $GLOBALS['TYPO3_DB']->sql_error()) {
                 $GLOBALS['TT']->setTSlogMessage($error);
             } else {
                 $row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
                 $conf['max'] = str_ireplace('total', $row[0], $conf['max']);
                 $conf['begin'] = str_ireplace('total', $row[0], $conf['begin']);
             }
             $GLOBALS['TYPO3_DB']->sql_free_result($res);
         }
         if (!$error) {
             $conf['begin'] = t3lib_div::intInRange(ceil($this->calc($conf['begin'])), 0);
             $conf['max'] = t3lib_div::intInRange(ceil($this->calc($conf['max'])), 0);
             if ($conf['begin'] && !$conf['max']) {
                 $conf['max'] = 100000;
             }
             if ($conf['begin'] && $conf['max']) {
                 $queryParts['LIMIT'] = $conf['begin'] . ',' . $conf['max'];
             } elseif (!$conf['begin'] && $conf['max']) {
                 $queryParts['LIMIT'] = $conf['max'];
             }
         }
     }
     if (!$error) {
         // Setting up tablejoins:
         $joinPart = '';
         if ($conf['join']) {
             $joinPart = 'JOIN ' . trim($conf['join']);
         } elseif ($conf['leftjoin']) {
             $joinPart = 'LEFT OUTER JOIN ' . trim($conf['leftjoin']);
         } elseif ($conf['rightjoin']) {
             $joinPart = 'RIGHT OUTER JOIN ' . trim($conf['rightjoin']);
         }
         // Compile and return query:
         $queryParts['FROM'] = trim($table . ' ' . $joinPart);
         // replace the markers in the queryParts to handle stdWrap
         // enabled properties
         foreach ($queryMarkers as $marker => $markerValue) {
             foreach ($queryParts as $queryPartKey => &$queryPartValue) {
                 $queryPartValue = str_replace('###' . $marker . '###', $markerValue, $queryPartValue);
             }
         }
         $query = $GLOBALS['TYPO3_DB']->SELECTquery($queryParts['SELECT'], $queryParts['FROM'], $queryParts['WHERE'], $queryParts['GROUPBY'], $queryParts['ORDERBY'], $queryParts['LIMIT']);
         return $returnQueryArray ? $queryParts : $query;
     }
 }
开发者ID:NaveedWebdeveloper,项目名称:Test,代码行数:96,代码来源:class.tslib_content.php

示例13: processOutputHook

 /**
  * Hook function for cleaning output XHTML
  * hooks on "class.tslib_fe.php:2946"
  * page.config.tx_seo.sourceCodeFormatter.indentType = space
  * page.config.tx_seo.sourceCodeFormatter.indentAmount = 16
  *
  * @param       array           hook parameters
  * @param       object          Reference to parent object (TSFE-obj)
  * @return      void
  */
 public function processOutputHook(&$feObj, $ref)
 {
     if ($GLOBALS['TSFE']->type != 0) {
         return;
     }
     $configuration = $GLOBALS['TSFE']->config['config']['tx_seo.']['sourceCodeFormatter.'];
     // disabled for this page type
     if (isset($configuration['enable']) && $configuration['enable'] == '0') {
         return;
     }
     // 4.5 compatibility
     if (method_exists('t3lib_div', 'intInRange')) {
         $indentAmount = t3lib_div::intInRange($configuration['indentAmount'], 1, 100);
     } else {
         $indentAmount = t3lib_utility_Math::forceIntegerInRange($configuration['indentAmount'], 1, 100);
     }
     // use the "space" character as a indention type
     if ($configuration['indentType'] == 'space') {
         $indentElement = ' ';
         // use any character from the ASCII table
     } else {
         $indentTypeIsNumeric = FALSE;
         // 4.5 compatibility
         if (method_exists('t3lib_div', 'testInt')) {
             $indentTypeIsNumeric == t3lib_div::testInt($configuration['indentType']);
         } else {
             $indentTypeIsNumeric = t3lib_utility_Math::canBeInterpretedAsInteger($configuration['indentType']);
         }
         if ($indentTypeIsNumeric) {
             $indentElement = chr($configuration['indentType']);
         } else {
             // use tab by default
             $indentElement = "\t";
         }
     }
     $indention = '';
     for ($i = 1; $i <= $indentAmount; $i++) {
         $indention .= $indentElement;
     }
     $spltContent = explode("\n", $ref->content);
     $level = 0;
     $cleanContent = array();
     $textareaOpen = false;
     foreach ($spltContent as $lineNum => $line) {
         $line = trim($line);
         if (empty($line)) {
             continue;
         }
         $out = $line;
         // ugly strpos => TODO: use regular expressions
         // starts with an ending tag
         if (strpos($line, '</div>') === 0 || strpos($line, '<div') !== 0 && strpos($line, '</div>') === strlen($line) - 6 || strpos($line, '</html>') === 0 || strpos($line, '</body>') === 0 || strpos($line, '</head>') === 0 || strpos($line, '</ul>') === 0) {
             $level--;
         }
         if (strpos($line, '<textarea') !== false) {
             $textareaOpen = true;
         }
         // add indention only if no textarea is open
         if (!$textareaOpen) {
             for ($i = 0; $i < $level; $i++) {
                 $out = $indention . $out;
             }
         }
         if (strpos($line, '</textarea>') !== false) {
             $textareaOpen = false;
         }
         // starts with an opening <div>, <ul>, <head> or <body>
         if (strpos($line, '<div') === 0 && strpos($line, '</div>') !== strlen($line) - 6 || strpos($line, '<body') === 0 && strpos($line, '</body>') !== strlen($line) - 7 || strpos($line, '<head') === 0 && strpos($line, '</head>') !== strlen($line) - 7 || strpos($line, '<ul') === 0 && strpos($line, '</ul>') !== strlen($line) - 5) {
             $level++;
         }
         $cleanContent[] = $out;
     }
     $ref->content = implode("\n", $cleanContent);
 }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:84,代码来源:class.tx_seobasics.php

示例14: processAccordingToConfig

 /**
  * Processing of update/insert values based on field type.
  *
  * The input value is typecast and trimmed/shortened according to the field
  * type and the configuration options from the $fInfo parameter.
  *
  * @param	mixed		$value The input value to process
  * @param	array		$fInfo Field configuration data
  * @return	mixed		The processed input value
  */
 private function processAccordingToConfig(&$value, $fInfo)
 {
     $options = $this->parseFieldDef($fInfo['Type']);
     switch (strtolower($options['fieldType'])) {
         case 'int':
         case 'smallint':
         case 'tinyint':
         case 'mediumint':
             $value = intval($value);
             if ($options['featureIndex']['UNSIGNED']) {
                 $value = t3lib_div::intInRange($value, 0);
             }
             break;
         case 'double':
             $value = (double) $value;
             break;
         case 'varchar':
         case 'char':
             $value = substr($value, 0, trim($options['value']));
             break;
         case 'text':
         case 'blob':
             $value = substr($value, 0, 65536);
             break;
         case 'tinytext':
         case 'tinyblob':
             $value = substr($value, 0, 256);
             break;
         case 'mediumtext':
         case 'mediumblob':
             // ??
             break;
     }
 }
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:44,代码来源:class.tx_dbal_sqlengine.php

示例15: extensionSelector

 /**
  * Returns a selector-box with loaded extension keys
  *
  * @param	string		Form element name prefix
  * @param	array		The current values selected
  * @return	string		HTML select element
  */
 function extensionSelector($prefix, $value)
 {
     global $TYPO3_LOADED_EXT;
     $extTrav = array_keys($TYPO3_LOADED_EXT);
     // make box:
     $opt = array();
     $opt[] = '<option value=""></option>';
     foreach ($extTrav as $v) {
         if ($v !== '_CACHEFILE') {
             if (is_array($value)) {
                 $sel = in_array($v, $value) ? ' selected="selected"' : '';
             }
             $opt[] = '<option value="' . htmlspecialchars($v) . '"' . $sel . '>' . htmlspecialchars($v) . '</option>';
         }
     }
     return '<select name="' . $prefix . '[]" multiple="multiple" size="' . t3lib_div::intInRange(count($opt), 5, 10) . '">' . implode('', $opt) . '</select>';
 }
开发者ID:zsolt-molnar,项目名称:TYPO3-4.5-trunk,代码行数:24,代码来源:index.php


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