示例#1
0
/**
 * Includes all p4a objects for the application
 * @param string $dir
 */
function P4A_Include_Objects($dir)
{
    if (is_dir($dir)) {
        $files = array();
        $dirs = array();
        $dh = opendir($dir);
        while (false !== ($filename = readdir($dh))) {
            if (substr($filename, 0, 1) != '.' and $filename != 'CVS') {
                $files[] = $filename;
            }
        }
        closedir($dh);
        for ($i = 0; $i < count($files); $i++) {
            if (is_dir("{$dir}/{$files[$i]}")) {
                $dirs[] = "{$dir}/{$files[$i]}";
            } elseif (is_file("{$dir}/{$files[$i]}") and substr($files[$i], -4) == '.php') {
                require_once "{$dir}/{$files[$i]}";
            }
        }
        foreach ($dirs as $subdir) {
            P4A_Include_Objects($subdir);
        }
    }
}
示例#2
0
文件: p4a.php 项目: eliudiaz/p4a
require_once "{$dir}/objects/widgets/label.php";
require_once "{$dir}/objects/widgets/line.php";
require_once "{$dir}/objects/widgets/link.php";
require_once "{$dir}/objects/widgets/menu.php";
require_once "{$dir}/objects/widgets/message.php";
require_once "{$dir}/objects/widgets/progress_bar.php";
require_once "{$dir}/objects/widgets/sheet.php";
require_once "{$dir}/objects/widgets/tab_pane.php";
require_once "{$dir}/objects/widgets/table.php";
require_once "{$dir}/objects/widgets/tables/grid.php";
require_once "{$dir}/objects/widgets/toolbar.php";
require_once "{$dir}/objects/widgets/frames/fieldset.php";
//Toolbars
require_once "{$dir}/objects/widgets/toolbars/actions.php";
require_once "{$dir}/objects/widgets/toolbars/navigation.php";
require_once "{$dir}/objects/widgets/toolbars/simple.php";
require_once "{$dir}/objects/widgets/toolbars/full.php";
require_once "{$dir}/objects/widgets/toolbars/quit.php";
//External application inclusion
if (defined("P4A_REQUIRE_APPLICATION")) {
    if (strpos(P4A_REQUIRE_APPLICATION, "/") !== false) {
        $objects_dir = P4A_REQUIRE_APPLICATION . '/objects';
    } else {
        $objects_dir = P4A_ROOT_DIR . '/applications/' . P4A_REQUIRE_APPLICATION . '/objects';
    }
    P4A_Include_Objects($objects_dir);
}
//Application inclusion
if (P4A_ENABLE_AUTO_INCLUSION) {
    P4A_Include_Objects(P4A_APPLICATION_DIR . '/objects');
}