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


PHP Theme::all方法代码示例

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


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

示例1: all

 /**
  * Get active themes
  *
  * @return mixed
  */
 public function all()
 {
     $themes = ['backend' => [], 'frontend' => []];
     foreach (\Theme::all() as $theme) {
         $theme_config = $this->getActiveThemes($theme);
         if (file_exists($theme_config)) {
             // Read theme configuration
             $theme_config = json_decode(file_get_contents($theme_config));
             // Order themes
             $themes[$theme_config->type][$theme->name] = ['name' => $theme->name, 'preview' => !empty($theme_config->preview) ? $theme_config->preview : '', 'preview_path' => 'themes/' . $theme->name . '/img/', 'path' => $theme->getPath(), 'active' => $this->r_settings->get('themes.themes.' . $theme_config->type) === $theme->name];
         }
     }
     return $themes;
 }
开发者ID:cvepdb-cms,项目名称:module-themes,代码行数:19,代码来源:ThemesRepository.php

示例2: index

 /** !Route GET */
 function index()
 {
     $page = isset($this->request->get['page']) ? (int) $this->request->get['page'] : 1;
     $this->page = $page;
     $url = "http://macthemes2.net/forum/viewforum.php?id=24&p={$page}";
     if (!is_cache_valid(url_cache_file($url))) {
         $html = download($url);
         $doc = phpQuery::newDocument($html);
         $rows = $doc['#punviewforum table tr > td.tcl']->parent();
         $viewtopic_length = strlen('viewtopic.php?id=');
         foreach ($rows as $row) {
             $row = pq($row);
             $a = $row['a:first'][0];
             $name = trim($a->text());
             if (preg_match('/^\\[(theme|contest|contest theme)\\]/iu', $name)) {
                 $id = substr($a->attr('href'), $viewtopic_length);
                 if (!Make::a('Theme')->like('topic_id', $id)->exists()) {
                     $artist = $row['td.tc4'][0]->text();
                     $byPos = strrpos($name, ' by ');
                     if ($byPos !== false) {
                         $name = substr($name, 0, $byPos);
                     }
                     $name = strip_tag_prefix($name);
                     $theme = new Theme();
                     $theme->topic_id = $id;
                     $theme->name = $name;
                     $theme->artist = $artist;
                     $theme->save();
                 }
             }
         }
     }
     $this->themeSet = $this->theme->all();
     if (isset($this->request->get['flash'])) {
         $this->flash = $this->request->get['flash'];
     }
 }
开发者ID:ratz,项目名称:icon-harvester,代码行数:38,代码来源:ThemeController.class.php

示例3: activateTheme

 public function activateTheme($id)
 {
     $theme = Theme::find($id);
     if ($theme == NULL) {
         return Redirect::back()->with(['notice' => 'No Theme Found']);
     }
     if (Input::has('activate')) {
         foreach (Theme::all() as $t) {
             if ($t->active == true) {
                 $t->active = false;
                 $t->save();
             }
         }
         $state = Input::get('activate');
         $theme->active = $state == 'true' ? true : false;
         $theme->save();
     }
     return Redirect::back()->with(['notice' => 'Bootstrap Theme Updated']);
 }
开发者ID:vanderlin,项目名称:Gear2,代码行数:19,代码来源:AdminController.php

示例4: current_section

/**
 * Get the information whether the current section is backend, admin or public
 * @return array
 */
function current_section()
{
    if (Schema::hasTable('themes') && Theme::all()->count() == 0) {
        // If for some reason, there are no themes in theme table, seed with the default data
        Artisan::call('db:seed', array('ThemesTableSeeder'));
    }
    if (Request::is('backend*') || Request::is('login/backend*')) {
        $link_type = 'backend';
        $link = 'backend/';
        $theme = Schema::hasTable('themes') ? Theme::find(Setting::value('backend_theme', 1))->directory : 'default';
        $layout = "backend.{$theme}._layouts._layout";
    } elseif (Request::is('admin*') || Request::is('login/admin*')) {
        $link_type = 'admin';
        $link = 'admin/';
        $theme = Schema::hasTable('themes') ? Theme::find(Setting::value('admin_theme', 1))->directory : 'default';
        $layout = "admin.{$theme}._layouts._layout";
    } else {
        $link_type = 'public';
        $link = '';
        $theme = Schema::hasTable('themes') ? Theme::find(Setting::value('public_theme', 1))->directory : 'default';
        $layout = "public.{$theme}._layouts._layout";
    }
    return array($link_type, $link, $layout, $theme);
}
开发者ID:ratno,项目名称:Doptor,代码行数:28,代码来源:helpers.php

示例5:

<html>
    <!-- START Head -->
    <head>
        <?php 
$theme = Theme::all();
?>
        <!-- START META SECTION -->
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title><?php 
echo $title;
?>
 | <?php 
echo Config::get('app.website_title');
?>
 Web Dashboard</title>
        <meta name="author" content="pampersdry.info">
        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0">
        <?php 
$active = '#000066';
$favicon = '/image/favicon.ico';
$logo = '/image/logo.png';
foreach ($theme as $themes) {
    $active = $themes->active_color;
    $favicon = '/uploads/' . $themes->favicon;
    $logo = '/uploads/' . $themes->logo;
}
if ($favicon == '/uploads/') {
    $favicon = '/image/favicon.ico';
}
if ($logo == '/uploads/') {
开发者ID:muhammadfarooq-mz,项目名称:uberforx,代码行数:31,代码来源:login.blade.php

示例6: theme

 public function theme()
 {
     $th = Theme::all()->count();
     if ($th == 1) {
         $theme = Theme::first();
     } else {
         $theme = new Theme();
     }
     $theme->theme_color = '#' . Input::get('color1');
     $theme->secondary_color = '#' . Input::get('color3');
     $theme->primary_color = '#' . Input::get('color2');
     $theme->hover_color = '#' . Input::get('color4');
     $theme->active_color = '#' . Input::get('color5');
     $css_msg = ".btn-default {\n  color: #ffffff;\n  background-color: {$theme->theme_color};\n}\n.navbar-nav > li {\n  float: left;\n}\n.btn-info{\n    color: #000;\n    background: #fff;\n    border-radius: 0px;\n    border:1px solid {$theme->theme_color};\n}\n.nav-admin .dropdown :hover, .nav-admin .dropdown :hover {\n    background: {$theme->hover_color};\n    color: #000;\n}\n.navbar-nav > li > a {\n  border-radius: 0px;\n}\n.navbar-nav > li + li {\n  margin-left: 2px;\n}\n.navbar-nav > li.active > a,\n.navbar-nav> li.active > a:hover,\n.navbar-nav > li.active > a:focus {\n  color: #ffffff;\n  background-color: {$theme->active_color}!important;\n}\n.logo_img_login{\nborder-radius: 30px;border: 4px solid {$theme->theme_color};\n}\n.btn-success {\n  color: #ffffff;\n  background-color: {$theme->theme_color};\n  border-color: {$theme->theme_color};\n}\n.btn-success:hover,\n.btn-success:focus,\n.btn-success:active,\n.btn-success.active,\n.open .dropdown-toggle.btn-success {\n  color: #ffffff;\n  background-color: {$theme->theme_color};\n  border-color: {$theme->theme_color};\n\n}\n\n\n.btn-success.disabled,\n.btn-success[disabled],\nfieldset[disabled] .btn-success,\n.btn-success.disabled:hover,\n.btn-success[disabled]:hover,\nfieldset[disabled] .btn-success:hover,\n.btn-success.disabled:focus,\n.btn-success[disabled]:focus,\nfieldset[disabled] .btn-success:focus,\n.btn-success.disabled:active,\n.btn-success[disabled]:active,\nfieldset[disabled] .btn-success:active,\n.btn-success.disabled.active,\n.btn-success[disabled].active,\nfieldset[disabled] .btn-success.active {\n\n  background-color: {$theme->theme_color};\n  border-color: {$theme->theme_color};\n}\n.btn-success .badge {\n  color: {$theme->theme_color};\n  background-color: #ffffff;\n}\n.btn-info {\n  color: #ffffff;\n  background-color: {$theme->theme_color};\n  border-color: {$theme->theme_color};\n}\n.btn-info:hover,\n.btn-info:focus,\n.btn-info:active,\n.btn-info.active,\n.open .dropdown-toggle.btn-info {\n  color: #000;\n  background-color: #FFFF;\n  border-color: {$theme->theme_color};\n}\n.btn-info:active,\n.btn-info.active,\n.open .dropdown-toggle.btn-info {\n  background-image: none;\n}\n.btn-info.disabled,\n.btn-info[disabled],\nfieldset[disabled] .btn-info,\n.btn-info.disabled:hover,\n.btn-info[disabled]:hover,\nfieldset[disabled] .btn-info:hover,\n.btn-info.disabled:focus,\n.btn-info[disabled]:focus,\nfieldset[disabled] .btn-info:focus,\n.btn-info.disabled:active,\n.btn-info[disabled]:active,\nfieldset[disabled] .btn-info:active,\n.btn-info.disabled.active,\n.btn-info[disabled].active,\nfieldset[disabled] .btn-info.active {\n  background-color: {$theme->theme_color};\n  border-color: {$theme->theme_color};\n}\n.btn-info .badge {\n  color: {$theme->theme_color};\n  background-color: #029acf;\n  border-color: #029acf;\n}\n.btn-success,\n.btn-success:hover {\n  background-image: -webkit-linear-gradient({$theme->theme_color} {$theme->theme_color} 6%, {$theme->theme_color});\n  background-image: linear-gradient({$theme->theme_color}, {$theme->theme_color} 6%, {$theme->theme_color});\n  background-repeat: no-repeat;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='{$theme->theme_color}', endColorstr='{$theme->theme_color}', GradientType=0);\n  filter: none;\n  border: 1px solid {$theme->theme_color};\n}\n.btn-info,\n.btn-info:hover {\n  background-image: -webkit-linear-gradient({$theme->theme_color}, {$theme->theme_color} 6%, {$theme->theme_color});\n  background-image: linear-gradient({$theme->theme_color}, {$theme->theme_color} 6%, {$theme->theme_color});\n  background-repeat: no-repeat;\n  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='{$theme->theme_color}', endColorstr='{$theme->theme_color}', GradientType=0);\n  filter: none;\n  border: 1px solid {$theme->theme_color};\n}\n.logo h3{\n    margin: 0px;\n    color: {$theme->theme_color};\n}\n\n.second-nav{\n    background: {$theme->theme_color};\n}\n.login_back{background-color: {$theme->theme_color};}\n.no_radious:hover{background-image: -webkit-linear-gradient({$theme->theme_color}, {$theme->theme_color} 6%, {$theme->theme_color});background-image: linear-gradient(#5d4dd1, #5d4dd1 6%, #5d4dd1);background-repeat: no-repeat;filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5d4dd1', endColorstr='#5d4dd1', GradientType=0);filter: none;border: 1px solid #5d4dd1;}\n.navbar-nav li:nth-child(1) a{\n    background: {$theme->primary_color};\n}\n\n.navbar-nav li:nth-child(2) a{\n    background: {$theme->secondary_color};\n}\n\n.navbar-nav li:nth-child(3) a{\n    background: {$theme->primary_color};\n}\n\n.navbar-nav li:nth-child(4) a{\n    background: {$theme->secondary_color};\n}\n\n.navbar-nav li:nth-child(5) a{\n    background: {$theme->primary_color};\n}\n\n.navbar-nav li:nth-child(6) a{\n    background: {$theme->secondary_color};\n}\n\n.navbar-nav li:nth-child(7) a{\n    background: {$theme->primary_color};\n}\n\n.navbar-nav li:nth-child(8) a{\n    background: {$theme->secondary_color};\n}\n\n.navbar-nav li:nth-child(9) a{\n    background: {$theme->primary_color};\n}\n\n.navbar-nav li:nth-child(10) a{\n    background: {$theme->secondary_color};\n}\n\n.navbar-nav li a:hover{\n    background: {$theme->hover_color};\n}\n.btn-green{\n\n    background: {$theme->theme_color};\n    color: #fff;\n}\n.btn-green:hover{\n    background: {$theme->hover_color};\n    color: #fff;\n}\n";
     $t = file_put_contents(public_path() . '/stylesheet/theme_cus.css', $css_msg);
     /* chmod(public_path() . '/stylesheet/theme_cus.css', 0777); */
     if (Input::hasFile('logo')) {
         // Upload File
         $file_name = time();
         $file_name .= rand();
         $ext = Input::file('logo')->getClientOriginalExtension();
         Input::file('logo')->move(public_path() . "/uploads", $file_name . "." . $ext);
         $local_url = $file_name . "." . $ext;
         /* $new = Image::make(public_path() . "/uploads/" . $local_url)->resize(70, 70)->save(); */
         // Upload to S3
         if (Config::get('app.s3_bucket') != "") {
             $s3 = App::make('aws')->get('s3');
             $pic = $s3->putObject(array('Bucket' => Config::get('app.s3_bucket'), 'Key' => $file_name, 'SourceFile' => public_path() . "/uploads/" . $local_url));
             $s3->putObjectAcl(array('Bucket' => Config::get('app.s3_bucket'), 'Key' => $file_name, 'ACL' => 'public-read'));
             $s3_url = $s3->getObjectUrl(Config::get('app.s3_bucket'), $file_name);
         } else {
             $s3_url = asset_url() . '/uploads/' . $local_url;
         }
         if (isset($theme->logo)) {
             $icon = asset_url() . '/uploads/' . $theme->logo;
             unlink_image($icon);
         }
         $theme->logo = $local_url;
     }
     if (Input::hasFile('icon')) {
         // Upload File
         $file_name1 = time();
         $file_name1 .= rand();
         $file_name1 .= 'icon';
         $ext1 = Input::file('icon')->getClientOriginalExtension();
         Input::file('icon')->move(public_path() . "/uploads", $file_name1 . "." . $ext1);
         $local_url1 = $file_name1 . "." . $ext1;
         // Upload to S3
         if (Config::get('app.s3_bucket') != "") {
             $s3 = App::make('aws')->get('s3');
             $pic = $s3->putObject(array('Bucket' => Config::get('app.s3_bucket'), 'Key' => $file_name1, 'SourceFile' => public_path() . "/uploads/" . $local_url1));
             $s3->putObjectAcl(array('Bucket' => Config::get('app.s3_bucket'), 'Key' => $file_name1, 'ACL' => 'public-read'));
             $s3_url1 = $s3->getObjectUrl(Config::get('app.s3_bucket'), $file_name1);
         } else {
             $s3_url1 = asset_url() . '/uploads/' . $local_url1;
         }
         if (isset($theme->favicon)) {
             $icon = asset_url() . '/uploads/' . $theme->favicon;
             unlink_image($icon);
         }
         $theme->favicon = $local_url1;
     }
     $theme->save();
     return Redirect::to("/admin/settings");
 }
开发者ID:felipemarques8,项目名称:goentregas,代码行数:65,代码来源:AdminController.php

示例7: get_track_loc

 public function get_track_loc($id)
 {
     $request = Requests::where('security_key', $id)->where('is_started', 1)->where('is_completed', 0)->first();
     if ($request) {
         $owner = Owner::where('id', $request->owner_id)->first();
         $user_name = $owner->first_name . " " . $owner->last_name;
         $theme = Theme::all();
         $logo = '/image/logo.png';
         $favicon = '/image/favicon.ico';
         foreach ($theme as $themes) {
             $favicon = '/uploads/' . $themes->favicon;
             $logo = '/uploads/' . $themes->logo;
         }
         if ($logo == '/uploads/') {
             $logo = '/image/logo.png';
         }
         if ($favicon == '/uploads/') {
             $favicon = '/image/favicon.ico';
         }
         $app_name = Config::get('app.website_title');
         // walk location
         $start_loc = WalkLocation::where('request_id', $request->id)->first();
         $reqloc = WalkLocation::where('request_id', $request->id)->orderBy('id', 'desc')->first();
         $title = 'Track ' . $user_name;
         return Response::json(array('success' => true, 'titl' => $title, 'logo' => $logo, 'favicon' => $favicon, 'app_name' => $app_name, 'cur_lat' => $reqloc->latitude, 'cur_lon' => $reqloc->longitude, 'prev_lat' => $start_loc->latitude, 'prev_lon' => $start_loc->longitude, 'track_id' => $id));
     } else {
         return Redirect::to('/');
     }
 }
开发者ID:felipemarques8,项目名称:goentregas,代码行数:29,代码来源:WebController.php

示例8: getAll

 public function getAll()
 {
     return \Theme::all(array('uri', 'label'))->toArray();
 }
开发者ID:jalbertbowden,项目名称:core,代码行数:4,代码来源:ThemeRepository.php

示例9: general

 public function general()
 {
     $themes = Theme::all();
     $current = Theme::getActive();
     return $this->view('settings.general', compact('themes', 'current'));
 }
开发者ID:maxupunk,项目名称:metin2cms,代码行数:6,代码来源:SettingController.php

示例10: substr

<h1 class="page-header">Themes</h1>
<div class="table-responsive">
  <table class="table table-striped">
  
    <thead>
      <tr>
        <th>Name</th>
        <th>Head Code</th>
        <th></th>
      </tr>
    </thead>

    <tbody>
      <form>
        <?php 
$installed_themes = Theme::all();
?>
        <?php 
$active_theme = Config::get('slate::active-bootstrap-theme');
?>
        <?php 
$themes = File::directories(public_path() . '/assets/themes');
?>
        @foreach ($themes as $theme)

          <?php 
$name = substr($theme, strripos($theme, '/') + 1);
$theme = ucfirst($name);
$is_installed = false;
$installed_theme = null;
foreach ($installed_themes as $it) {
开发者ID:vanderlin,项目名称:Gear2,代码行数:31,代码来源:themes.blade.php


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