• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP mosReadDirectory函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: showInstalledComponents

/**
* @param string The URL option
*/
function showInstalledComponents($option)
{
    global $database, $mosConfig_absolute_path;
    $database->setQuery("SELECT *" . "\n FROM #__components" . "\n WHERE parent = 0 AND iscore = 0" . "\n ORDER BY name");
    $rows = $database->loadObjectList();
    // Read the component dir to find components
    $componentBaseDir = mosPathName($mosConfig_absolute_path . '/administrator/components');
    $componentDirs = mosReadDirectory($componentBaseDir);
    $n = count($rows);
    for ($i = 0; $i < $n; $i++) {
        $row =& $rows[$i];
        $dirName = mosPathName($componentBaseDir . $row->option);
        $xmlFilesInDir = mosReadDirectory($dirName, '.xml$');
        foreach ($xmlFilesInDir as $xmlfile) {
            // Read the file to see if it's a valid component XML file
            $parser =& new mosXMLDescription($dirName . $xmlfile);
            if ($parser->getType() != 'component') {
                continue;
            }
            $row->creationdate = $parser->getCreationDate('component');
            $row->author = $parser->getAuthor('component');
            $row->copyright = $parser->getCopyright('component');
            $row->authorEmail = $parser->getAuthorEmail('component');
            $row->authorUrl = $parser->getAuthorUrl('component');
            $row->version = $parser->getVersion('component');
            $row->mosname = strtolower(str_replace(" ", "_", $row->name));
        }
    }
    HTML_component::showInstalledComponents($rows, $option);
}
开发者ID:jwest00724,项目名称:mambo,代码行数:33,代码来源:component.php


示例2: mosReadDirectory

 function mosReadDirectory($path, $filter = '.', $recurse = false, $fullpath = false)
 {
     $arr = array();
     if (!@is_dir($path)) {
         return $arr;
     }
     $handle = opendir($path);
     while ($file = readdir($handle)) {
         $dir = mosPathName($path . '/' . $file, false);
         $isDir = is_dir($dir);
         if ($file != "." && $file != "..") {
             if (preg_match("/{$filter}/", $file)) {
                 if ($fullpath) {
                     $arr[] = trim(mosPathName($path . '/' . $file, false));
                 } else {
                     $arr[] = trim($file);
                 }
             }
             if ($recurse && $isDir) {
                 $arr2 = mosReadDirectory($dir, $filter, $recurse, $fullpath);
                 $arr = array_merge($arr, $arr2);
             }
         }
     }
     closedir($handle);
     asort($arr);
     return $arr;
 }
开发者ID:janssit,项目名称:www.ondernemenddiest.be,代码行数:28,代码来源:DOCMAN_compat15.class.php


示例3: render

 function render(&$renderer, &$request)
 {
     $rows = array();
     $languageDir = mamboCore::get('mosConfig_absolute_path') . "/language/";
     $xmlFilesInDir = mosReadDirectory($languageDir, '.xml$');
     $rowid = 0;
     foreach ($xmlFilesInDir as $xmlfile) {
         // Read the file to see if it's a valid template XML file
         $parser =& new mosXMLDescription($languageDir . $xmlfile);
         if ($parser->getType() != 'language') {
             continue;
         }
         $row = new StdClass();
         $row->id = $rowid;
         $row->language = substr($xmlfile, 0, -4);
         $row->name = $parser->getName('language');
         $row->creationdate = $parser->getCreationDate('language');
         $row->author = $parser->getAuthor('language');
         $row->copyright = $parser->getCopyright('language');
         $row->authorEmail = $parser->getAuthorEmail('language');
         $row->authorUrl = $parser->getAuthorUrl('language');
         $row->version = $parser->getVersion('language');
         $row->checked_out = 0;
         $row->mosname = strtolower(str_replace(" ", "_", $row->name));
         $row->published = mamboCore::get('mosConfig_locale') == $row->language ? 1 : 0;
         $rows[] = $row;
         $rowid++;
     }
     $renderer->addvar('rows', $rows);
     $renderer->addvar('content', $renderer->fetch('table.tpl.php'));
     $renderer->display('form.tpl.php');
 }
开发者ID:jwest00724,项目名称:mambo,代码行数:32,代码来源:index.view.php


示例4: botLegacyBots

/**
* Process any legacy bots in the /mambots directory
*
* THIS FILE CAN BE **SAFELY REMOVED** IF YOU HAVE NO LEGACY MAMBOTS
* @param object A content object
* @param int A bit-wise mask of options
* @param int The page number
*/
function botLegacyBots($published, &$row, &$params, $page = 0)
{
    global $mosConfig_absolute_path;
    // process any legacy bots
    $bots = mosReadDirectory("{$mosConfig_absolute_path}/mambots", "\\.php\$");
    sort($bots);
    foreach ($bots as $bot) {
        require "mambots/{$bot}";
    }
}
开发者ID:jwest00724,项目名称:mambo,代码行数:18,代码来源:legacybots.php


示例5: createLanguage

 function createLanguage($iso639, $iso3166, $iso3166_3)
 {
     $locales = mamboLanguage::getLocales();
     $default = $locales['locales'][$iso639];
     $lang = $iso639;
     $lang .= strlen($iso3166) == 2 ? '_' . $iso3166 : '';
     $language =& new mamboLanguage($lang);
     foreach ($default as $k => $v) {
         if (in_array($k, array_keys(get_class_vars(get_class($language))))) {
             $language->{$k} = $v;
         }
     }
     foreach ($_POST as $k => $v) {
         if (in_array($k, array_keys(get_class_vars(get_class($language))))) {
             $language->{$k} = $v;
         }
     }
     $language->name = $lang;
     $language->description = $language->title . ' Locale';
     if (!empty($language->territory)) {
         $language->description .= ' For ' . $language->territory;
     }
     $language->locale = $lang . '.' . $language->charset . ',' . $lang . ',' . $iso639 . ',' . strtolower($language->title);
     $language->iso3166_3 = $iso3166_3;
     $language->creationdate = date('d-m-Y');
     $language->author = 'Mambo Foundation Inc.';
     $language->authorurl = 'http://www.mambo-foundation.org';
     $language->authoremail = '[email protected]';
     $language->copyright = 'Refer to copyright.php';
     $language->license = 'http://www.gnu.org/copyleft/gpl.html GNU/GPL';
     $language->setPlurals($_POST['plural_form']);
     $textdomain = rtrim($language->path, '\\/');
     $dir = $textdomain . '/' . $language->name;
     $untranslated = $textdomain . '/untranslated';
     $charset = $language->charset;
     $langfiles = mosReadDirectory($untranslated, '.pot$');
     @mkdir($dir);
     @mkdir($dir . '/LC_MESSAGES');
     //$gettext_admin = new PHPGettextAdmin();
     foreach ($langfiles as $domain) {
         $domain = substr($domain, 0, -4);
         /*if (file_exists("$textdomain/glossary/$lang.$charset.po")) {
               copy("$textdomain/glossary/$lang.$charset.po", "$dir/$lang.po");
               $gettext_admin->initialize_translation($domain, $textdomain, $lang, $charset);
               $gettext_admin->compile($lang, $textdomain, $charset);
           } else {*/
         copy("{$untranslated}/{$domain}.pot", "{$dir}/{$domain}.po");
         //}
     }
     //if (!file_exists("$textdomain/$lang/$lang.po")) {
     //    @copy("$textdomain/glossary/untranslated.pot", "$textdomain/$lang/$lang.po");
     //}
     $language->save();
 }
开发者ID:jwest00724,项目名称:mambo,代码行数:54,代码来源:save.action.php


示例6: botLegacyBots

/**
* Process any legacy bots in the /mambots directory
*
* THIS FILE CAN BE **SAFELY REMOVED** IF YOU HAVE NO LEGACY MAMBOTS
* @param object A content object
* @param int A bit-wise mask of options
* @param int The page number
*/
function botLegacyBots($published, &$row, &$params, $page = 0)
{
    global $mosConfig_absolute_path;
    // check whether mambot has been unpublished
    if (!$published) {
        return true;
    }
    // process any legacy bots
    $bots = mosReadDirectory("{$mosConfig_absolute_path}/mambots", "\\.php\$");
    sort($bots);
    foreach ($bots as $bot) {
        require $mosConfig_absolute_path . "/mambots/{$bot}";
    }
}
开发者ID:patricmutwiri,项目名称:joomlaclube,代码行数:22,代码来源:legacybots.php


示例7: showInstalledComponents

/**
* @param string The URL option
*/
function showInstalledComponents($option)
{
    global $database, $mosConfig_absolute_path;
    $database->setQuery("SELECT *" . "\n FROM #__components" . "\n WHERE parent = 0 AND iscore = 0" . "\n ORDER BY name");
    $rows = $database->loadObjectList();
    // Read the component dir to find components
    $componentBaseDir = mosPathName($mosConfig_absolute_path . '/administrator/components');
    $componentDirs = mosReadDirectory($componentBaseDir);
    $id = 0;
    foreach ($rows as $row) {
        $dirName = $componentBaseDir . $row->option;
        $xmlFilesInDir = mosReadDirectory($dirName, '.xml');
        foreach ($xmlFilesInDir as $xmlfile) {
            // Read the file to see if it's a valid component XML file
            $xmlDoc =& new DOMIT_Lite_Document();
            $xmlDoc->resolveErrors(true);
            if (!$xmlDoc->loadXML($dirName . '/' . $xmlfile, false, true)) {
                continue;
            }
            $element =& $xmlDoc->documentElement;
            if ($element->getTagName() != 'mosinstall') {
                continue;
            }
            if ($element->getAttribute("type") != "component") {
                continue;
            }
            $element =& $xmlDoc->getElementsByPath('creationDate', 1);
            $row->creationdate = $element ? $element->getText() : 'Unknown';
            $element =& $xmlDoc->getElementsByPath('author', 1);
            $row->author = $element ? $element->getText() : 'Unknown';
            $element =& $xmlDoc->getElementsByPath('copyright', 1);
            $row->copyright = $element ? $element->getText() : '';
            $element =& $xmlDoc->getElementsByPath('authorEmail', 1);
            $row->authorEmail = $element ? $element->getText() : '';
            $element =& $xmlDoc->getElementsByPath('authorUrl', 1);
            $row->authorUrl = $element ? $element->getText() : '';
            $element =& $xmlDoc->getElementsByPath('version', 1);
            $row->version = $element ? $element->getText() : '';
            $row->mosname = strtolower(str_replace(" ", "_", $row->name));
            $rows[$id] = $row;
        }
        $id++;
    }
    HTML_component::showInstalledComponents($rows, $option);
}
开发者ID:cwcw,项目名称:cms,代码行数:48,代码来源:component.php


示例8: viewTemplates

/**
* Compiles a list of installed, version 4.5+ templates
*
* Based on xml files found.  If no xml file found the template
* is ignored
*/
function viewTemplates($option, $client)
{
    global $database, $mainframe;
    global $mosConfig_absolute_path, $mosConfig_list_limit;
    $limit = $mainframe->getUserStateFromRequest('viewlistlimit', 'limit', $mosConfig_list_limit);
    $limitstart = $mainframe->getUserStateFromRequest("view{$option}limitstart", 'limitstart', 0);
    if ($client == 'admin') {
        $templateBaseDir = mosPathName($mosConfig_absolute_path . '/administrator/templates');
    } else {
        $templateBaseDir = mosPathName($mosConfig_absolute_path . '/templates');
    }
    $rows = array();
    // Read the template dir to find templates
    $templateDirs = mosReadDirectory($templateBaseDir);
    $id = intval($client == 'admin');
    if ($client == 'admin') {
        $query = "SELECT template" . "\n FROM #__templates_menu" . "\n WHERE client_id = 1" . "\n AND menuid = 0";
        $database->setQuery($query);
    } else {
        $query = "SELECT template" . "\n FROM #__templates_menu" . "\n WHERE client_id = 0" . "\n AND menuid = 0";
        $database->setQuery($query);
    }
    $cur_template = $database->loadResult();
    $rowid = 0;
    // Check that the directory contains an xml file
    foreach ($templateDirs as $templateDir) {
        $dirName = mosPathName($templateBaseDir . $templateDir);
        $xmlFilesInDir = mosReadDirectory($dirName, '.xml$');
        foreach ($xmlFilesInDir as $xmlfile) {
            // Read the file to see if it's a valid template XML file
            $xmlDoc = new DOMIT_Lite_Document();
            $xmlDoc->resolveErrors(true);
            if (!$xmlDoc->loadXML($dirName . $xmlfile, false, true)) {
                continue;
            }
            $root =& $xmlDoc->documentElement;
            if ($root->getTagName() != 'mosinstall') {
                continue;
            }
            if ($root->getAttribute('type') != 'template') {
                continue;
            }
            $row = new StdClass();
            $row->id = $rowid;
            $row->directory = $templateDir;
            $element =& $root->getElementsByPath('name', 1);
            $row->name = $element->getText();
            $element =& $root->getElementsByPath('creationDate', 1);
            $row->creationdate = $element ? $element->getText() : 'Nenhum';
            $element =& $root->getElementsByPath('author', 1);
            $row->author = $element ? $element->getText() : 'Unknown';
            $element =& $root->getElementsByPath('copyright', 1);
            $row->copyright = $element ? $element->getText() : '';
            $element =& $root->getElementsByPath('authorEmail', 1);
            $row->authorEmail = $element ? $element->getText() : '';
            $element =& $root->getElementsByPath('authorUrl', 1);
            $row->authorUrl = $element ? $element->getText() : '';
            $element =& $root->getElementsByPath('version', 1);
            $row->version = $element ? $element->getText() : '';
            // Get info from db
            if ($cur_template == $templateDir) {
                $row->published = 1;
            } else {
                $row->published = 0;
            }
            $row->checked_out = 0;
            $row->mosname = strtolower(str_replace(' ', '_', $row->name));
            // check if template is assigned
            $query = "SELECT COUNT(*)" . "\n FROM #__templates_menu" . "\n WHERE client_id = 0" . "\n AND template = " . $database->Quote($row->directory) . "\n AND menuid != 0";
            $database->setQuery($query);
            $row->assigned = $database->loadResult() ? 1 : 0;
            $rows[] = $row;
            $rowid++;
        }
    }
    require_once $GLOBALS['mosConfig_absolute_path'] . '/administrator/includes/pageNavigation.php';
    $pageNav = new mosPageNav(count($rows), $limitstart, $limit);
    $rows = array_slice($rows, $pageNav->limitstart, $pageNav->limit);
    HTML_templates::showTemplates($rows, $pageNav, $option, $client);
}
开发者ID:patricmutwiri,项目名称:joomlaclube,代码行数:86,代码来源:admin.templates.php


示例9: attachement

    function attachement($mailingEdit, $lists, $show)
    {
        foreach ($mailingEdit->attachments as $attach => $k) {
            $mailingEdit->attachments[$attach] = basename($k);
        }
        $files = mosReadDirectory($GLOBALS['mosConfig_absolute_path'] . $GLOBALS[ACA . 'upload_url'], '\\.', true, true);
        echo '<select name="attachments[]" multiple="multiple" style="width: 100%;" size="10">';
        if (sizeof($files) > 0) {
            foreach ($files as $file) {
                $file = basename($file);
                if (in_array($file, $mailingEdit->attachments)) {
                    echo '<option selected="selected">' . $file . '</option>' . "\n";
                } else {
                    echo '<option>' . $file . '</option>' . "\n";
                }
            }
        }
        echo '</select>';
        ?>
<script src="<?php 
        echo $GLOBALS['mosConfig_live_site'];
        ?>
/administrator/components/com_acajoom/classes/multifile.js"></script>

<input id="my_file_element" type="file" name="file_1" >
</input>

<br /><b><?php 
        echo _ACA_FILES;
        ?>
:</b>

<div id="files_list"></div>
<script>

	var multi_selector = new MultiSelector( document.getElementById( 'files_list' ), 10 );
	multi_selector.addElement( document.getElementById( 'my_file_element' ) );
</script>

<?php 
    }
开发者ID:reeleis,项目名称:ohiocitycycles,代码行数:41,代码来源:mailings.acajoom.html.php


示例10: editMambot

/**
* Compiles information to add or edit a module
* @param string The current GET/POST option
* @param integer The unique id of the record to edit
*/
function editMambot($option, $uid, $client)
{
    global $database, $my, $mainframe;
    global $mosConfig_absolute_path;
    $lists = array();
    $row = new mosMambot($database);
    // load the row from the db table
    $row->load($uid);
    // fail if checked out not by 'me'
    if ($row->checked_out && $row->checked_out != $my->id) {
        echo "<script>alert(" . sprintf(T_('The module %s is currently being edited by another administrator'), $row->title) . "); document.location.href='index2.php?option={$option}'</script>\n";
        exit(0);
    }
    if ($client == 'admin') {
        $where = "client_id='1'";
    } else {
        $where = "client_id='0'";
    }
    // get list of groups
    if ($row->access == 99 || $row->client_id == 1) {
        $lists['access'] = T_('Administrator') . '<input type="hidden" name="access" value="99" />';
    } else {
        // build the html select list for the group access
        $lists['access'] = mosAdminMenus::Access($row);
    }
    if ($uid) {
        $row->checkout($my->id);
        if ($row->ordering > -10000 && $row->ordering < 10000) {
            // build the html select list for ordering
            $query = "SELECT ordering AS value, name AS text" . "\n FROM #__mambots" . "\n WHERE folder='{$row->folder}'" . "\n AND published > 0" . "\n AND {$where}" . "\n AND ordering > -10000" . "\n AND ordering < 10000" . "\n ORDER BY ordering";
            $order = mosGetOrderingList($query);
            $lists['ordering'] = mosHTML::selectList($order, 'ordering', 'class="inputbox" size="1"', 'value', 'text', intval($row->ordering));
        } else {
            $lists['ordering'] = '<input type="hidden" name="ordering" value="' . $row->ordering . '" />' . T_('This mambot cannot be reordered');
        }
        $lists['folder'] = '<input type="hidden" name="folder" value="' . $row->folder . '" />' . $row->folder;
        // xml file for module
        $xmlfile = $mosConfig_absolute_path . '/mambots/' . $row->folder . '/' . $row->element . '.xml';
        $xmlparser =& new mosXMLDescription($xmlfile);
        $row->description = T_($xmlparser->getDescription('mambot'));
    } else {
        $row->folder = '';
        $row->ordering = 999;
        $row->published = 1;
        $row->description = '';
        $folders = mosReadDirectory($mosConfig_absolute_path . '/mambots/');
        $folders2 = array();
        foreach ($folders as $folder) {
            if (is_dir($mosConfig_absolute_path . '/mambots/' . $folder) && $folder != 'CVS') {
                $folders2[] = mosHTML::makeOption($folder);
            }
        }
        $lists['folder'] = mosHTML::selectList($folders2, 'folder', 'class="inputbox" size="1"', 'value', 'text', null);
        $lists['ordering'] = '<input type="hidden" name="ordering" value="' . $row->ordering . '" />' . T_('New items default to the last place. Ordering can be changed after this item is saved.') . '';
    }
    $lists['published'] = mosHTML::yesnoRadioList('published', 'class="inputbox"', $row->published);
    // get params definitions
    $params =& new mosAdminParameters($row->params, $mainframe->getPath('bot_xml', $row->folder . '/' . $row->element), 'mambot');
    HTML_modules::editMambot($row, $lists, $params, $option);
}
开发者ID:jwest00724,项目名称:mambo,代码行数:65,代码来源:admin.mambots.php


示例11: viewTemplates

/**
* Compiles a list of installed, version 4.5+ templates
*
* Based on xml files found.  If no xml file found the template
* is ignored
*/
function viewTemplates($option, $client)
{
    global $database, $mainframe;
    global $mosConfig_absolute_path, $mosConfig_list_limit;
    $limit = $mainframe->getUserStateFromRequest('viewlistlimit', 'limit', $mosConfig_list_limit);
    $limitstart = $mainframe->getUserStateFromRequest("view{$option}limitstart", 'limitstart', 0);
    if ($client == 'admin') {
        $templateBaseDir = mosPathName($mosConfig_absolute_path . '/administrator/templates');
    } else {
        $templateBaseDir = mosPathName($mosConfig_absolute_path . '/templates');
    }
    $rows = array();
    // Read the template dir to find templates
    $templateDirs = mosReadDirectory($templateBaseDir);
    $id = intval($client == 'admin');
    if ($client == 'admin') {
        $database->setQuery("SELECT template FROM #__templates_menu WHERE client_id='1' AND menuid='0'");
    } else {
        $database->setQuery("SELECT template FROM #__templates_menu WHERE client_id='0' AND menuid='0'");
    }
    $cur_template = $database->loadResult();
    $rowid = 0;
    // Check that the directory contains an xml file
    foreach ($templateDirs as $templateDir) {
        $dirName = mosPathName($templateBaseDir . $templateDir);
        $xmlFilesInDir = mosReadDirectory($dirName, '.xml$');
        foreach ($xmlFilesInDir as $xmlfile) {
            // Read the file to see if it's a valid template XML file
            $parser =& new mosXMLDescription($dirName . $xmlfile);
            if ($parser->getType() != 'template') {
                continue;
            }
            $row = new StdClass();
            $row->id = $rowid;
            $row->directory = $templateDir;
            $row->creationdate = $parser->getCreationDate('template');
            $row->name = $parser->getName('template');
            $row->author = $parser->getAuthor('template');
            $row->copyright = $parser->getCopyright('template');
            $row->authorEmail = $parser->getAuthorEmail('template');
            $row->authorUrl = $parser->getAuthorUrl('template');
            $row->version = $parser->getVersion('template');
            /*
            			$element = &$xmlDoc->getElementsByPath('name', 1 );
            			$row->name = $element->getText();
            
            			$element = &$xmlDoc->getElementsByPath('creationDate', 1);
            			$row->creationdate = $element ? $element->getText() : 'Unknown';
            
            			$element = &$xmlDoc->getElementsByPath('author', 1);
            			$row->author = $element ? $element->getText() : 'Unknown';
            
            			$element = &$xmlDoc->getElementsByPath('copyright', 1);
            			$row->copyright = $element ? $element->getText() : '';
            
            			$element = &$xmlDoc->getElementsByPath('authorEmail', 1);
            			$row->authorEmail = $element ? $element->getText() : '';
            
            			$element = &$xmlDoc->getElementsByPath('authorUrl', 1);
            			$row->authorUrl = $element ? $element->getText() : '';
            
            			$element = &$xmlDoc->getElementsByPath('version', 1);
            			$row->version = $element ? $element->getText() : '';
            */
            // Get info from db
            if ($cur_template == $templateDir) {
                $row->published = 1;
            } else {
                $row->published = 0;
            }
            $row->checked_out = 0;
            $row->mosname = strtolower(str_replace(' ', '_', $row->name));
            // check if template is assigned
            $database->setQuery("SELECT count(*) FROM #__templates_menu WHERE client_id='0' AND template='{$row->directory}' AND menuid<>'0'");
            $row->assigned = $database->loadResult() ? 1 : 0;
            $rows[] = $row;
            $rowid++;
        }
    }
    require_once $GLOBALS['mosConfig_absolute_path'] . '/administrator/includes/pageNavigation.php';
    $pageNav = new mosPageNav(count($rows), $limitstart, $limit);
    $rows = array_slice($rows, $pageNav->limitstart, $pageNav->limit);
    HTML_templates::showTemplates($rows, $pageNav, $option, $client);
}
开发者ID:jwest00724,项目名称:mambo,代码行数:90,代码来源:admin.templates.php


示例12: attachement

    function attachement($mailingEdit, $lists, $show)
    {
        foreach ($mailingEdit->attachments as $attach => $k) {
            $mailingEdit->attachments[$attach] = basename($k);
        }
        if (ACA_CMSTYPE) {
            // joomla 15
            $path = ACA_JPATH_ROOT_NO_ADMIN . $GLOBALS[ACA . 'upload_url'];
            $arr = array(null);
            // Get the files and folders
            jimport('joomla.filesystem.folder');
            $files2 = JFolder::files($path, '.', true, true);
            $folders = JFolder::folders($path, '.', true, true);
            // Merge files and folders into one array
            $files = array_merge($files2, $folders);
            // Sort them all
            asort($files);
        } else {
            //joomla 1x
            $files = mosReadDirectory(ACA_JPATH_ROOT_NO_ADMIN . $GLOBALS[ACA . 'upload_url'], '\\.', true, true);
        }
        //endif
        echo '<select name="attachments[]" multiple="multiple" style="width: 100%;" size="10">';
        if (sizeof($files) > 0) {
            foreach ($files as $file) {
                $file = basename($file);
                if (in_array($file, $mailingEdit->attachments)) {
                    echo '<option selected="selected">' . $file . '</option>' . "\n";
                } else {
                    echo '<option>' . $file . '</option>' . "\n";
                }
            }
        }
        echo '</select>';
        ?>
<script src="<?php 
        echo ACA_JPATH_LIVE;
        ?>
/administrator/components/com_acajoom/classes/multifile.js"></script>

<input id="my_file_element" type="file" name="file_1" >
</input>

<br /><b><?php 
        echo _ACA_FILES;
        ?>
:</b>

<div id="files_list"></div>
<script>

	var multi_selector = new MultiSelector( document.getElementById( 'files_list' ), 10 );
	multi_selector.addElement( document.getElementById( 'my_file_element' ) );
</script>

<?php 
    }
开发者ID:kaantunc,项目名称:MYK-BOR,代码行数:57,代码来源:mailings.acajoom.html.php


示例13: mosReadDirectory

 function mosReadDirectory($path, $filter = '.', $recurse = false, $fullpath = false)
 {
     return mosReadDirectory($path, $filter, $recurse, $fullpath);
 }
开发者ID:RangerWalt,项目名称:ecci,代码行数:4,代码来源:DOCMAN_compat10.class.php


示例14: component_uninstall

/**
 * Component uninstall method
 * @param int The id of the module
 * @param string The URL option
 * @param int The client id
 */
function component_uninstall($cid, $option, $client = 0)
{
    $database =& mamboDatabase::getInstance();
    $sql = "SELECT * FROM #__components WHERE id={$cid}";
    $database->setQuery($sql);
    if (!$database->loadObject($row)) {
        $message = new mosError($database->stderr(true), _MOS_ERROR_FATAL);
        HTML_installer::showInstallMessage($message, T_('Uninstall -  error'), "index2.php?option={$option}&element=component");
        exit;
    }
    if ($row->iscore) {
        $message = new mosError(sprintf(T_('Component %s is a core component, and can not be uninstalled.<br />You need to unpublish it if you don\'t want to use it'), $row->name), _MOS_ERROR_FATAL);
        HTML_installer::showInstallMessage($message, 'Uninstall -  error', "index2.php?option={$option}&element=component");
        exit;
    }
    // Try to find the XML file
    $here = mosPathName(mamboCore::get('mosConfig_absolute_path') . '/administrator/components/' . $row->option);
    $filesindir = mosReadDirectory($here, '.xml$');
    if (count($filesindir) > 0) {
        $allerrors = new mosErrorSet();
        foreach ($filesindir as $file) {
            $parser =& new mosUninstallXML($here . $file);
            $parser->uninstall();
            $allerrors->mergeAnother($parser->errors);
        }
        $ret = $allerrors->getMaxLevel() < _MOS_ERROR_FATAL;
        HTML_installer::showInstallMessage($allerrors->getErrors(), T_('Uninstall component - ') . ($ret ? T_('Success') : T_('Error')), returnTo($option, 'component', $client));
    } else {
        $com_name = $row->option;
        $dir = new mosDirectory(mosPathName(mamboCore::get('mosConfig_absolute_path') . '/components/' . $com_name));
        $dir->deleteAll();
        $dir = new mosDirectory(mosPathName(mamboCore::get('mosConfig_absolute_path') . '/administrator/components/' . $com_name));
        $dir->deleteAll();
        $sql = "DELETE FROM #__components WHERE `option`='{$com_name}'";
        $database->setQuery($sql);
        $database->query();
        $message = new mosError(T_('Uninstaller could not find XML file, but cleaned database'), _MOS_ERROR_WARN);
        HTML_installer::showInstallMessage($message, T_('Uninstall ') . T_('component - ') . T_('Success'), returnTo($option, 'component', $client));
    }
    exit;
}
开发者ID:jwest00724,项目名称:mambo,代码行数:47,代码来源:admin.installer.php


示例15: _form_filelist

 /**
  * @param string The name of the form element
  * @param string The value of the element
  * @param object The xml element for the parameter
  * @param string The control name
  * @return string The html for the element
  */
 function _form_filelist($name, $value, &$node, $control_name)
 {
     global $mosConfig_absolute_path;
     // path to images directory
     $path = $mosConfig_absolute_path . $node->getAttribute('directory');
     $filter = $node->getAttribute('filter');
     $files = mosReadDirectory($path, $filter);
     $options = array();
     foreach ($files as $file) {
         $options[] = mosHTML::makeOption($file, $file);
     }
     if (!$node->getAttribute('hide_none')) {
         array_unshift($options, mosHTML::makeOption('-1', '- ' . 'Do Not Use' . ' -'));
     }
     if (!$node->getAttribute('hide_default')) {
         array_unshift($options, mosHTML::makeOption('', '- ' . 'Use Default' . ' -'));
     }
     return mosHTML::selectList($options, '' . $control_name . '[' . $name . ']', 'class="inputbox"', 'value', 'text', $value, "param{$name}");
 }
开发者ID:jwest00724,项目名称:Joomla-1.0,代码行数:26,代码来源:joomla.xml.php


示例16: imageList

 static function imageList($name, &$active, $javascript = null, $directory = null)
 {
     global $mosConfig_absolute_path;
     if (!$javascript) {
         $javascript = "onchange=\"javascript:if (document.adminForm." . $name . ".options[selectedIndex].value!='')    " . "{document.imagelib.src='../images/stories/' + document.adminForm." . $name . ".options[selectedIndex].value} else {document.imagelib.src='../images/blank.png'}\"";
     }
     if (!$directory) {
         $directory = '/images/stories';
     }
     // inserted by Wonderer
     if (!file_exists($mosConfig_absolute_path . $directory)) {
         @mkdir($mosConfig_absolute_path . $directory, 0777) or die("Error of directory creating: [" . $mosConfig_absolute_path . $directory . "] ");
     } else {
     }
     // --
     $imageFiles = mosReadDirectory($mosConfig_absolute_path . $directory);
     $images = array(mosHTML::makeOption('', _BOOKLIBRARY_A_SELECT_IMAGE));
     foreach ($imageFiles as $file) {
         if (preg_match("/bmp|gif|jpg|jpeg|png/i", $file)) {
             $images[] = mosHTML::makeOption($file);
         }
     }
     $images = mosHTML::selectList($images, $name, 'id="' . $name . '" class="inputbox" size="1" ' . $javascript, 'value', 'text', $active);
     return $images;
 }
开发者ID:rdegennaro,项目名称:Check-It,代码行数:25,代码来源:booklibrary.php


示例17: JQ_editQuestion


//.........这里部分代码省略.........
                     $row->choice_true = 0;
                 }
             }
             JLMS_quiz_admin_html_class::JQ_editQuest_TrueFalse($row, $lists, $option, $page, $course_id, 3, $qtype_str, $params, $id, $gqp, $levels);
             break;
         case 4:
             $query = "SELECT * FROM #__lms_quiz_t_matching WHERE c_question_id = '" . $row->c_id . "' ORDER BY ordering";
             $JLMS_DB->SetQuery($query);
             $row->matching = array();
             $row->matching = $JLMS_DB->LoadObjectList();
             JLMS_quiz_admin_html_class::JQ_editQuest_MDragDrop($row, $lists, $option, $page, $course_id, 4, $qtype_str, $params, $id, $gqp, $levels);
             break;
         case 5:
             $query = "SELECT * FROM #__lms_quiz_t_matching WHERE c_question_id = '" . $row->c_id . "' ORDER BY ordering";
             $JLMS_DB->SetQuery($query);
             $row->matching = array();
             $row->matching = $JLMS_DB->LoadObjectList();
             JLMS_quiz_admin_html_class::JQ_editQuest_MDragDrop($row, $lists, $option, $page, $course_id, 5, $qtype_str, $params, $id, $gqp, $levels);
             break;
         case 6:
             $query = "SELECT b.*,a.c_default FROM #__lms_quiz_t_blank as a, #__lms_quiz_t_text as b WHERE a.c_question_id = '" . $row->c_id . "' and b.c_blank_id = a.c_id ORDER BY b.ordering";
             $JLMS_DB->SetQuery($query);
             $row->blank_data = array();
             $row->blank_data = $JLMS_DB->LoadObjectList();
             $query = "SELECT c_default FROM #__lms_quiz_t_blank  WHERE c_question_id = '" . $row->c_id . "'";
             $JLMS_DB->SetQuery($query);
             $lists['c_def'] = $JLMS_DB->LoadResult();
             JLMS_quiz_admin_html_class::JQ_editQuest_Blank($row, $lists, $option, $page, $course_id, 6, $qtype_str, $params, $id, $gqp, $levels);
             break;
         case 7:
             $directory_js = $JLMS_CONFIG->get('live_site') . '/images/joomlaquiz/images/';
             $directory = 'images/joomlaquiz/images/';
             $javascript = "onchange=\"javascript:if (document.adminForm.c_image.options[selectedIndex].value!='') {" . " document.imagelib.src='{$directory}' + document.adminForm.c_image.options[selectedIndex].value; } else {" . " document.imagelib.src='" . $JLMS_CONFIG->get('live_site') . "/images/blank.png'}\"";
             $imageFiles = mosReadDirectory($JLMS_CONFIG->get('absolute_path') . '/' . $directory);
             $images = array(mosHTML::makeOption('', '- Select Image -'));
             foreach ($imageFiles as $file) {
                 if (preg_match("/bmp|gif|jpg|png/i", $file)) {
                     $images[] = mosHTML::makeOption($file);
                 }
             }
             $lists['images'] = mosHTML::selectList($images, 'c_image', 'class="inputbox" size="1" ' . $javascript, 'value', 'text', $row->c_image);
             //$lists['images'] = mosAdminMenus::images('c_image', $row->c_image, $javascript, $directory);
             $query = "SELECT * FROM #__lms_quiz_t_hotspot WHERE c_question_id = '" . $row->c_id . "'";
             $JLMS_DB->SetQuery($query);
             $row->hotspot_data = array();
             $row->hotspot_data = $JLMS_DB->LoadObjectList();
             JLMS_quiz_admin_html_class::JQ_editQuest_HotSpot($row, $lists, $option, $page, $course_id, 7, $qtype_str, $params, $id, $gqp, $levels);
             break;
         case 8:
             JLMS_quiz_admin_html_class::JQ_editQuest_Survey($row, $lists, $option, $page, $course_id, 8, $qtype_str, $params, $id, $gqp, $levels);
             break;
         case 9:
             $query = "SELECT * FROM #__lms_quiz_t_scale WHERE c_question_id = '" . $row->c_id . "' ORDER BY ordering";
             $JLMS_DB->SetQuery($query);
             $row->scale = array();
             $row->scale = $JLMS_DB->LoadObjectList();
             JLMS_quiz_admin_html_class::JQ_editQuest_Scale($row, $lists, $option, $page, $course_id, 9, $qtype_str, $params, $id, $gqp, $levels);
             break;
         case 10:
             JLMS_quiz_admin_html_class::JQ_editQuest_Boilerplate($row, $lists, $option, $page, $course_id, 10, $qtype_str, $params, $id, $gqp, $levels);
             break;
         case 11:
             $query = "SELECT a.*, b.imgs_name as left_name, c.imgs_name as right_name FROM #__lms_quiz_t_matching as a, #__lms_quiz_images as b, #__lms_quiz_images as c WHERE a.c_question_id = '" . $row->c_id . "' AND b.imgs_id = a.c_left_text AND c.imgs_id = a.c_right_text ORDER BY a.ordering";
             $JLMS_DB->SetQuery($query);
             $row->matching = array();
             $row->matching = $JLMS_DB->LoadObjectList();
开发者ID:parkmi,项目名称:dolschool14,代码行数:67,代码来源:admin.joomlaquiz.class.php


示例18: updateFiles

 function updateFiles()
 {
     $dir = $this->path . $this->name . '/';
     $langfiles = mosReadDirectory($dir, '.po$');
     set_time_limit(60);
     foreach ($langfiles as $lf) {
         $domain = substr($lf, 0, -3);
         $catalog = new PHPGettext_Catalog($domain, $this->path);
         $catalog->setproperty('lang', $this->name);
         $catalog->setproperty('mode', _MODE_PO_);
         $catalog->load();
         $file['filename'] = "language/" . $this->name . '/' . $lf;
         $file['domain'] = $domain;
         $file['strings'] = count($catalog->strings);
         $file['percent'] = '';
         $file['translated'] = 0;
         $file['fuzzy'] = 0;
         $file['filetype'] = 'po';
         $pluralfuzz = false;
         foreach ($catalog->strings as $msg) {
             if (is_array($msg->msgstr)) {
                 foreach ($msg->msgstr as $i) {
                     $unt = empty($i);
                 }
                 if (!$unt) {
                     $file['translated']++;
                 }
             }
             if (!is_array($msg->msgstr) && !empty($msg->msgstr) && !$msg->is_fuzzy) {
                 $file['translated']++;
             }
             if ($msg->is_fuzzy) {
                 $file['fuzzy']++;
             }
         }
         $nonfuzzy = $file['strings'] - $file['fuzzy'];
         if (!$nonfuzzy) {
             $nonfuzzy = 1;
         }
         $file['percent'] = round($file['translated'] * 100 / $nonfuzzy, 2);
         unset($nonfuzzy);
         $this->files[] = $file;
     }
     $this->files[] = array('filename' => "language/" . $this->name . '.xml', 'domain' => "", 'strings' => "", 'percent' => "", 'translated' => 0, 'fuzzy' => 0, 'filetype' => 'xml');
     $langfiles = mosReadDirectory($dir . 'LC_MESSAGES/', '.mo$');
     set_time_limit(60);
     foreach ($langfiles as $lf) {
         $this->files[] = array('filename' => "language/" . $this->name . '/LC_MESSAGES/' . $lf, 'domai 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP mosRedirect函数代码示例发布时间:2022-05-15
下一篇:
PHP mosPathName函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap