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


PHP Utility\MathUtility类代码示例

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


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

示例1: generateSitemapContent

 /**
  * Generates news site map.
  *
  * @return    void
  */
 protected function generateSitemapContent()
 {
     if (count($this->pidList) > 0) {
         $languageCondition = '';
         $language = GeneralUtility::_GP('L');
         if (MathUtility::canBeInterpretedAsInteger($language)) {
             $languageCondition = ' AND sys_language_uid=' . $language;
         }
         /** @noinspection PhpUndefinedMethodInspection */
         $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tx_t3blog_post', 'pid IN (' . implode(',', $this->pidList) . ')' . $languageCondition . $this->cObj->enableFields('tx_t3blog_post'), '', 'date DESC', $this->offset . ',' . $this->limit);
         /** @noinspection PhpUndefinedMethodInspection */
         $rowCount = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
         /** @noinspection PhpUndefinedMethodInspection */
         while (FALSE !== ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {
             if ($url = $this->getPostItemUrl($row)) {
                 echo $this->renderer->renderEntry($url, $row['title'], $row['date'], '', $row['tagClouds']);
             }
         }
         /** @noinspection PhpUndefinedMethodInspection */
         $GLOBALS['TYPO3_DB']->sql_free_result($res);
         if ($rowCount === 0) {
             echo '<!-- It appears that there are no tx_t3blog_post entries. If your ' . 'blog storage sysfolder is outside of the rootline, you may ' . 'want to use the dd_googlesitemap.skipRootlineCheck=1 TS ' . 'setup option. Beware: it is insecure and may cause certain ' . 'undesired effects! Better move your news sysfolder ' . 'inside the rootline! -->';
         }
     }
 }
开发者ID:dextar1,项目名称:t3extblog,代码行数:30,代码来源:Generator.php

示例2: render

 /**
  * @param int $value
  * @param int $bit
  * @return bool
  */
 public function render($value = null, $bit = 0)
 {
     if ($value === null) {
         $value = $this->renderChildren();
     }
     return \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($bit) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($value) ? ((int) $bit & (int) $value) > 0 : false;
 }
开发者ID:S3b0,项目名称:ecom_toolbox,代码行数:12,代码来源:CheckBitViewHelper.php

示例3: importCommand

 /**
  * Import command
  *
  * @param string $icsCalendarUri
  * @param int    $pid
  */
 public function importCommand($icsCalendarUri = NULL, $pid = NULL)
 {
     if ($icsCalendarUri === NULL || !filter_var($icsCalendarUri, FILTER_VALIDATE_URL)) {
         $this->enqueueMessage('You have to enter a valid URL to the iCalendar ICS', 'Error', FlashMessage::ERROR);
     }
     if (!MathUtility::canBeInterpretedAsInteger($pid)) {
         $this->enqueueMessage('You have to enter a valid PID for the new created elements', 'Error', FlashMessage::ERROR);
     }
     // fetch external URI and write to file
     $this->enqueueMessage('Start to checkout the calendar: ' . $icsCalendarUri, 'Calendar', FlashMessage::INFO);
     $relativeIcalFile = 'typo3temp/ical.' . GeneralUtility::shortMD5($icsCalendarUri) . '.ical';
     $absoluteIcalFile = GeneralUtility::getFileAbsFileName($relativeIcalFile);
     $content = GeneralUtility::getUrl($icsCalendarUri);
     GeneralUtility::writeFile($absoluteIcalFile, $content);
     // get Events from file
     $icalEvents = $this->getIcalEvents($absoluteIcalFile);
     $this->enqueueMessage('Found ' . sizeof($icalEvents) . ' events in the given calendar', 'Items', FlashMessage::INFO);
     $events = $this->prepareEvents($icalEvents);
     $this->enqueueMessage('This is just a first draft. There are same missing fields. Will be part of the next release', 'Items', FlashMessage::ERROR);
     return;
     foreach ($events as $event) {
         $eventObject = $this->eventRepository->findOneByImportId($event['uid']);
         if ($eventObject instanceof Event) {
             // update
             $eventObject->setTitle($event['title']);
             $eventObject->setDescription($this->nl2br($event['description']));
             $this->eventRepository->update($eventObject);
             $this->enqueueMessage('Update Event Meta data: ' . $eventObject->getTitle(), 'Update');
         } else {
             // create
             $eventObject = new Event();
             $eventObject->setPid($pid);
             $eventObject->setImportId($event['uid']);
             $eventObject->setTitle($event['title']);
             $eventObject->setDescription($this->nl2br($event['description']));
             $configuration = new Configuration();
             $configuration->setType(Configuration::TYPE_TIME);
             $configuration->setFrequency(Configuration::FREQUENCY_NONE);
             /** @var \DateTime $startDate */
             $startDate = clone $event['start'];
             $startDate->setTime(0, 0, 0);
             $configuration->setStartDate($startDate);
             /** @var \DateTime $endDate */
             $endDate = clone $event['end'];
             $endDate->setTime(0, 0, 0);
             $configuration->setEndDate($endDate);
             $startTime = $this->dateTimeToDaySeconds($event['start']);
             if ($startTime > 0) {
                 $configuration->setStartTime($startTime);
                 $configuration->setEndTime($this->dateTimeToDaySeconds($event['end']));
                 $configuration->setAllDay(FALSE);
             } else {
                 $configuration->setAllDay(TRUE);
             }
             $eventObject->addCalendarize($configuration);
             $this->eventRepository->add($eventObject);
             $this->enqueueMessage('Add Event: ' . $eventObject->getTitle(), 'Add');
         }
     }
 }
开发者ID:sirdiego,项目名称:calendarize,代码行数:66,代码来源:ImportCommandController.php

示例4: __construct

 /**
  * Constructor
  */
 public function __construct()
 {
     // we check for existence of our targetDirectory
     if (!is_dir(PATH_site . $this->targetDirectory)) {
         GeneralUtility::mkdir_deep(PATH_site . $this->targetDirectory);
     }
     // if enabled, we check whether we should auto-create the .htaccess file
     if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['generateApacheHtaccess']) {
         // check whether .htaccess exists
         $htaccessPath = PATH_site . $this->targetDirectory . '.htaccess';
         if (!file_exists($htaccessPath)) {
             GeneralUtility::writeFile($htaccessPath, $this->htaccessTemplate);
         }
     }
     // decide whether we should create gzipped versions or not
     $compressionLevel = $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['compressionLevel'];
     // we need zlib for gzencode()
     if (extension_loaded('zlib') && $compressionLevel) {
         $this->createGzipped = true;
         // $compressionLevel can also be TRUE
         if (MathUtility::canBeInterpretedAsInteger($compressionLevel)) {
             $this->gzipCompressionLevel = (int) $compressionLevel;
         }
     }
     $this->setInitialPaths();
 }
开发者ID:vip3out,项目名称:TYPO3.CMS,代码行数:29,代码来源:ResourceCompressor.php

示例5: getCurrentFocusPoint

 /**
  * Get focus point information
  *
  * @param $uid
  *
  * @return array|FALSE|NULL
  */
 protected function getCurrentFocusPoint($uid)
 {
     $row = GlobalUtility::getDatabaseConnection()->exec_SELECTgetSingleRow('focus_point_x, focus_point_y', 'sys_file_metadata', 'uid=' . $uid);
     $row['focus_point_x'] = MathUtility::forceIntegerInRange((int) $row['focus_point_x'], -100, 100, 0);
     $row['focus_point_y'] = MathUtility::forceIntegerInRange((int) $row['focus_point_y'], -100, 100, 0);
     return $row;
 }
开发者ID:shugden,项目名称:focuspoint,代码行数:14,代码来源:FocuspointController.php

示例6: getRecords

 /**
  * Get the Records
  *
  * @param integer                                        $startPage
  * @param array                                          $basePages
  * @param Tx_GoogleServices_Controller_SitemapController $obj
  *
  * @throws Exception
  * @return Tx_GoogleServices_Domain_Model_Node
  */
 public function getRecords($startPage, $basePages, Tx_GoogleServices_Controller_SitemapController $obj)
 {
     $nodes = array();
     if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('tt_news')) {
         return $nodes;
     }
     if (!\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($GLOBALS['TSFE']->tmpl->setup['plugin.']['tt_news.']['singlePid'])) {
         throw new Exception('You have to set tt_news singlePid.');
     }
     $singlePid = intval($GLOBALS['TSFE']->tmpl->setup['plugin.']['tt_news.']['singlePid']);
     $news = $this->getRecordsByField('tt_news', 'pid', implode(',', $basePages));
     foreach ($news as $record) {
         // Alternative Single PID
         $alternativeSinglePid = $this->alternativeSinglePid($record['uid']);
         $linkPid = $alternativeSinglePid ? $alternativeSinglePid : $singlePid;
         // Build URL
         $url = $obj->getUriBuilder()->setArguments(array('tx_ttnews' => array('tt_news' => $record['uid'])))->setTargetPageUid($linkPid)->build();
         // can't generate a valid url
         if (!strlen($url)) {
             continue;
         }
         // Build Node
         $node = new Tx_GoogleServices_Domain_Model_Node();
         $node->setLoc($url);
         $node->setPriority($this->getPriority($record));
         $node->setChangefreq('monthly');
         $node->setLastmod($this->getModifiedDate($record));
         $nodes[] = $node;
     }
     return $nodes;
 }
开发者ID:sirdiego,项目名称:google_services,代码行数:41,代码来源:News.php

示例7: callModule

 /**
  * This method forwards the call to Bootstrap's run() method. This method is invoked by the mod.php
  * function of TYPO3.
  *
  * @param string $moduleSignature
  * @throws \RuntimeException
  * @return boolean TRUE, if the request request could be dispatched
  * @see run()
  */
 public function callModule($moduleSignature)
 {
     if (!isset($GLOBALS['TBE_MODULES']['_configuration'][$moduleSignature])) {
         return FALSE;
     }
     $moduleConfiguration = $GLOBALS['TBE_MODULES']['_configuration'][$moduleSignature];
     // Check permissions and exit if the user has no permission for entry
     $GLOBALS['BE_USER']->modAccess($moduleConfiguration, TRUE);
     $id = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id');
     if ($id && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($id)) {
         // Check page access
         $permClause = $GLOBALS['BE_USER']->getPagePermsClause(TRUE);
         $access = is_array(\TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess((int) $id, $permClause));
         if (!$access) {
             throw new \RuntimeException('You don\'t have access to this page', 1289917924);
         }
     }
     // BACK_PATH is the path from the typo3/ directory from within the
     // directory containing the controller file. We are using mod.php dispatcher
     // and thus we are already within typo3/ because we call typo3/mod.php
     $GLOBALS['BACK_PATH'] = '';
     $configuration = array('extensionName' => $moduleConfiguration['extensionName'], 'pluginName' => $moduleSignature);
     if (isset($moduleConfiguration['vendorName'])) {
         $configuration['vendorName'] = $moduleConfiguration['vendorName'];
     }
     $bootstrap = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Core\\BootstrapInterface');
     $content = $bootstrap->run('', $configuration);
     print $content;
     return TRUE;
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:39,代码来源:ModuleRunner.php

示例8: checkSolrConnection

 /**
  * Check if a connection to a Solr server could be established with the given credentials.
  *
  * @access	public
  *
  * @param	array		&$params: An array with parameters
  * @param	\TYPO3\CMS\Core\TypoScript\ConfigurationForm &$pObj: The parent object
  *
  * @return	string		Message informing the user of success or failure
  */
 public function checkSolrConnection(&$params, &$pObj)
 {
     // Prepend username and password to hostname.
     if (!empty($this->conf['solrUser']) && !empty($this->conf['solrPass'])) {
         $host = $this->conf['solrUser'] . ':' . $this->conf['solrPass'] . '@' . (!empty($this->conf['solrHost']) ? $this->conf['solrHost'] : 'localhost');
     } else {
         $host = !empty($this->conf['solrHost']) ? $this->conf['solrHost'] : 'localhost';
     }
     // Set port if not set.
     $port = !empty($this->conf['solrPort']) ? \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->conf['solrPort'], 0, 65535, 8180) : 8180;
     // Trim path and append trailing slash.
     $path = !empty($this->conf['solrPath']) ? trim($this->conf['solrPath'], '/') . '/' : '';
     // Build request URI.
     $url = 'http://' . $host . ':' . $port . '/' . $path . 'admin/cores';
     $context = stream_context_create(array('http' => array('method' => 'GET', 'user_agent' => !empty($this->conf['useragent']) ? $this->conf['useragent'] : ini_get('user_agent'))));
     // Try to connect to Solr server.
     $response = @simplexml_load_string(file_get_contents($url, FALSE, $context));
     // Check status code.
     if ($response) {
         $status = $response->xpath('//lst[@name="responseHeader"]/int[@name="status"]');
         if (is_array($status)) {
             $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', sprintf($GLOBALS['LANG']->getLL('solr.status'), (string) $status[0]), $GLOBALS['LANG']->getLL('solr.connected'), $status[0] == 0 ? \TYPO3\CMS\Core\Messaging\FlashMessage::OK : \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING, FALSE);
             $this->content .= $message->render();
             return $this->content;
         }
     }
     $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', sprintf($GLOBALS['LANG']->getLL('solr.error'), $url), $GLOBALS['LANG']->getLL('solr.notConnected'), \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING, FALSE);
     $this->content .= $message->render();
     return $this->content;
 }
开发者ID:jacmendt,项目名称:goobi-presentation,代码行数:40,代码来源:class.tx_dlf_em.php

示例9: process

 /**
  * This method actually does the processing of files locally
  *
  * takes the original file (on remote storages this will be fetched from the remote server)
  * does the IM magic on the local server by creating a temporary typo3temp/ file
  * copies the typo3temp/ file to the processing folder of the target storage
  * removes the typo3temp/ file
  *
  * @param TaskInterface $task
  * @return array
  */
 public function process(TaskInterface $task)
 {
     $targetFile = $task->getTargetFile();
     // Merge custom configuration with default configuration
     $configuration = array_merge(array('width' => 64, 'height' => 64), $task->getConfiguration());
     $configuration['width'] = Utility\MathUtility::forceIntegerInRange($configuration['width'], 1, 1000);
     $configuration['height'] = Utility\MathUtility::forceIntegerInRange($configuration['height'], 1, 1000);
     $originalFileName = $targetFile->getOriginalFile()->getForLocalProcessing(FALSE);
     // Create a temporary file in typo3temp/
     if ($targetFile->getOriginalFile()->getExtension() === 'jpg') {
         $targetFileExtension = '.jpg';
     } else {
         $targetFileExtension = '.png';
     }
     // Create the thumb filename in typo3temp/preview_....jpg
     $temporaryFileName = Utility\GeneralUtility::tempnam('preview_') . $targetFileExtension;
     // Check file extension
     if ($targetFile->getOriginalFile()->getType() != Resource\File::FILETYPE_IMAGE && !Utility\GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'], $targetFile->getOriginalFile()->getExtension())) {
         // Create a default image
         $this->processor->getTemporaryImageWithText($temporaryFileName, 'Not imagefile!', 'No ext!', $targetFile->getOriginalFile()->getName());
     } else {
         // Create the temporary file
         if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['im']) {
             $parameters = '-sample ' . $configuration['width'] . 'x' . $configuration['height'] . ' ' . $this->processor->wrapFileName($originalFileName) . '[0] ' . $this->processor->wrapFileName($temporaryFileName);
             $cmd = Utility\GeneralUtility::imageMagickCommand('convert', $parameters) . ' 2>&1';
             Utility\CommandUtility::exec($cmd);
             if (!file_exists($temporaryFileName)) {
                 // Create a error gif
                 $this->processor->getTemporaryImageWithText($temporaryFileName, 'No thumb', 'generated!', $targetFile->getOriginalFile()->getName());
             }
         }
     }
     return array('filePath' => $temporaryFileName);
 }
开发者ID:nicksergio,项目名称:TYPO3v4-Core,代码行数:45,代码来源:LocalPreviewHelper.php

示例10: prepareLoader

 /**
  * Get all the complex data for the loader.
  * This return value will be cached and stored in the database
  * There is no file monitoring for this cache
  *
  * @param Loader $autoLoader
  * @param int $type
  *
  * @return array
  */
 public function prepareLoader(Loader $autoLoader, $type)
 {
     $slots = [];
     $slotPath = ExtensionManagementUtility::extPath($autoLoader->getExtensionKey()) . 'Classes/Slots/';
     $slotClasses = FileUtility::getBaseFilesInDir($slotPath, 'php');
     foreach ($slotClasses as $slot) {
         $slotClass = ClassNamingUtility::getFqnByPath($autoLoader->getVendorName(), $autoLoader->getExtensionKey(), 'Slots/' . $slot);
         if (!$autoLoader->isInstantiableClass($slotClass)) {
             continue;
         }
         $methods = ReflectionUtility::getPublicMethods($slotClass);
         foreach ($methods as $methodReflection) {
             /** @var MethodReflection $methodReflection */
             $tagConfiguration = ReflectionUtility::getTagConfiguration($methodReflection, ['signalClass', 'signalName', 'signalPriority']);
             foreach ($tagConfiguration['signalClass'] as $key => $signalClass) {
                 if (!isset($tagConfiguration['signalName'][$key])) {
                     continue;
                 }
                 $priority = isset($tagConfiguration['signalPriority'][$key]) ? $tagConfiguration['signalPriority'][$key] : 0;
                 $priority = MathUtility::forceIntegerInRange($priority, 0, 100);
                 $slots[$priority][] = ['signalClassName' => trim($signalClass, '\\'), 'signalName' => $tagConfiguration['signalName'][$key], 'slotClassNameOrObject' => $slotClass, 'slotMethodName' => $methodReflection->getName()];
             }
         }
     }
     $slots = $this->flattenSlotsByPriority($slots);
     return $slots;
 }
开发者ID:phogl,项目名称:autoloader,代码行数:37,代码来源:Slots.php

示例11: verify_TSobjects

 /**
  * Verify TS objects
  *
  * @param array $propertyArray
  * @param string $parentType
  * @param string $parentValue
  * @return array
  * @todo Define visibility
  */
 public function verify_TSobjects($propertyArray, $parentType, $parentValue)
 {
     $TSobjTable = array('PAGE' => array('prop' => array('typeNum' => 'int', '1,2,3' => 'COBJ', 'bodyTag' => 'string')), 'TEXT' => array('prop' => array('value' => 'string')), 'HTML' => array('prop' => array('value' => 'stdWrap')), 'stdWrap' => array('prop' => array('field' => 'string', 'current' => 'boolean')));
     $TSobjDataTypes = array('COBJ' => 'TEXT,CONTENT', 'PAGE' => 'PAGE', 'stdWrap' => '');
     if ($parentType) {
         if (isset($TSobjDataTypes[$parentType]) && (!$TSobjDataTypes[$parentType] || \TYPO3\CMS\Core\Utility\GeneralUtility::inlist($TSobjDataTypes[$parentType], $parentValue))) {
             $ObjectKind = $parentValue;
         } else {
             // Object kind is "" if it should be known.
             $ObjectKind = '';
         }
     } else {
         // If parentType is not given, then it can be anything. Free.
         $ObjectKind = $parentValue;
     }
     if ($ObjectKind && is_array($TSobjTable[$ObjectKind])) {
         $result = array();
         if (is_array($propertyArray)) {
             foreach ($propertyArray as $key => $val) {
                 if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($key)) {
                     // If num-arrays
                     $result[$key] = $TSobjTable[$ObjectKind]['prop']['1,2,3'];
                 } else {
                     // standard
                     $result[$key] = $TSobjTable[$ObjectKind]['prop'][$key];
                 }
             }
         }
         return $result;
     }
 }
开发者ID:nicksergio,项目名称:TYPO3v4-Core,代码行数:40,代码来源:TypoScriptTemplateObjectBrowserModuleFunctionController.php

示例12: renderStatic

 /**
  * @param array $arguments
  * @param \Closure $renderChildrenClosure
  * @param RenderingContextInterface $renderingContext
  *
  * @return string
  */
 public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
 {
     $title = $arguments['title'];
     $message = $arguments['message'];
     $state = $arguments['state'];
     $isInRange = MathUtility::isIntegerInRange($state, -2, 2);
     if (!$isInRange) {
         $state = -2;
     }
     $iconName = $arguments['iconName'];
     $disableIcon = $arguments['disableIcon'];
     if ($message === null) {
         $messageTemplate = $renderChildrenClosure();
     } else {
         $messageTemplate = htmlspecialchars($message);
     }
     $classes = [self::STATE_NOTICE => 'notice', self::STATE_INFO => 'info', self::STATE_OK => 'success', self::STATE_WARNING => 'warning', self::STATE_ERROR => 'danger'];
     $icons = [self::STATE_NOTICE => 'lightbulb-o', self::STATE_INFO => 'info', self::STATE_OK => 'check', self::STATE_WARNING => 'exclamation', self::STATE_ERROR => 'times'];
     $stateClass = $classes[$state];
     $icon = $icons[$state];
     if ($iconName !== null) {
         $icon = $iconName;
     }
     $iconTemplate = '';
     if (!$disableIcon) {
         $iconTemplate = '' . '<div class="media-left">' . '<span class="fa-stack fa-lg callout-icon">' . '<i class="fa fa-circle fa-stack-2x"></i>' . '<i class="fa fa-' . htmlspecialchars($icon) . ' fa-stack-1x"></i>' . '</span>' . '</div>';
     }
     $titleTemplate = '';
     if ($title !== null) {
         $titleTemplate = '<h4 class="callout-title">' . htmlspecialchars($title) . '</h4>';
     }
     return '<div class="callout callout-' . htmlspecialchars($stateClass) . '">' . '<div class="media">' . $iconTemplate . '<div class="media-body">' . $titleTemplate . '<div class="callout-body">' . $messageTemplate . '</div>' . '</div>' . '</div>' . '</div>';
 }
开发者ID:vip3out,项目名称:TYPO3.CMS,代码行数:40,代码来源:InfoboxViewHelper.php

示例13: main

 /**
  * The main method of the PlugIn
  *
  * @access	public
  *
  * @param	string		$content: The PlugIn content
  * @param	array		$conf: The PlugIn configuration
  *
  * @return	string		The content that is displayed on the website
  */
 public function main($content, $conf)
 {
     $this->init($conf);
     // Merge configuration with conf array of toolbox.
     $this->conf = tx_dlf_helper::array_merge_recursive_overrule($this->cObj->data['conf'], $this->conf);
     // Load current document.
     $this->loadDocument();
     if ($this->doc === NULL || $this->doc->numPages < 1 || empty($this->conf['fileGrpFulltext'])) {
         // Quit without doing anything if required variables are not set.
         return $content;
     } else {
         // Set default values if not set.
         // page may be integer or string (physical page attribute)
         if ((int) $this->piVars['page'] > 0 || empty($this->piVars['page'])) {
             $this->piVars['page'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange((int) $this->piVars['page'], 1, $this->doc->numPages, 1);
         } else {
             $this->piVars['page'] = array_search($this->piVars['page'], $this->doc->physicalPages);
         }
         $this->piVars['double'] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->piVars['double'], 0, 1, 0);
     }
     // Load template file.
     if (!empty($this->conf['templateFile'])) {
         $this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['templateFile']), '###TEMPLATE###');
     } else {
         $this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/toolbox/tools/fulltext/template.tmpl'), '###TEMPLATE###');
     }
     $fullTextFile = $this->doc->physicalPagesInfo[$this->doc->physicalPages[$this->piVars['page']]]['files'][$this->conf['fileGrpFulltext']];
     if (!empty($fullTextFile)) {
         $markerArray['###FULLTEXT_SELECT###'] = '<a class="select switchoff" id="tx-dlf-tools-fulltext" title="" data-dic="fulltext-on:' . $this->pi_getLL('fulltext-on', '', TRUE) . ';fulltext-off:' . $this->pi_getLL('fulltext-off', '', TRUE) . '"></a>';
     } else {
         $markerArray['###FULLTEXT_SELECT###'] = $this->pi_getLL('fulltext-not-available', '', TRUE);
     }
     $content .= $this->cObj->substituteMarkerArray($this->template, $markerArray);
     return $this->pi_wrapInBaseClass($content);
 }
开发者ID:jacmendt,项目名称:goobi-presentation,代码行数:45,代码来源:class.tx_dlf_toolsFulltext.php

示例14: clearUrlCacheForRecords

 /**
  * Clears URL cache for records.
  *
  * Currently only clears URL cache for pages but should also clear alias
  * cache for records later.
  *
  * @param array $parameters
  * @return void
  */
 public function clearUrlCacheForRecords(array $parameters)
 {
     if ($parameters['table'] == 'pages' && MathUtility::canBeInterpretedAsInteger($parameters['uid'])) {
         $cacheInstance = CacheFactory::getCache();
         $cacheInstance->clearUrlCacheForPage($parameters['uid']);
     }
 }
开发者ID:rvock,项目名称:typo3-realurl,代码行数:16,代码来源:Cache.php

示例15: __construct

 /**
  * Construct a status
  *
  * All values must be given as constructor arguments.
  * All strings should be localized.
  *
  * @param string $title Status title, eg. "Deprecation log"
  * @param string $value Status value, eg. "Disabled"
  * @param string $message Optional message further describing the title/value combination
  * 			Example:, eg "The deprecation log is important and does foo, to disable it do bar"
  * @param integer $severity A severity level. Use one of the constants above!
  */
 public function __construct($title, $value, $message = '', $severity = self::OK)
 {
     $this->title = (string) $title;
     $this->value = (string) $value;
     $this->message = (string) $message;
     $this->severity = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($severity, self::NOTICE, self::ERROR, self::OK);
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:19,代码来源:Status.php


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