/** * Execute the console command. * @return void */ public function fire() { $this->comment('Publishing Assets for Admin...' . PHP_EOL); // Assets Sub Folder $assets_folder = app("laravel-admin")->getConfig("assets_folder"); if ($assets_folder) { $assets_folder .= "/"; } // Check Assets Dir Exists if (!$this->app["files"]->exists(assetsPath($assets_folder))) { // Create Assets DIr $this->app["files"]->makeDirectory(assetsPath($assets_folder), 0755, true); } // Check Images Dir Exists if (!$this->app["files"]->exists(imagePath($assets_folder))) { // Create Images DIr $this->app["files"]->makeDirectory(imagePath($assets_folder)); } // Check CSS Dir Exists if (!$this->app["files"]->exists(cssPath($assets_folder))) { // Create CSS DIr $this->app["files"]->makeDirectory(cssPath($assets_folder)); } // Check JS Dir Exists if (!$this->app["files"]->exists(jsPath($assets_folder))) { // Create Images DIr $this->app["files"]->makeDirectory(jsPath($assets_folder)); } // Copy All the assets $this->app["files"]->copyDirectory(dirname(dirname(__FILE__)) . '/base_assets/assets', assetsPath()); $this->info('Styles, Scripts and Images for Admin has been successfully published'); }
function kcfinderurl() { $this->load->helper('mc_helper'); $img = $this->input->get('img'); $withBase = $this->input->get('baseurl'); $newurl = imagePath($img); if ($withBase == TRUE) { echo json_encode(array('original' => urlApp() . $img, 'newurl' => base_url() . $newurl)); } else { echo json_encode(array('original' => $img, 'newurl' => $newurl)); } }
function mc_imagepost($postid) { $CI =& get_instance(); $CI->load->helper('posts_helper'); $feature = postTaxonomy($postid, "feature_image"); $sanite = imagePath($feature); $path = "./" . $sanite; if (file_exists($path)) { return base_url() . $sanite; } else { $konten = postInfo($postid, 'post_content'); $img = searchImageString($konten); return $img; } }
function list_all_playcount_data() { $playcounts = array(); if ($result = generic_sql_query("SELECT pl.Playcount, a.Artistname, tr.Title, tr.TrackNo, tr.Duration, tr.Disc, al.Albumname,\n\t\tal.Image, al.AlbumArtistindex, tr.Uri FROM Playcounttable AS pl JOIN Tracktable AS tr USING\n\t\t(TTindex) JOIN Albumtable AS al USING (Albumindex) JOIN Artisttable AS a ON\n\t\t(tr.Artistindex = a.Artistindex) WHERE pl.Playcount > 0")) { while ($obj = $result->fetch(PDO::FETCH_OBJ)) { array_push($playcounts, array('Title' => $obj->Title, 'Album' => $obj->Albumname, 'Artist' => $obj->Artistname, 'Image' => imagePath($obj->Image), 'Uri' => $obj->Uri, 'Playcount' => $obj->Playcount, 'Trackno' => $obj->TrackNo, 'Duration' => $obj->Duration, 'Disc' => $obj->Disc, 'AAIndex' => $obj->AlbumArtistindex)); } } foreach ($playcounts as $r => $a) { if ($result = generic_sql_query("SELECT Artistname FROM Artisttable WHERE Artistindex = " . $playcounts[$r]['AAIndex'])) { while ($obj = $result->fetch(PDO::FETCH_OBJ)) { $playcounts[$r]['Albumartist'] = $obj->Artistname; } } } return $playcounts; }
<?php /** * Пример файла. Необходимо переименовать, убрав суффикс «-sample» */ $rubrics = [["id" => 43600, "image" => imagePath("map.png", $config), "name" => "Юрга и район"], ["id" => 43601, "image" => imagePath("fav.png", $config), "name" => "Акции компаний"]]; /** * Format path for image * * @param string $img image name * @param array $config array with config.ini params * @return string absolute */ function imagePath($img, $config) { return "http://" . $_SERVER["HTTP_HOST"] . $config['global']['path'] . "assets/rubrics/" . $img; }
function parseKCFinderUrl($img) { $CI =& get_instance(); $CI->load->helper('mc_helper'); $newurl = imagePath($img); return base_url() . $newurl; }
/** * Get Admin Asset Path */ function adminAssetPath($file = null, $type = "path", $url = true) { // Get Assets Folder $assets_folder = app("laravel-admin")->getConfig("assets_folder"); if ($assets_folder) { $assets_folder .= "/"; } // Path $path = null; // Find Paths switch (strtolower($type)) { case 'css': $path = $url ? cssUrl($assets_folder . $file) : cssPath($assets_folder . $file); break; case 'js': $path = $url ? jsUrl($assets_folder . $file) : jsPath($assets_folder . $file); break; case 'image': $path = $url ? imageUrl($assets_folder . $file) : imagePath($assets_folder . $file); break; case 'path': $path = $url ? assetsPath($assets_folder) : assetsPath($assets_folder); break; } // Return return $path; }