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


PHP JComponentHelper::GetParams方法代码示例

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


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

示例1: getBasePath

 /**
  * Method to get the base upload path for a project
  *
  * @param     int       $project     Optional project id
  *
  * @return    string    $basepath    The upload directory
  */
 public static function getBasePath($project = null)
 {
     static $cache = array();
     $project = (int) $project;
     // Check the cache
     if (isset($cache[$project])) {
         return $cache[$project];
     }
     $params = JComponentHelper::GetParams('com_pfrepo');
     $dest = $params->get('repo_basepath', '/media/com_projectfork/repo/');
     $base = JPATH_SITE . '/';
     $fchar = substr($dest, 0, 1);
     $lchar = substr($dest, -1, 1);
     if ($fchar == '/' || $fchar == '\\') {
         $dest = substr($dest, 1);
     }
     if ($lchar == '/' || $lchar == '\\') {
         $dest = substr($dest, 0, -1);
     }
     if ($project) {
         $db = JFactory::getDbo();
         $query = $db->getQuery(true);
         $query->select('path')->from('#__pf_repo_dirs')->where('project_id = ' . $project)->where('parent_id = 1');
         $db->setQuery($query);
         $path = $db->loadResult();
         if (empty($path)) {
             $query->clear()->select('alias')->from('#__pf_projects')->where('id = ' . $project);
             $db->setQuery($query);
             $path = $db->loadResult();
         }
         if ($path) {
             $dest .= '/' . $path;
         }
     }
     $cache[$project] = JPath::clean($base . $dest);
     return $cache[$project];
 }
开发者ID:gagnonjeanfrancois,项目名称:Projectfork,代码行数:44,代码来源:pfrepo.php

示例2: getProjectParams

 /**
  * Method to get the Projectfork config settings merged into
  * the project settings
  *
  * @param     integer    $id        Optional project id. If not provided, will use the currently active project
  *
  * @return    object     $params    The config settings
  */
 public static function getProjectParams($id = 0)
 {
     static $cache = array();
     $project = $id > 0 ? (int) $id : self::getActiveProjectId();
     if (array_key_exists($project, $cache)) {
         return $cache[$project];
     }
     $params = JComponentHelper::GetParams('com_projectfork');
     // Get the project parameters if they exist
     if ($project) {
         $db = JFactory::getDbo();
         $query = $db->getQuery(true);
         $query->select('attribs')->from('#__pf_projects')->where('id = ' . $db->quote($project));
         $db->setQuery((string) $query);
         $attribs = $db->loadResult();
         if (!empty($attribs)) {
             $registry = new JRegistry();
             $registry->loadString($attribs);
             $params->merge($registry);
         }
     }
     $cache[$project] = $params;
     return $cache[$project];
 }
开发者ID:gagnonjeanfrancois,项目名称:Projectfork,代码行数:32,代码来源:helper.php

示例3: getBasePath

 /**
  * Method to get the base upload path for a design
  *
  * @param     int       $project     Optional project id
  *
  * @return    string    $basepath    The upload directory
  */
 public static function getBasePath($project = NULL)
 {
     jimport('joomla.filesystem.path');
     $params = JComponentHelper::GetParams('com_pfdesigns');
     $base = JPATH_SITE . '/';
     $dest = $params->get('design_basepath', '/images/com_projectfork/designs/');
     $fchar = substr($dest, 0, 1);
     $lchar = substr($dest, -1, 1);
     if ($fchar == '/' || $fchar == '\\') {
         $dest = substr($dest, 1);
     }
     if ($lchar == '/' || $lchar == '\\') {
         $dest = substr($dest, 0, -1);
     }
     if (is_numeric($project)) {
         $dest .= '/project_' . (int) $project;
     }
     $basepath = JPath::clean($base . $dest);
     return $basepath;
 }
开发者ID:MrJookie,项目名称:pm,代码行数:27,代码来源:pfdesigns.php


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