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


PHP JString::ltrim方法代码示例

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


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

示例1: render

 /**
  * Render a file in form/details view, stored data in $this->output
  *
  * @param   object  &$model   Element model
  * @param   object  &$params  Element params
  * @param   string  $file     Row data for this element
  *
  * @return  void
  */
 public function render(&$model, &$params, $file)
 {
     jimport('joomla.filesystem.file');
     /*
      * $$$ hugh - TESTING - if $file is empty, we're going to just build an empty bit of DOM
      * which can then be filled in with the selected image using HTML5 in browser.
      */
     if (empty($file)) {
         if ($params->get('make_thumbnail', false)) {
             $maxWidth = $params->get('thumb_max_width', 125);
             $maxHeight = $params->get('thumb_max_height', 125);
             $this->output .= '<img style="width: ' . $maxWidth . 'px;" src="" alt="" />';
         }
     } else {
         $filename = basename($file);
         $filename = strip_tags($filename);
         $ext = JFile::getExt($filename);
         if (!strstr($file, 'http://') && !strstr($file, 'https://')) {
             // $$$rob only add in livesite if we don't already have a full url (e.g. from amazons3)
             // Trim / or \ off the start of $file
             $file = JString::ltrim($file, '/\\');
             $file = COM_FABRIK_LIVESITE . $file;
         }
         $file = str_replace("\\", "/", $file);
         $file = $model->storage->preRenderPath($file);
         $layout = $model->getLayout('file');
         $displayData = new stdClass();
         $displayData->thumb = COM_FABRIK_LIVESITE . 'media/com_fabrik/images/' . $ext . '.png';
         $displayData->useThumb = $params->get('make_thumbnail', false) && JFile::exists($displayData->thumb);
         $displayData->ext = $ext;
         $displayData->filename = $filename;
         $displayData->file = $file;
         $this->output = $layout->render($displayData);
     }
 }
开发者ID:LGBGit,项目名称:tierno,代码行数:44,代码来源:file.php

示例2: revert

 function revert(&$url_array, $pos)
 {
     global $_SEF_SPACE;
     $QUERY_STRING = '';
     $url_array = array_filter($url_array);
     // V x : traling slash can cause empty array element
     $url_array = array_values($url_array);
     if (!empty($url_array[1]) && strcspn($url_array[1], ',') == strlen($url_array[1])) {
         // This is a nocache url
         $x = 0;
         $c = count($url_array);
         while ($x < $c) {
             if (isset($url_array[$x]) && $url_array[$x] != '' && isset($url_array[$x + 1]) && $url_array[$x + 1] != '') {
                 $QUERY_STRING .= '&' . $url_array[$x] . '=' . $url_array[$x + 1];
             }
             $x += 2;
         }
     } else {
         //This is a default mambo SEF url for a component
         foreach ($url_array as $value) {
             $temp = explode(",", $value);
             if (isset($temp[0]) && $temp[0] != '' && isset($temp[1]) && $temp[1] != "") {
                 $QUERY_STRING .= "&{$temp['0']}={$temp['1']}";
             }
         }
     }
     //return str_replace("&option","option",$QUERY_STRING);
     return JString::ltrim($QUERY_STRING, '&');
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:29,代码来源:sef_ext.php

示例3: render

 /**
  * @param object element model
  * @param object element params
  * @param string row data for this element
  */
 function render(&$model, &$params, $file)
 {
     jimport('joomla.filesystem.file');
     $filename = basename($file);
     $filename = strip_tags($filename);
     $ext = JFile::getExt($filename);
     //$file = str_replace("\\", "/", COM_FABRIK_LIVESITE  . $file);
     if (!strstr($file, 'http://') && !strstr($file, 'https://')) {
         // $$$rob only add in livesite if we dont already have a full url (eg from amazons3)
         // $$$ hugh trim / or \ off the start of $file
         $file = JString::ltrim($file, '/\\');
         $file = COM_FABRIK_LIVESITE . $file;
     }
     $file = str_replace("\\", "/", $file);
     $file = $model->storage->preRenderPath($file);
     $thumb_path = COM_FABRIK_BASE . 'media/com_fabrik/images/' . $ext . '.png';
     // $$$ hugh - using 'make_thumbnail' to mean 'use default $ext.png as an icon
     // instead of just putting the filename.
     if ($params->get('make_thumbnail', false) && JFile::exists($thumb_path)) {
         $thumb_file = COM_FABRIK_LIVESITE . "/media/com_fabrik/images/" . $ext . ".png";
         $this->output = "<a class=\"download-archive fabrik-filetype-{$ext}\" title=\"{$file}\" href=\"{$file}\"><img src=\"{$thumb_file}\" alt=\"{$filename}\"></a>";
     } else {
         $this->output = "<a class=\"download-archive fabrik-filetype-{$ext}\" title=\"{$file}\" href=\"{$file}\">" . $filename . "</a>";
     }
 }
开发者ID:rogeriocc,项目名称:fabrik,代码行数:30,代码来源:file.php

示例4: render

 /**
  * Internally render the plugin, and add required script declarations
  * to the document
  *
  * @return  void
  */
 public function render()
 {
     $params = $this->getParams();
     $document = JFactory::getDocument();
     $document->addScript("http://api.simile-widgets.org/runway/1.0/runway-api.js");
     $c = 0;
     $images = (array) $params->get('coverflow_image');
     $titles = (array) $params->get('coverflow_title');
     $subtitles = (array) $params->get('coverflow_subtitle');
     $listIds = (array) $params->get('coverflow_table');
     $eventData = array();
     foreach ($listIds as $listId) {
         $listModel = JModelLegacy::getInstance('List', 'FabrikFEModel');
         $listModel->setId($listId);
         $list = $listModel->getTable();
         $listModel->getPagination(0, 0, 0);
         $image = $images[$c];
         $title = $titles[$c];
         $subtitle = $subtitles[$c];
         $data = $listModel->getData();
         if ($listModel->canView() || $listModel->canEdit()) {
             $elements = $listModel->getElements();
             $imageElement = FArrayHelper::getValue($elements, FabrikString::safeColName($image));
             foreach ($data as $group) {
                 if (is_array($group)) {
                     foreach ($group as $row) {
                         $event = new stdClass();
                         if (!method_exists($imageElement, 'getStorage')) {
                             switch (get_class($imageElement)) {
                                 case 'FabrikModelFabrikImage':
                                     $rootFolder = $imageElement->getParams()->get('selectImage_root_folder');
                                     $rootFolder = JString::ltrim($rootFolder, '/');
                                     $rootFolder = JString::rtrim($rootFolder, '/');
                                     $event->image = COM_FABRIK_LIVESITE . 'images/stories/' . $rootFolder . '/' . $row->{$image . '_raw'};
                                     break;
                                 default:
                                     $event->image = isset($row->{$image . '_raw'}) ? $row->{$image . '_raw'} : '';
                                     break;
                             }
                         } else {
                             $event->image = $imageElement->getStorage()->pathToURL($row->{$image . '_raw'});
                         }
                         $event->title = $title === '' ? '' : (string) strip_tags($row->{$title});
                         $event->subtitle = $subtitle === '' ? '' : (string) strip_tags($row->{$subtitle});
                         $eventData[] = $event;
                     }
                 }
             }
         }
         $c++;
     }
     $json = json_encode($eventData);
     $str = "var coverflow = new FbVisCoverflow({$json});";
     $srcs = FabrikHelperHTML::framework();
     $srcs['Coverflow'] = $this->srcBase . 'coverflow/coverflow.js';
     FabrikHelperHTML::script($srcs, $str);
 }
开发者ID:jfquestiaux,项目名称:fabrik,代码行数:63,代码来源:coverflow.php

示例5: _prePayment

 function _prePayment($data)
 {
     $this->autoload();
     $pingback_url = JString::ltrim(JURI::root() . 'index.php?option=com_bookpro&controller=payment&task=postpayment&paction=display_message&status=success&method=' . $this->_element . '&res=#RC#&fres=#FC#&ac=#APP#&ref=#REF#&tran=#TRANID#&invoice=#INVOICE#&err=#EM#');
     $faild_url = JString::ltrim(JURI::root() . 'index.php?option=com_bookpro&controller=payment&task=postpayment&paction=display_message&status=failed&method=' . $this->_element);
     $config = $this->getConfig();
     $params = array('MERCHKEY' => $config->MERCHKEY, 'TRANTYPE' => 'AUTHPOST', 'AMT' => $this->formatNumber($data['total']), 'CURR' => $config->currency, 'INVOICE' => $data['order_number'], 'URLAPPROVED' => $pingback_url, 'URLOTHER' => $pingback_url);
     JbPaymentLib::write_log('nbd.txt', 'Checkout: ' . json_encode($params));
     JbPaymentLib::submitForm($params, $this->getPaymentUrl($config->testmode));
 }
开发者ID:hixbotay,项目名称:executivetransport,代码行数:10,代码来源:payment_nbd.php

示例6: updateShurls

 public static function updateShurls()
 {
     $pageInfo =& Sh404sefFactory::getPageInfo();
     $sefConfig =& Sh404sefFactory::getConfig();
     $pageInfo->shURL = empty($pageInfo->shURL) ? '' : $pageInfo->shURL;
     if ($sefConfig->enablePageId && !$sefConfig->stopCreatingShurls) {
         try {
             jimport('joomla.utilities.string');
             $nonSefUrl = JString::ltrim($pageInfo->currentNonSefUrl, '/');
             $nonSefUrl = shSortURL($nonSefUrl);
             // make sure we have a language
             $nonSefUrl = shSetURLVar($nonSefUrl, 'lang', $pageInfo->currentLanguageShortTag);
             // remove tracking vars (Google Analytics)
             $nonSefUrl = Sh404sefHelperGeneral::stripTrackingVarsFromNonSef($nonSefUrl);
             // try to get the current shURL, if any
             $shURL = ShlDbHelper::selectResult('#__sh404sef_pageids', array('pageid'), array('newurl' => $nonSefUrl));
             // if none, we may have to create one
             if (empty($shURL)) {
                 $shURL = self::_createShurl($nonSefUrl);
             }
             // insert in head and header, if not empty
             if (!empty($shURL)) {
                 $fullShURL = JString::ltrim($pageInfo->getDefaultFrontLiveSite(), '/') . '/' . $shURL;
                 $document = JFactory::getDocument();
                 if ($sefConfig->insertShortlinkTag) {
                     $document->addHeadLink($fullShURL, 'shortlink');
                     // also add header, especially for HEAD requests
                     JResponse::setHeader('Link', '<' . $fullShURL . '>; rel=shortlink', true);
                 }
                 if ($sefConfig->insertRevCanTag) {
                     $document->addHeadLink($fullShURL, 'canonical', 'rev', array('type' => 'text/html'));
                 }
                 if ($sefConfig->insertAltShorterTag) {
                     $document->addHeadLink($fullShURL, 'alternate shorter');
                 }
                 // store for reuse
                 $pageInfo->shURL = $shURL;
             }
         } catch (Exception $e) {
             ShlSystem_Log::error('sh404sef', '%s::%s::%d: %s', __CLASS__, __METHOD__, __LINE__, $e->getMessage());
         }
     }
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:43,代码来源:shurl.php

示例7: render

 /**
  * @param object element model
  * @param object element params
  * @param string row data for this element
  */
 function render(&$model, &$params, $file)
 {
     jimport('joomla.filesystem.file');
     $filename = basename($file);
     $filename = strip_tags($filename);
     $ext = JFile::getExt($filename);
     if (!strstr($file, 'http://') && !strstr($file, 'https://')) {
         // $$$rob only add in livesite if we dont already have a full url (eg from amazons3)
         // $$$ hugh trim / or \ off the start of $file
         $file = JString::ltrim($file, '/\\');
         $file = COM_FABRIK_LIVESITE . $file;
     }
     $file = str_replace("\\", "/", $file);
     $file = $model->storage->preRenderPath($file);
     $this->output = "<a class=\"download-archive fabrik-filetype-{$ext}\" title=\"{$filename}\" href=\"{$file}\">";
     if ($thumb_file = $this->getThumbnail($model, $params, $file)) {
         $filename = "<img src=\"{$thumb_file}\" alt=\"{$filename}\" />";
     }
     $this->output .= $filename . "</a>";
 }
开发者ID:rogeriocc,项目名称:fabrik,代码行数:25,代码来源:pdf.php

示例8: updateShurls

 public static function updateShurls()
 {
     $sefConfig =& shRouter::shGetConfig();
     // set the short link tag
     $shPageInfo =& shRouter::shPageInfo();
     $shPageInfo->shURL = '';
     if ($sefConfig->enablePageId && !$sefConfig->stopCreatingShurls) {
         try {
             jimport('joomla.utilities.string');
             $nonSefUrl = JString::ltrim($shPageInfo->shCurrentPageNonSef, '/');
             $nonSefUrl = shSortURL($nonSefUrl);
             // remove tracking vars (Google Analytics)
             $nonSefUrl = Sh404sefHelperGeneral::stripTrackingVarsFromNonSef($nonSefUrl);
             // try to get the current shURL, if any
             $shURL = Sh404sefHelperDb::selectResult('#__sh404sef_pageids', array('pageid'), array('newurl' => $nonSefUrl));
             // if none, we may have to create one
             if (empty($shURL)) {
                 $shURL = self::_createShurl($nonSefUrl);
             }
             // insert in head and header, if not empty
             if (!empty($shURL)) {
                 $fullShURL = JString::ltrim($GLOBALS['shConfigLiveSite'], '/') . '/' . $shURL;
                 $document =& JFactory::getDocument();
                 if ($sefConfig->insertShortlinkTag) {
                     $document->addHeadLink($fullShURL, 'shortlink');
                     // also add header, especially for HEAD requests
                     JResponse::setHeader('Link', '<' . $fullShURL . '>; rel=shortlink', true);
                 }
                 if ($sefConfig->insertRevCanTag) {
                     $document->addHeadLink($fullShURL, 'canonical', 'rev', array('type' => 'text/html'));
                 }
                 if ($sefConfig->insertAltShorterTag) {
                     $document->addHeadLink($fullShURL, 'alternate shorter');
                 }
                 // store for reuse
                 $shPageInfo->shURL = $shURL;
             }
         } catch (Sh404sefExceptionDefault $e) {
         }
     }
 }
开发者ID:sangkasi,项目名称:joomla,代码行数:41,代码来源:shurl.php

示例9: attach

 /**
  * Centralized location to attach asset to any page. It avoids duplicate
  * attachement
  * @staticvar boolean $added
  * @param type $path
  * @param type $type
  * @param type $assetPath
  * @return type
  */
 public function attach($path, $type, $assetPath = '')
 {
     $document = JFactory::getDocument();
     if ($document->getType() != 'html') {
         return;
     }
     if (!empty($assetPath)) {
         $path = $assetPath . $path;
     } else {
         $path = JURI::root(true) . '/components/com_community/' . JString::ltrim($path, '/');
     }
     switch ($type) {
         case 'js':
             $document->addScript($path);
             break;
         case 'css':
             //do not attach style.css if current direction is rtl (style.rtl is loaded from views/view)
             if ($document->direction == 'rtl' && strpos($path, 'style.css') !== false) {
                 break;
             }
             $document->addStyleSheet($path);
             break;
     }
 }
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:33,代码来源:assets.php

示例10: createPageId

 public function createPageId($sefUrl, $nonSefUrl)
 {
     $shURL = '';
     if (!$this->_mustCreatePageid($nonSefUrl)) {
         return $shURL;
     }
     jimport('joomla.utilities.string');
     $sefUrl = JString::ltrim($sefUrl, '/');
     try {
         if (!empty($sefUrl)) {
             // check that we don't already have a shURL for the same SEF url, even if non-sef differ
             $result = (int) Sh404sefHelperDb::count('#__redirection', '*', $this->_db->nameQuote('oldurl') . ' = ? and ' . $this->_db->nameQuote('newurl') . ' <> ?', array($sefUrl, ''));
             if (!empty($result) && $result > 1) {
                 // we already have a SEF URL, so we must already have a shURL as well
                 return $shURL;
             }
         }
         // check this nonsef url does not already have a shURL
         $existingShurl = Sh404sefHelperDb::selectResult('#__sh404sef_pageids', 'pageid', array('newurl' => $nonSefUrl));
         // there already is a shurl for the same non-sef
         if (!empty($existingShurl)) {
             return $existingShurl;
         }
         // if we don't already have a shURL, create the new one
         $shURL = $this->_buildPageId();
         if (!empty($shURL)) {
             // insert in db
             Sh404sefHelperDb::insert('#__sh404sef_pageids', array('newurl' => $nonSefUrl, 'pageid' => $shURL, 'type' => Sh404sefHelperGeneral::COM_SH404SEF_URLTYPE_PAGEID, 'hits' => 0));
         }
     } catch (Sh404sefExceptionDefault $e) {
         _log('DB error creating pageId ' . $e->getMessage());
     }
     // don't need to add the pageid to cache, won't be needed when building up the page,
     //only when decoding incoming url
     return $shURL;
 }
开发者ID:sangkasi,项目名称:joomla,代码行数:36,代码来源:pageids.php

示例11: shAddPaginationInfo


//.........这里部分代码省略.........
        $shMultPageLength = $sefConfig->pagerep . (empty($limit) ? $listLimit : $limit);
    } else {
        $shMultPageLength = '';
    }
    // shumisha : modified to add # of items per page to URL, for table-category or section-category
    if (!empty($sefConfig->pageTexts[$GLOBALS['shMosConfig_locale']]) && false !== strpos($sefConfig->pageTexts[$GLOBALS['shMosConfig_locale']], '%s')) {
        $page = str_replace('%s', $pagenum, $sefConfig->pageTexts[$GLOBALS['shMosConfig_locale']]) . $shMultPageLength;
    } else {
        $page = $sefConfig->pagerep . $pagenum . $shMultPageLength;
    }
    // V 1.2.4.t special processing to replace page number by headings
    $shPageNumberWasReplaced = false;
    if (strpos($url, 'option=com_content') !== false && strpos($url, 'view=article') !== false && !empty($limitstart)) {
        // this is multipage article - limitstart instead of limit in J1.5
        if ($sefConfig->shMultipagesTitle) {
            parse_str($url, $shParams);
            if (!empty($shParams['id'])) {
                $shPageTitle = '';
                $sql = 'SELECT c.id, c.fulltext, c.introtext  FROM #__content AS c WHERE id=\'' . $shParams['id'] . '\'';
                $database->setQuery($sql);
                $contentElement = $database->loadObject();
                if ($database->getErrorNum()) {
                    JError::RaiseError(500, $database->stderr());
                }
                $contentText = $contentElement->introtext . $contentElement->fulltext;
                if (!empty($contentElement) && strpos($contentText, 'class="system-pagebreak') !== false) {
                    // search for mospagebreak tags
                    // copied over from pagebreak plugin
                    // expression to search for
                    $regex = '#<hr([^>]*)class=(\\"|\')system-pagebreak(\\"|\')([^>]*)\\/>#iU';
                    // find all instances of mambot and put in $matches
                    $shMatches = array();
                    preg_match_all($regex, $contentText, $shMatches, PREG_SET_ORDER);
                    // adds heading or title to <site> Title
                    if (empty($limitstart)) {
                        // if first page use heading of first mospagebreak
                        /* if ( $shMatches[0][2] ) {
                           parse_str( html_entity_decode( $shMatches[0][2] ), $args );
                           if ( @$args['heading'] ) {
                           $shPageTitle = stripslashes( $args['heading'] );
                           }
                           }*/
                    } else {
                        // for other pages use title of mospagebreak
                        if ($limitstart > 0 && $shMatches[$limitstart - 1][1]) {
                            $args = JUtility::parseAttributes($shMatches[$limitstart - 1][0]);
                            if (@$args['title']) {
                                $shPageTitle = $args['title'];
                            } else {
                                if (@$args['alt']) {
                                    $shPageTitle = $args['alt'];
                                } else {
                                    // there is a page break, but no title. Use a page number
                                    $shPageTitle = str_replace('%s', $limitstart + 1, $sefConfig->pageTexts[$GLOBALS['shMosConfig_locale']]);
                                }
                            }
                        }
                    }
                }
                if (!empty($shPageTitle)) {
                    // found a heading, we should use that as a Title
                    $location .= $shSeparator . titleToLocation($shPageTitle);
                }
                $shPageNumberWasReplaced = true;
                // always set the flag, otherwise we'll a Page-1 added
            }
        } else {
            // mutiple pages article, but we don't want to use smart title.
            // directly use limitstart
            $page = str_replace('%s', $limitstart + 1, $sefConfig->pageTexts[$GLOBALS['shMosConfig_locale']]);
        }
    }
    // maybe this is a multipage with "showall=1"
    if (strpos($url, 'option=com_content') !== false && strpos($url, 'view=article') !== false && strpos($url, 'showall=1') !== false) {
        // this is multipage article with showall
        $tempTitle = JText::_('All Pages');
        $location .= $shSeparator . titleToLocation($tempTitle);
        $shPageNumberWasReplaced = true;
        // always set the flag, otherwise we'll a Page-1 added
    }
    // make sure we remove bad characters
    $takethese = str_replace('|', '', $sefConfig->friendlytrim);
    $location = JString::trim($location, $takethese);
    // add page number
    if (!$shPageNumberWasReplaced && (!isset($limitstart) && (isset($limit) && $limit != $listLimit && $limit != $defaultListLimit) || isset($limitstart) && ($limitstart != 0 || $limitstart == 0 && (strpos($url, 'option=com_virtuemart') && $sefConfig->shVmUsingItemsPerPage && (isset($limit) && $limit != $listLimit))))) {
        $location .= $shSeparator . $page;
    }
    // add suffix
    if (!empty($shSuffix) && $location != '/' && JString::substr($location, -1) != '/') {
        $location = $shSuffix == '/' ? $location . $shSuffix : str_replace($shSuffix, '', $location) . $shSuffix;
    }
    // add default index file
    if ($sefConfig->addFile) {
        // V 1.2.4.t
        if (empty($shSuffix) || !empty($shSuffix) && JString::subStr($location, -$suffixLength) != $shSuffix) {
            $location .= (JString::substr($location, -1) == '/' ? '' : '/') . $sefConfig->addFile;
        }
    }
    return JString::ltrim($location, '/');
}
开发者ID:sangkasi,项目名称:joomla,代码行数:101,代码来源:sh404sef.class.php

示例12: replaceWithFormData

 /**
  * Called from parseMessageForPlaceHolder to iterate through string to replace
  * {placeholder} with posted data
  *
  * @param   string  $matches  placeholder e.g. {placeholder}
  *
  * @return	string	posted data that corresponds with placeholder
  */
 protected function replaceWithFormData($matches)
 {
     // Merge any join data key val pairs down into the main data array
     $joins = JArrayHelper::getValue($this->_searchData, 'join', array());
     foreach ($joins as $k => $data) {
         foreach ($data as $k => $v) {
             $this->_searchData[$k] = $v;
         }
     }
     $match = $matches[0];
     $orig = $match;
     /* strip the {} */
     $match = JString::substr($match, 1, JString::strlen($match) - 2);
     // $$$ rob test this format searchvalue||defaultsearchvalue
     $bits = explode('||', $match);
     if (count($bits) == 2) {
         $match = self::parseMessageForPlaceHolder('{' . $bits[0] . '}', $this->_searchData, false);
         $default = $bits[1];
         if ($match == '') {
             // 	$$$ rob seems like bits[1] in fabrik plugin is already matched so return that rather then reparsing
             // $match = self::parseMessageForPlaceHolder("{".$bits[1]."}", $this->_searchData);
             return $bits[1] !== '' ? $bits[1] : $orig;
         } else {
             return $match !== '' ? $match : $orig;
         }
     }
     // $$$ hugh - NOOOOOOO!!  Screws up where people actually have mixed case element names
     // $match = JString::strtolower($match);
     $match = preg_replace("/ /", "_", $match);
     if (!strstr($match, '.')) {
         /* for some reason array_key_exists wasnt working for nested arrays?? */
         $aKeys = array_keys($this->_searchData);
         /* remove the table prefix from the post key */
         $aPrefixFields = array();
         for ($i = 0; $i < count($aKeys); $i++) {
             $aKeyParts = explode('___', $aKeys[$i]);
             if (count($aKeyParts) == 2) {
                 $tablePrefix = array_shift($aKeyParts);
                 $field = array_pop($aKeyParts);
                 $aPrefixFields[$field] = $tablePrefix;
             }
         }
         if (array_key_exists($match, $aPrefixFields)) {
             $match = $aPrefixFields[$match] . '___' . $match;
         }
         // Test to see if the made match is in the post key arrays
         $found = in_array($match, $aKeys, true);
         if ($found) {
             /* get the post data */
             $match = $this->_searchData[$match];
             if (is_array($match)) {
                 $newmatch = '';
                 // Deal with radio boxes etc inside repeat groups
                 foreach ($match as $m) {
                     if (is_array($m)) {
                         $newmatch .= ',' . implode(',', $m);
                     } else {
                         $newmatch .= ',' . $m;
                     }
                 }
                 $match = JString::ltrim($newmatch, ',');
             }
         } else {
             $match = '';
         }
     } else {
         /* could be looking for URL field type eg for $_POST[url][link] the match text will be url.link */
         $aMatch = explode(".", $match);
         $aPost = $this->_searchData;
         foreach ($aMatch as $sPossibleArrayKey) {
             if (is_array($aPost)) {
                 if (!isset($aPost[$sPossibleArrayKey])) {
                     return $orig;
                 } else {
                     $aPost = $aPost[$sPossibleArrayKey];
                 }
             }
         }
         $match = $aPost;
     }
     if ($this->_parseAddSlases) {
         $match = htmlspecialchars($match, ENT_QUOTES, 'UTF-8');
     }
     return $found ? $match : $orig;
 }
开发者ID:rogeriocc,项目名称:fabrik,代码行数:93,代码来源:parent.php

示例13: stripTrackingVarsFromSef

 public static function stripTrackingVarsFromSef($url)
 {
     // do we have query vars?
     $parts = explode('?', $url);
     if (empty($parts[1])) {
         // no variable parts, return identical
         return $url;
     }
     $trackingVars = self::_getTrackingVars();
     $cleaned = self::stripVarsFromNonSef('?' . $parts[1], $trackingVars);
     // rebuild and return
     $cleaned = JString::ltrim($cleaned, '?&');
     $cleaned = $parts[0] . (empty($cleaned) ? '' : '?' . $cleaned);
     return $cleaned;
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:15,代码来源:general.php

示例14: getURI

 /**
  * Return the absolute URI path to the resource
  */
 public function getURI($storageId)
 {
     $root = JString::rtrim(JURI::root(), '/');
     $storageId = JString::ltrim($storageId, '/');
     return $root . '/' . $storageId;
 }
开发者ID:Jougito,项目名称:DynWeb,代码行数:9,代码来源:file.php

示例15: render

 /**
  * Render PDF in the form view
  *
  * @param   object &$model  Element model
  * @param   object &$params Element params
  * @param   string $file    Row data for this element
  *
  * @return  void
  */
 public function render(&$model, &$params, $file)
 {
     jimport('joomla.filesystem.file');
     $layout = $model->getLayout('pdf');
     $displayData = new stdClass();
     $filename = basename($file);
     $filename = strip_tags($filename);
     if (!strstr($file, 'http://') && !strstr($file, 'https://')) {
         // $$$rob only add in livesite if we don't already have a full url (e.g. from amazons3)
         // $$$ hugh trim / or \ off the start of $file
         $file = JString::ltrim($file, '/\\');
         $file = COM_FABRIK_LIVESITE . $file;
     }
     $file = str_replace("\\", "/", $file);
     $file = $model->storage->preRenderPath($file);
     $displayData->file = $file;
     $displayData->filename = $filename;
     $displayData->thumb = $this->getThumbnail($model, $params, $file);
     $this->output = $layout->render($displayData);
 }
开发者ID:LGBGit,项目名称:tierno,代码行数:29,代码来源:pdf.php


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