本文整理汇总了PHP中file::listing_dir方法的典型用法代码示例。如果您正苦于以下问题:PHP file::listing_dir方法的具体用法?PHP file::listing_dir怎么用?PHP file::listing_dir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类file
的用法示例。
在下文中一共展示了file::listing_dir方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listing_material
/**
* Page qui affiche les choix pour le material
*
* @return void
*/
public function listing_material()
{
$this->auto_render = FALSE;
if (!request::is_ajax()) {
return FALSE;
}
$v = new View('editor/material');
$v->material = file::listing_dir(DOCROOT . 'images/background/');
$v->render(TRUE);
}
示例2: compileJs
/**
* Methode : génération du fichier JS
*/
public function compileJs()
{
header('Content-type: text/javascript');
$display = null;
foreach (file::listing_dir(DOCROOT . 'js/class') as $row) {
if (is_file(DOCROOT . 'js/class/' . $row)) {
$display .= implode('', file(DOCROOT . 'js/class/' . $row)) . "\n";
}
}
$display .= implode('', file(DOCROOT . 'js/map.js')) . "\n";
$this->auto_render = FALSE;
echo $display;
}
示例3: vignette
/**
* Methode :
*/
public function vignette($img = false)
{
$this->auto_render = FALSE;
if (!request::is_ajax()) {
return FALSE;
}
$v = new View('formulaire/vignette');
$v->images = file::listing_dir(DOCROOT . '../images/modules');
$v->selected = $img;
$v->module = 'modules';
$v->width = 96;
$v->height = 96;
$v->render(true);
}
示例4: form
/**
* Methode : affiche le formulaire en overlay pour edit
*/
public function form($id_region, $x, $y, $z)
{
$this->auto_render = FALSE;
if (!request::is_ajax()) {
return;
}
$view = new View('mapping/form');
$view->x = $x;
$view->y = $y;
$view->z = $z;
$view->region_id = $id_region;
$view->type = 'add';
if ($view->row = Map_Model::instance()->select(array('region_id' => $id_region, 'x' => $x, 'y' => $y, 'z' => $z, 'module_map IS NOT' => NULL), 1)) {
$view->type = 'edit';
$view->id = $view->row->id;
if ($view->row->action_map) {
$view->row = unserialize($view->row->action_map);
}
}
$view->actions = file::listing_dir(MODPATH . '/plugins/views');
$view->render(true);
}
示例5: index
/**
* Méthode :
*/
public function index(&$view)
{
$view->sounds = file::listing_dir(DOCROOT . '../audios');
}
示例6: listing_avatar
/**
* Page qui affiche les avatars pour modifier
*
* @return void
*/
public function listing_avatar()
{
$this->auto_render = FALSE;
if (!request::is_ajax()) {
return FALSE;
}
$v = new View('users/avatar');
$v->avatar = file::listing_dir(DOCROOT . '../images/character/');
$v->render(TRUE);
}
示例7: index
/**
* Générer un JSON
*
* @return void
*/
public function index($render = TRUE)
{
$json = new View('map/json');
$json->my = $this->user;
if (!($this->region = Region_Model::instance()->select(array('id' => $this->user->region_id), 1))) {
return FALSE;
}
$json->items = Item_Model::instance()->select();
$elements = $modules = $items = FALSE;
if (($rows = Map_Model::instance()->select(array('region_id' => $this->region->id), FALSE)) !== FALSE) {
$prenoms = Name_Model::instance()->select();
$listName = array();
foreach ($prenoms as $prenom) {
$listName[] = ucfirst(mb_strtolower($prenom->prenom));
}
$images = file::listing_dir(DOCROOT . 'images/character');
foreach ($rows as $row) {
if (!$row->module_map && !$row->bot) {
$elements[] = '{"x" : ' . $row->x . ', "z" : ' . $row->z . ', "y" : ' . $row->y . ', "subX" : ' . $row->subX . ', "subZ" : ' . $row->subZ . ', "subY" : ' . $row->subY . ', "materials" : [ "' . $row->background_px . '", "' . $row->background_nx . '", "' . $row->background_py . '", "' . $row->background_ny . '", "' . $row->background_pz . '", "' . $row->background_nz . '" ] }';
} else {
$data = @unserialize($row->action_map);
$action = json_encode($data);
if ($row->module_map == 'article') {
$article = Article_Model::instance()->select(array('id_article' => $data->id_article, 'article_category_id' => 2, 'status' => 1), 1);
$modules[] = '{"x" : ' . $row->x . ', "z" : ' . $row->z . ', "y" : ' . $row->y . ', "subX" : ' . $row->subX . ', "subZ" : ' . $row->subZ . ', "subY" : ' . $row->subY . ', "data" : ' . $action . ', "article" : ' . json_encode($article->article) . ' }';
} elseif ($row->bot) {
$v = new stdClass();
$v->id = 0;
$v->name = $row->bot ? $row->title : $listName[array_rand($listName)];
$v->x = $row->x;
$v->y = $row->y;
$v->z = $row->z;
$v->region_id = $row->region_id;
$v->user_id = $this->user->id;
if ($row->bot == 2) {
$v->image = 'animals/bears.png';
} elseif ($row->bot == 3) {
$v->image = 'animals/dog.png';
} else {
$v->image = 'character/' . $images[array_rand($images)];
}
$v->hp_max = 100;
$v->hp = 100;
$v->leak = 0;
$v->type = $row->bot;
$v->fixe = $row->bot && !$row->module_map ? 0 : 1;
$v->argent = 1000;
$v->xp = 10;
$v->niveau = 0;
$this->botFixe[] = $v;
if ($row->module_map == 'quete') {
$modules[] = '{"x" : ' . $row->x . ', "z" : ' . $row->z . ', "y" : ' . ($row->y - 1) . ', "subX" : ' . $row->subX . ', "subZ" : ' . $row->subZ . ', "subY" : ' . $row->subY . ', "data" : ' . $action . ', "article" : "" }';
}
} else {
$modules[] = '{"x" : ' . $row->x . ', "z" : ' . $row->z . ', "y" : ' . ($row->y - 1) . ', "subX" : ' . $row->subX . ', "subZ" : ' . $row->subZ . ', "subY" : ' . $row->subY . ', "data" : ' . $action . ', "article" : "" }';
}
}
}
}
$articles = Article_Model::instance()->select(array('region_id' => $this->region->id, 'article_category_id' => 2, 'status' => 1));
$articlesList = null;
if ($articles) {
foreach ($articles as $row) {
$articlesList[] = json_encode($row->reponse ? $row->article . '<div class="reponse">' . $row->reponse . '</div>' : $row->article);
}
}
$this->region->map = new stdClass();
$this->region->map->region = $this->region;
$this->region->map->elements = $elements ? implode(',', $elements) : FALSE;
$this->region->map->modules = $modules ? implode(',', $modules) : FALSE;
$this->region->map->articles = $articlesList ? implode(',', $articlesList) : FALSE;
$this->region->map->region->bots = $this->botFixe;
$json->region = $this->region;
$sounds = file::listing_dir(DOCROOT . 'audios', array('home.mp3'));
$json->sounds = $sounds ? json_encode($sounds) : FALSE;
return $json->render($render);
}
示例8: vignette_global
/**
* Methode :
*/
private function vignette_global($img, $dossier, $x, $y)
{
$this->auto_render = FALSE;
if (!request::is_ajax()) {
return FALSE;
}
$v = new View('formulaire/vignette');
$v->images = file::listing_dir(DOCROOT . '../images/' . $dossier);
$v->selected = $img;
$v->class = $dossier;
$v->module = $dossier;
$v->width = $x;
$v->height = $y;
$v->render(true);
}