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


PHP FileUtil::getFiles方法代码示例

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


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

示例1: mediashare_sourcesapi_scanSources

function mediashare_sourcesapi_scanSources()
{
    // Check access
    if (!SecurityUtil::checkPermission('mediashare::', '::', ACCESS_ADMIN)) {
        return LogUtil::registerPermissionError();
    }
    $dom = ZLanguage::getModuleDomain('mediashare');
    // Clear existing sources table
    if (!DBUtil::truncateTable('mediashare_sources')) {
        return LogUtil::registerError(__f('Error in %1$s: %2$s.', array('sourcesapi.scanSources', __f("Could not clear the '%s' table.", 'sources', $dom)), $dom));
    }
    // Scan for sources APIs
    $files = FileUtil::getFiles('modules/mediashare', false, true, 'php', 'f');
    foreach ($files as $file) {
        if (preg_match('/^pnsource_([-a-zA-Z0-9_]+)api.php$/', $file, $matches)) {
            $sourceName = $matches[1];
            $sourceApi = "source_{$sourceName}";
            // Force load - it is used during pninit
            pnModAPILoad('mediashare', $sourceApi, true);
            if (!($title = pnModAPIFunc('mediashare', $sourceApi, 'getTitle'))) {
                return false;
            }
            if (!pnModAPIFunc('mediashare', 'sources', 'addSource', array('title' => $title, 'name' => $sourceName))) {
                return false;
            }
        }
    }
    return true;
}
开发者ID:ro0f,项目名称:Mediashare,代码行数:29,代码来源:pnsourcesapi.php

示例2: getEditors

    /**
     * read editors folder and load names into array
     * 
     * @param array $args
     * @return type 
     */
    public function getEditors($args)
    {
        $path = 'modules/Scribite/plugins';
        $plugins = FileUtil::getFiles($path, false, true, null, 'd');


        $editors = array();

        foreach ($plugins as $pluginName) {
            $className = 'ModulePlugin_Scribite_' . $pluginName . '_Plugin';
            $instance = PluginUtil::loadPlugin($className);
            $pluginstate = PluginUtil::getState($instance->getServiceId(), PluginUtil::getDefaultState());
            if ($pluginstate['state'] == PluginUtil::ENABLED) {
                if (isset($args['format']) && $args['format'] == 'formdropdownlist') {
                    $editors[] = array(
                        'text' => $instance->getMetaDisplayName(),
                        'value' => $pluginName
                    );
                } else {
                    $editors[$pluginName] = $instance->getMetaDisplayName();
                }
            }
        }

        return $editors;
    }
开发者ID:projectesIF,项目名称:Sirius,代码行数:32,代码来源:Admin.php

示例3: getAvatars

 /**
  * Avatar_userapi_GetAvatars()
  *
  * returns all possible avatars for the current user.
  *
  * @param integer $args['uid'] the user ID (if missing, the current user is assumed)
  * @param integer $args['startnum'] int the number where to start (for paging)
  * @param integer $args['perpage'] int items per page
  * @return array a list of avatar file names
  **/
 public function getAvatars($args)
 {
     $uid = isset($args['uid']) ? $args['uid'] : UserUtil::getVar('uid');
     $page = isset($args['page']) ? $args['page'] : -1;
     $perpage = isset($args['perpage']) ? $args['perpage'] : -1;
     $realimages = isset($args['realimages']) ? true : false;
     $avatarpath = ModUtil::getVar('Users', 'avatarpath');
     $allavatars = FileUtil::getFiles($avatarpath, true, true, null, false);
     if ($realimages == true) {
         $allavatars = array_diff($allavatars, array('blank.gif', 'gravatar.gif'));
     }
     $avatars = array();
     foreach ($allavatars as $avatar) {
         // imagename is like pers_XXXX.gif (with XXXX = user id)
         if (ModUtil::apiFunc('Avatar', 'user', 'checkAvatar', array('avatar' => $avatar, 'uid' => $uid)) == true) {
             $avatars[] = $avatar;
         }
     }
     sort($avatars);
     $allcount = count($avatars);
     // paging
     if ($page != -1 && $perpage != -1) {
         $start = ($page - 1) * $perpage;
         $stop = $start + $perpage;
         if ($stop > $allcount) {
             $stop = $allcount;
         }
         $pagedavatars = array();
         for ($idx = $start; $idx < $stop; $idx++) {
             $pagedavatars[] = $avatars[$idx];
         }
         return array($pagedavatars, $allcount);
     }
     return array($avatars, $allcount);
 }
开发者ID:robbrandt,项目名称:Avatar,代码行数:45,代码来源:User.php

示例4: modifyconfig

 /**
  * Modify module Config
  */
 public function modifyconfig()
 {
     $this->throwForbiddenUnless(SecurityUtil::checkPermission('Zgoodies::', '::', ACCESS_ADMIN), LogUtil::getErrorMsgPermission());
     // Get module configuration vars
     $vars = $this->getVars();
     if (!isset($vars['navgoco_save'])) {
         $vars['navgoco_save'] = 1;
     }
     if (!isset($vars['navgoco_accordion'])) {
         $vars['navgoco_accordion'] = 0;
     }
     if (!isset($vars['navgoco_caretHtml'])) {
         $vars['navgoco_caretHtml'] = '';
     }
     if (!isset($vars['navgoco_openClass'])) {
         $vars['navgoco_openClass'] = '';
     }
     if (!isset($vars['navgoco_slideduration'])) {
         $vars['navgoco_slideduration'] = '';
     }
     if (!isset($vars['navgoco_slideeasing'])) {
         $vars['navgoco_slideeasing'] = '';
     }
     if (!isset($vars['accmenu_eventType'])) {
         $vars['accmenu_eventType'] = 'click';
     }
     if (!isset($vars['accmenu_skin'])) {
         $vars['accmenu_skin'] = 'grey.css';
     }
     if (!isset($vars['accmenu_speed'])) {
         $vars['accmenu_speed'] = 'slow';
     }
     if (!isset($vars['accmenu_saveState'])) {
         $vars['accmenu_saveState'] = 1;
     }
     if (!isset($vars['accmenu_autoClose'])) {
         $vars['accmenu_autoClose'] = 1;
     }
     if (!isset($vars['accmenu_autoExpand'])) {
         $vars['accmenu_autoExpand'] = 0;
     }
     if (!isset($vars['accmenu_showCount'])) {
         $vars['accmenu_showCount'] = 0;
     }
     if (!isset($vars['accmenu_hoverDelay'])) {
         $vars['accmenu_hoverDelay'] = 300;
     }
     // Javascript plugin skins
     $pluginskins = FileUtil::getFiles('javascript/jquery-plugins/accordion-menu/css/skins', false, true, null, 'f');
     $this->view->assign('vars', $vars);
     $this->view->assign('pluginskins', $pluginskins);
     return $this->view->fetch('admin/modifyconfig.tpl');
 }
开发者ID:nmpetkov,项目名称:Zgoodies,代码行数:56,代码来源:Admin.php

示例5: getfilemodules

 /**
  * Scan the file system for modules.
  *
  * This function scans the file system for modules and returns an array with all (potential) modules found.
  * This information is used to regenerate the module list.
  *
  * @return array An array of modules found in the file system.
  */
 public function getfilemodules()
 {
     // Security check
     if (!System::isInstalling()) {
         if (!SecurityUtil::checkPermission('Extensions::', '::', ACCESS_ADMIN)) {
             throw new \Zikula\Framework\Exception\ForbiddenException();
         }
     }
     // Get all modules on filesystem
     $filemodules = array();
     // set the paths to search
     $rootdirs = array('system' => ModUtil::TYPE_SYSTEM, 'modules' => ModUtil::TYPE_MODULE);
     foreach ($rootdirs as $rootdir => $moduletype) {
         if (is_dir($rootdir)) {
             $dirs = \FileUtil::getFiles($rootdir, false, true, null, 'd');
             foreach ($dirs as $dir) {
                 ZLoader::addModule($dir, $rootdir);
                 // loads the gettext domain for 3rd party modules
                 if ($rootdir == 'modules' && is_dir("modules/{$dir}/Resources/locale")) {
                     ZLanguage::bindModuleDomain($dir);
                 }
                 try {
                     $modversion = Util::getVersionMeta($dir, $rootdir);
                 } catch (\Exception $e) {
                     LogUtil::registerError($e->getMessage());
                     continue;
                 }
                 if (!isset($modversion['capabilities'])) {
                     $modversion['capabilities'] = array();
                 }
                 $name = $dir;
                 // Work out if admin-capable
                 if (class_exists("{$dir}\\Controller\\AdminController")) {
                     $caps = $modversion['capabilities'];
                     $caps['admin'] = array('version' => '1.0');
                     $modversion['capabilities'] = $caps;
                 }
                 // Work out if user-capable
                 if (class_exists("{$dir}\\Controller\\UserController")) {
                     $caps = $modversion['capabilities'];
                     $caps['user'] = array('version' => '1.0');
                     $modversion['capabilities'] = $caps;
                 }
                 $version = $modversion['version'];
                 $description = $modversion['description'];
                 if (isset($modversion['displayname']) && !empty($modversion['displayname'])) {
                     $displayname = $modversion['displayname'];
                 } else {
                     $displayname = $modversion['name'];
                 }
                 $capabilities = serialize($modversion['capabilities']);
                 // bc for urls
                 if (isset($modversion['url']) && !empty($modversion['url'])) {
                     $url = $modversion['url'];
                 } else {
                     $url = $displayname;
                 }
                 if (isset($modversion['securityschema']) && is_array($modversion['securityschema'])) {
                     $securityschema = serialize($modversion['securityschema']);
                 } else {
                     $securityschema = serialize(array());
                 }
                 $core_min = isset($modversion['core_min']) ? $modversion['core_min'] : '';
                 $core_max = isset($modversion['core_max']) ? $modversion['core_max'] : '';
                 $oldnames = isset($modversion['oldnames']) ? $modversion['oldnames'] : '';
                 if (isset($modversion['dependencies']) && is_array($modversion['dependencies'])) {
                     $moddependencies = serialize($modversion['dependencies']);
                 } else {
                     $moddependencies = serialize(array());
                 }
                 $filemodules[$name] = array('directory' => $dir, 'name' => $name, 'type' => $moduletype, 'displayname' => $displayname, 'url' => $url, 'oldnames' => $oldnames, 'version' => $version, 'capabilities' => $capabilities, 'description' => $description, 'securityschema' => $securityschema, 'dependencies' => $moddependencies, 'core_min' => $core_min, 'core_max' => $core_max);
                 // important: unset modversion and modtype, otherwise the
                 // following modules will have some values not defined in
                 // the next version files to be read
                 unset($modversion);
                 unset($modtype);
             }
         }
     }
     return $filemodules;
 }
开发者ID:planetenkiller,项目名称:core,代码行数:89,代码来源:AdminApi.php

示例6: mediashare_editapi_extappGetApps

/**
 * External applications
 */
function mediashare_editapi_extappGetApps($args)
{
    $apps = array();
    // Scan for application APIs
    $files = FileUtil::getFiles('modules/mediashare', false, true, 'php', 'f');
    foreach ($files as $file) {
        if (preg_match('/^pnextapp_([-a-zA-Z0-9_]+)api.php$/', $file, $matches)) {
            $apps[] = $matches[1];
        }
    }
    return $apps;
}
开发者ID:ro0f,项目名称:Mediashare,代码行数:15,代码来源:pneditapi.php

示例7: gettemplates

    /**
     * Get all templates for a theme
     */
    public function gettemplates($args)
    {
        // check our input
        if (!isset($args['theme']) || empty($args['theme'])) {
            return LogUtil::registerArgsError();
        }

        $args['type'] = isset($args['type']) ? DataUtil::formatForOS($args['type']) : 'modules';

        $themeinfo = ThemeUtil::getInfo(ThemeUtil::getIDFromName($args['theme']));
        $templatedir = 'themes/'.DataUtil::formatForOS($themeinfo['directory']).'/templates';

        if ($args['type'] == 'modules') {
            // for module templates also search on the theme/templates folder
            $templatelist = FileUtil::getFiles($templatedir, false, true, array('.tpl', '.htm'), 'f');
        } else {
            $templatelist = array();
        }

        $templatelist = array_merge($templatelist, FileUtil::getFiles($templatedir.'/'.$args['type'], false, $args['type'], array('.tpl', '.htm'), 'f'));

        return $templatelist;
    }
开发者ID:projectesIF,项目名称:Sirius,代码行数:26,代码来源:User.php

示例8: mediashare_mediahandlerapi_scanMediaHandlers

function mediashare_mediahandlerapi_scanMediaHandlers()
{
    // Check access
    if (!SecurityUtil::checkPermission('mediashare::', '::', ACCESS_ADMIN)) {
        return LogUtil::registerPermissionError();
    }
    $dom = ZLanguage::getModuleDomain('mediashare');
    // Clear existing handler table
    if (!DBUtil::truncateTable('mediashare_mediahandlers')) {
        return LogUtil::registerError(__f('Error in %1$s: %2$s.', array('mediahandlerapi.scanMediaHandlers', __f("Could not clear the '%s' table.", 'mediahandlers', $dom)), $dom));
    }
    // Scan for handlers APIs
    $files = FileUtil::getFiles('modules/mediashare', false, true, 'php', 'f');
    foreach ($files as $file) {
        if (preg_match('/^pnmedia_([-a-zA-Z0-9_]+)api.php$/', $file, $matches)) {
            $handlerName = $matches[1];
            $handlerApi = "media_{$handlerName}";
            // Force load - it is used during pninit
            pnModAPILoad('mediashare', $handlerApi, true);
            if (!($handler = pnModAPIFunc('mediashare', $handlerApi, 'buildHandler'))) {
                return false;
            }
            $fileTypes = $handler->getMediaTypes();
            foreach ($fileTypes as $fileType) {
                $fileType['handler'] = $handlerName;
                $fileType['title'] = $handler->getTitle();
                if (!pnModAPIFunc('mediashare', 'mediahandler', 'addMediaHandler', $fileType)) {
                    return false;
                }
            }
        }
    }
    return true;
}
开发者ID:ro0f,项目名称:Mediashare,代码行数:34,代码来源:pnmediahandlerapi.php

示例9: getInstalledLanguages

 /**
  * Get array of installed languages by code.
  *
  * @return array
  */
 public static function getInstalledLanguages()
 {
     static $localeArray;
     if (isset($localeArray)) {
         return $localeArray;
     }
     // search for locale and config overrides
     $localeArray = array();
     $search = array('config/locale', 'locale');
     foreach ($search as $k) {
         // get only the directories of the search paths
         $locales = FileUtil::getFiles($k, false, true, null, 'd');
         foreach ($locales as $locale) {
             $localeArray[] = self::transformInternal($locale);
         }
     }
     $localeArray = array_unique($localeArray);
     return $localeArray;
 }
开发者ID:rtznprmpftl,项目名称:Zikulacore,代码行数:24,代码来源:ZLanguage.php

示例10: modify

 /**
  * modify block settings
  */
 public function modify($blockinfo)
 {
     // get variable values from database
     $vars = BlockUtil::varsFromContent($blockinfo['content']);
     // installed languages
     $languages = ZLanguage::getInstalledLanguageNames();
     // Javascript plugin data
     $plugindir = 'javascript/jquery-plugins/Nivo-Slider';
     $pluginthemes = FileUtil::getFiles($plugindir . '/themes', false, true, null, 'd');
     // set default values - block
     if (!isset($vars['block_template'])) {
         $vars['block_template'] = 'slider.tpl';
     }
     if (!isset($vars['block_title']) || !is_array($vars['block_title'])) {
         $vars['block_title'] = array();
     }
     foreach (array_keys($languages) as $lang) {
         if (!array_key_exists($lang, $vars['block_title'])) {
             $vars['block_title'][$lang] = '';
         }
     }
     if (!isset($vars['block_wrap'])) {
         $vars['block_wrap'] = true;
     }
     // set default values - content
     if (!isset($vars['slider_content']) || !is_array($vars['slider_content'])) {
         $vars['slider_content'] = array();
     }
     foreach (array_keys($languages) as $lang) {
         if (!array_key_exists($lang, $vars['slider_content'])) {
             $vars['slider_content'][$lang] = '';
         }
     }
     if (!isset($vars['slider_htmlcaption']) || !is_array($vars['slider_htmlcaption'])) {
         $vars['slider_htmlcaption'] = array();
     }
     foreach (array_keys($languages) as $lang) {
         if (!array_key_exists($lang, $vars['slider_htmlcaption'])) {
             $vars['slider_htmlcaption'][$lang] = '';
         }
     }
     if (!isset($vars['slider_content_editor'])) {
         $vars['slider_content_editor'] = true;
     }
     if (!isset($vars['slider_theme'])) {
         $vars['slider_theme'] = 'default';
     }
     if (!isset($vars['slider_effect'])) {
         $vars['slider_effect'] = 'random';
     }
     if (!isset($vars['slider_slices'])) {
         $vars['slider_slices'] = 15;
     }
     if (!isset($vars['slider_boxCols'])) {
         $vars['slider_boxCols'] = 8;
     }
     if (!isset($vars['slider_boxRows'])) {
         $vars['slider_boxRows'] = 4;
     }
     if (!isset($vars['slider_animSpeed'])) {
         $vars['slider_animSpeed'] = 500;
     }
     if (!isset($vars['slider_pauseTime'])) {
         $vars['slider_pauseTime'] = 3000;
     }
     if (!isset($vars['slider_startSlide'])) {
         $vars['slider_startSlide'] = 0;
     }
     if (!isset($vars['slider_directionNav'])) {
         $vars['slider_directionNav'] = true;
     }
     if (!isset($vars['slider_controlNav'])) {
         $vars['slider_controlNav'] = true;
     }
     if (!isset($vars['slider_controlNavThumbs'])) {
         $vars['slider_controlNavThumbs'] = false;
     }
     if (!isset($vars['slider_pauseOnHover'])) {
         $vars['slider_pauseOnHover'] = true;
     }
     if (!isset($vars['slider_manualAdvance'])) {
         $vars['slider_manualAdvance'] = false;
     }
     if (!isset($vars['slider_randomStart'])) {
         $vars['slider_randomStart'] = false;
     }
     $this->view->assign('vars', $vars);
     $this->view->assign('bid', $blockinfo['bid']);
     $this->view->assign('languages', $languages);
     $this->view->assign('plugindir', $plugindir);
     $this->view->assign('pluginthemes', $pluginthemes);
     $this->view->assign('plugineffects', array('sliceDown', 'sliceDownLeft', 'sliceUp', 'sliceUpLeft', 'sliceUpDown', 'sliceUpDownLeft', 'fold', 'fade', 'random', 'slideInRight', 'slideInLeft', 'boxRandom', 'boxRain', 'boxRainReverse', 'boxRainGrow', 'boxRainGrowReverse'));
     return $this->view->fetch('blocks/slider_modify.tpl');
 }
开发者ID:nmpetkov,项目名称:Zgoodies,代码行数:97,代码来源:Slider.php

示例11: mediashare_userapi_getAllTemplates

/**
 * Templates
 */
function mediashare_userapi_getAllTemplates()
{
    $templates = array();
    $sets = FileUtil::getFiles('modules/mediashare/pntemplates/Frontend', false, true, null, 'd');
    if (file_exists('config/templates/mediashare/Frontend')) {
        $add = FileUtil::getFiles('config/templates/mediashare/Frontend', false, true, null, 'd');
        $sets = array_merge($sets, $add);
    }
    foreach ($sets as $set) {
        $templates[] = array('title' => $set, 'value' => $set);
    }
    return $templates;
}
开发者ID:ro0f,项目名称:Mediashare,代码行数:16,代码来源:pnuserapi.php

示例12: smarty_function_duditemmodify


//.........这里部分代码省略.........
        return $render->fetch('profile_dudedit_select.tpl');
    }

    if ($item['prop_attribute_name'] == 'avatar') {
        // detect if it's the registration form to skip this
        if ($onregistrationform) {
            return '';
        }

        // only shows a link to the Avatar module if available
        if (ModUtil::available('Avatar')) {
            // TODO Add a change-link to the admins
            // only shows the link for the own user
            if (UserUtil::getVar('uid') != $uid) {
                return '';
            }
            $render->assign('linktext', __('Go to the Avatar manager', $dom));
            $render->assign('linkurl', ModUtil::url('Avatar', 'user', 'main'));
            $output = $render->fetch('profile_dudedit_link.tpl');
            // add a hidden input if this is required
            if ($item['prop_required']) {
                $output .= $render->fetch('profile_dudedit_hidden.tpl');
            }
           
            return $output;
        }

        // display the avatar selector
        if (empty($uservalue)) {
            $uservalue = 'gravatar.gif';
        }
        $render->assign('value', DataUtil::formatForDisplay($uservalue));
        $avatarPath = ModUtil::getVar(Users_Constant::MODNAME, Users_Constant::MODVAR_AVATAR_IMAGE_PATH, Users_Constant::DEFAULT_AVATAR_IMAGE_PATH);
        $filelist = FileUtil::getFiles($avatarPath, false, true, array('gif', 'jpg', 'png'), 'f');
        asort($filelist);

        $listoutput = $listoptions = $filelist;

        // strip the extension of the output list
        foreach ($listoutput as $k => $output) {
            $listoutput[$k] = $output;//substr($output, 0, strrpos($output, '.'));
        }

        $selectedvalue = $uservalue;
//        if (in_array($uservalue, $filelist)) {
//            $selectedvalue = $uservalue;
//        }

        $render->assign('value',          $selectedvalue);
        $render->assign('selectmultiple', '');
        $render->assign('listoptions',    $listoptions);
        $render->assign('listoutput',     $listoutput);
        return $render->fetch('profile_dudedit_select.tpl');
    }

    switch ($item['prop_displaytype'])
    {
        case 0: // TEXT
            $type = 'text';
            break;

        case 1: // TEXTAREA
            $type = 'textarea';
            break;

        case 2: // CHECKBOX
开发者ID:projectesIF,项目名称:Sirius,代码行数:67,代码来源:function.duditemmodify.php

示例13: regenerate

    /**
     * Regenerates the theme list.
     */
    public static function regenerate()
    {
        // Get all themes on filesystem
        $filethemes = array();
        ModUtil::dbInfoLoad('Themes', 'Themes', true);
        if (is_dir('themes')) {
            $dirArray = FileUtil::getFiles('themes', false, true, null, 'd');
            foreach ($dirArray as $dir) {
                // Work out the theme type
                if (file_exists("themes/$dir/version.php") && !file_exists("themes/$dir/theme.php")) {
                    $themetype = 3;
                } else {
                    // anything else isn't a theme
                    continue;
                }

                // Get some defaults in case we don't have a theme version file
                $themeversion['name'] = preg_replace('/_/', ' ', $dir);
                $themeversion['displayname'] = preg_replace('/_/', ' ', $dir);
                $themeversion['version'] = '0';
                $themeversion['description'] = '';

                // include the correct version file based on theme type and
                // manipulate the theme version information
                if (file_exists($file = "themes/$dir/version.php")) {
                    if (!include($file)) {
                        LogUtil::registerError(__f('Error! Could not include theme version file: %s', $file));
                    }
                }

                $filethemes[$themeversion['name']] = array('directory' => $dir,
                        'name' => $themeversion['name'],
                        'type' => $themetype,
                        'displayname' => (isset($themeversion['displayname']) ? $themeversion['displayname'] : $themeversion['name']),
                        'version' => (isset($themeversion['version']) ? $themeversion['version'] : '1.0'),
                        'description' => (isset($themeversion['description']) ? $themeversion['description'] : $themeversion['displayname']),
                        'admin' => (isset($themeversion['admin']) ? (int)$themeversion['admin'] : '0'),
                        'user' => (isset($themeversion['user']) ? (int)$themeversion['user'] : '1'),
                        'system' => (isset($themeversion['system']) ? (int)$themeversion['system'] : '0'),
                        'state' => (isset($themeversion['state']) ? $themeversion['state'] : ThemeUtil::STATE_ACTIVE),
                        'contact' => (isset($themeversion['contact']) ? $themeversion['contact'] : ''),
                        'xhtml' => (isset($themeversion['xhtml']) ? (int)$themeversion['xhtml'] : 1));

                // important: unset themeversion otherwise all following themes will have
                // at least the same regid or other values not defined in
                // the next version.php files to be read
                unset($themeversion);
                unset($themetype);
            }
        }

        // Get all themes in DB
        $dbthemes = DBUtil::selectObjectArray('themes', '', '', -1, -1, 'name');

        // See if we have lost any themes since last generation
        foreach ($dbthemes as $name => $themeinfo) {
            if (empty($filethemes[$name])) {
                // delete a running configuration
                ModUtil::apiFunc('Theme', 'admin', 'deleterunningconfig', array('themename' => $name));
                $result = DBUtil::deleteObjectByID('themes', $name, 'name');
                unset($dbthemes[$name]);
            }
        }

        // See if we have gained any themes since last generation,
        // or if any current themes have been upgraded
        foreach ($filethemes as $name => $themeinfo) {
            if (empty($dbthemes[$name])) {
                // New theme
                $themeinfo['state'] = ThemeUtil::STATE_ACTIVE;
                DBUtil::insertObject($themeinfo, 'themes', 'id');
            }
        }

        // see if any themes have changed
        foreach ($filethemes as $name => $themeinfo) {
            if (isset($dbthemes[$name])) {
                if (($themeinfo['directory'] != $dbthemes[$name]['directory']) ||
                        ($themeinfo['type'] != $dbthemes[$name]['type']) ||
                        ($themeinfo['admin'] != $dbthemes[$name]['admin']) ||
                        ($themeinfo['user'] != $dbthemes[$name]['user']) ||
                        ($themeinfo['system'] != $dbthemes[$name]['system']) ||
                        ($themeinfo['state'] != $dbthemes[$name]['state']) ||
                        ($themeinfo['contact'] != $dbthemes[$name]['contact']) ||
                        ($themeinfo['xhtml'] != $dbthemes[$name]['xhtml'])) {
                    $themeinfo['id'] = $dbthemes[$name]['id'];
                    DBUtil::updateObject($themeinfo, 'themes');
                }
            }
        }

        return true;
    }
开发者ID:projectesIF,项目名称:Sirius,代码行数:96,代码来源:Util.php

示例14: gettemplates

    /**
     * Utility function to return a list of template sets for
     * displaying the comments input/output
     *
     * @return array array of template set names (directories)
     */
    public function gettemplates()
    {
        if (!SecurityUtil::checkPermission('EZComments::', '::', ACCESS_READ)) {
            return false;
        }

        $modinfo  = ModUtil::getInfo(ModUtil::getIdFromName('EZComments'));
        $osmoddir = DataUtil::formatForOS($modinfo['directory']);
        $ostheme  = DataUtil::formatForOS(UserUtil::getTheme());
        $rootdirs = array("modules/$osmoddir/templates/",
                          "config/templates/$osmoddir/",
                          "themes/$ostheme/templates/$osmoddir/");

        $templates = array();

        // read each directory for template sets
        foreach ($rootdirs as $rootdir) {
            $folders = FileUtil::getFiles($rootdir, false, true, null, 'd');
            foreach ($folders as $folder) {
                if (!in_array($folder, array('plugins'))) {
                    $templates[] = $folder;
                }
            }
        }

        // return a list with no duplicates
        return array_unique($templates);
    }
开发者ID:projectesIF,项目名称:Sirius,代码行数:34,代码来源:User.php

示例15: clear_cssjscombinecache

 /**
  * Clear CSS/JS combination cached files.
  *
  * Using this function, the user can clear all CSS/JS combination cached
  * files for the system.
  *
  * @return boolean
  */
 public function clear_cssjscombinecache()
 {
     $cache_dir = $this->cache_dir;
     $cached_files = FileUtil::getFiles($cache_dir, true, false, array('php'), null, false);
     foreach ($cached_files as $cf) {
         unlink(realpath($cf));
     }
     // The configuration has been changed, so we clear all caches.
     // clear Zikula_View_Theme cache
     self::clear_all_cache();
     // clear Zikula_View cache (really needed?)
     Zikula_View::getInstance()->clear_all_cache();
     return true;
 }
开发者ID:rmaiwald,项目名称:core,代码行数:22,代码来源:Theme.php


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