<?php

return array('BaseController' => themosis_path('app') . 'controllers' . DS . 'BaseController.php');
Esempio n. 2
0
<?php 
return array('BaseController' => themosis_path('app') . 'controllers' . DS . 'BaseController.php', 'PageController' => themosis_path('app') . 'controllers' . DS . 'PageController.php', 'LimesurveyController' => themosis_path('app') . 'controllers' . DS . 'LimesurveyController.php', 'ReportingController' => themosis_path('app') . 'controllers' . DS . 'ReportingController.php', 'PostModel' => themosis_path('app') . 'models' . DS . 'PostModel.php', 'LimesurveyModel' => themosis_path('app') . 'models' . DS . 'LimesurveyModel.php', 'SurveyModel' => themosis_path('app') . 'models' . DS . 'SurveyModel.php', 'UserModel' => themosis_path('app') . 'models' . DS . 'UserModel.php', 'EvaluationModel' => themosis_path('app') . 'models' . DS . 'EvaluationModel.php', 'RelationModel' => themosis_path('app') . 'models' . DS . 'RelationModel.php');
Esempio n. 3
0
 /**
  * Define paths and bootstrap the framework.
  *
  * @return void
  */
 public function bootstrap()
 {
     /**
      * Define all framework paths
      * These are real paths, not URLs to the framework files.
      * These paths are extensible with the help of WordPress
      * filters.
      */
     // Framework paths.
     $paths = apply_filters('themosis_framework_paths', []);
     // Plugin base path.
     $paths['plugin'] = __DIR__ . DS;
     // Framework base path.
     $paths['sys'] = __DIR__ . DS . 'src' . DS . 'Themosis' . DS;
     // Storage path.
     $paths['storage'] = THEMOSIS_STORAGE;
     // Register globally the paths
     themosis_set_paths($paths);
     // Bootstrap the framework
     require_once themosis_path('plugin') . 'bootstrap' . DS . 'start.php';
 }
<?php

return array('PostModel' => themosis_path('app') . 'models' . DS . 'PostModel.php');
Esempio n. 5
0
function themosis_start_app()
{
    if (THFWK_ThemosisTheme::getInstance()->isPluginLoaded()) {
        do_action('themosis_parse_query', $arg = '');
        /*----------------------------------------------------*/
        // Application routes.
        /*----------------------------------------------------*/
        require themosis_path('app') . 'routes.php';
        /*----------------------------------------------------*/
        // Run application and return a response.
        /*----------------------------------------------------*/
        do_action('themosis_run');
    } else {
        _e("The theme won't work until you install the Themosis framework plugin correctly.", THEMOSIS_THEME_TEXTDOMAIN);
    }
}
Esempio n. 6
0
 function database_path($path)
 {
     return themosis_path('storage') . DS . 'database' . DS . $path;
 }
Esempio n. 7
0
<?php

return array('BaseController' => themosis_path('app') . 'controllers' . DS . 'BaseController.php', 'PagesController' => themosis_path('app') . 'controllers' . DS . 'PagesController.php', 'BooksController' => themosis_path('app') . 'controllers' . DS . 'BooksController.php', 'PostModel' => themosis_path('app') . 'models' . DS . 'PostModel.php', 'Books' => themosis_path('app') . 'models' . DS . 'Books.php', 'Faqs' => themosis_path('app') . 'models' . DS . 'Faqs.php');
Esempio n. 8
0
/*
 * Register plugin views.
 */
container('view.finder')->addLocation(themosis_path('plugin.' . $vars['namespace'] . '.resources') . 'views');
/*
 * Service providers.
 */
$providers = container('config')->get($vars['config'] . '_providers');
foreach ($providers as $provider) {
    container()->register($provider);
}
/*
 * Admin files autoloading.
 * I18n.
 */
container('action')->add('plugins_loaded', function () use($vars) {
    /**
     * I18n
     * Todo: #2 - Replace constant below.
     */
    load_plugin_textdomain(MY_PLUGIN_TD, false, trailingslashit(dirname(plugin_basename(__FILE__))) . 'languages');
    /*
     * Plugin admin files.
     * Autoload files in alphabetical order.
     */
    $loader = container('loader')->add([themosis_path('plugin.' . $vars['namespace'] . '.admin')]);
    $loader->load();
});
/*
 * Add extra features below.
 */
    </script>
    <?php 
$show = empty($field['value']) ? '' : 'show';
?>
    <div class="themosis-collection-container {{ $show }}">
        <!-- Collection -->
        <div class="themosis-collection">
            <ul class="themosis-collection-list">
                @if (!empty($field['value']) && is_array($field['value']))
                    @foreach($field['value'] as $i => $item)
                        <li>
                            {{ Themosis\Facades\Form::hidden($field['name'].'[]', $item, ['data-field' => 'collection']) }}
                            <div class="themosis-collection__item">
                                <?php 
$isFile = false;
$src = themosis_plugin_url(themosis_path('plugin')) . '/src/Themosis/_assets/images/themosisFileIcon.png';
if (wp_attachment_is_image($item)) {
    $src = wp_get_attachment_image_src($item, '_themosis_media');
    $src = $src[0];
} else {
    $src = wp_get_attachment_image_src($item, '_themosis_media', true);
    $src = $src[0];
    $isFile = true;
}
?>
                                <div class="centered">
                                    <img src="{{ $src }}" alt="Collection Item" <?php 
if ($isFile) {
    echo 'class="icon"';
}
?>
Esempio n. 10
0
<?php

return array('BaseController' => themosis_path('app') . 'controllers' . DS . 'BaseController.php', 'PostModel' => themosis_path('app') . 'models' . DS . 'PostModel.php');
Esempio n. 11
0
 /**
  * Register plugin routes.
  * Define a custom namespace.
  */
 public function register()
 {
     Route::group(['namespace' => 'Tld\\Domain\\Plugin\\Controllers'], function () {
         require themosis_path('plugin.tld.domain.plugin.resources') . 'routes.php';
     });
 }
Esempio n. 12
0
 /**
  * Define paths and bootstrap the framework.
  *
  * @return void
  */
 public function bootstrap()
 {
     /**
      * Define all framework paths
      * These are real paths, not URLs to the framework files.
      * These paths are extensible with the help of WordPress
      * filters.
      */
     // Framework paths.
     $paths = apply_filters('themosis_framework_paths', []);
     // Plugin base path.
     $paths['plugin'] = __DIR__ . DS;
     // Framework base path.
     $paths['sys'] = __DIR__ . DS . 'src' . DS . 'Themosis' . DS;
     // Register globally the paths
     foreach ($paths as $name => $path) {
         if (!isset($GLOBALS['themosis_paths'][$name])) {
             $GLOBALS['themosis_paths'][$name] = realpath($path) . DS;
         }
     }
     // Bootstrap the framework
     if (isset($GLOBALS['THFWK_Themosis'])) {
         require_once themosis_path('plugin') . 'bootstrap' . DS . 'start.php';
     }
 }
Esempio n. 13
0
/*----------------------------------------------------*/
add_filter('themosisViewPaths', function ($paths) {
    $paths[] = themosis_path('sys') . 'Metabox' . DS . 'Views' . DS;
    $paths[] = themosis_path('sys') . 'Page' . DS . 'Views' . DS;
    $paths[] = themosis_path('sys') . 'PostType' . DS . 'Views' . DS;
    $paths[] = themosis_path('sys') . 'Field' . DS . 'Fields' . DS . 'Views' . DS;
    $paths[] = themosis_path('sys') . 'Route' . DS . 'Views' . DS;
    $paths[] = themosis_path('sys') . 'User' . DS . 'Views' . DS;
    return $paths;
});
/*----------------------------------------------------*/
// Register framework asset paths.
/*----------------------------------------------------*/
add_filter('themosisAssetPaths', function ($paths) {
    $coreUrl = themosis_plugin_url(dirname(__DIR__)) . '/src/Themosis/_assets';
    $paths[$coreUrl] = themosis_path('sys') . '_assets';
    return $paths;
});
/*----------------------------------------------------*/
// Register framework media image size.
/*----------------------------------------------------*/
$images = new Themosis\Configuration\Images(['_themosis_media' => [100, 100, true, __('Mini')]]);
$images->make();
/*----------------------------------------------------*/
// Allow developers to add parameters to
// the admin global JS object.
/*----------------------------------------------------*/
add_action('admin_head', function () {
    $datas = apply_filters('themosisAdminGlobalObject', []);
    $output = "<script type=\"text/javascript\">\n\r";
    $output .= "//<![CDATA[\n\r";
Esempio n. 14
0
function themosis_start_app()
{
    do_action('themosis_parse_query', $arg = '');
    /*----------------------------------------------------*/
    // Application routes.
    /*----------------------------------------------------*/
    require themosis_path('theme') . 'routes.php';
    /*----------------------------------------------------*/
    // Run application and return a response.
    /*----------------------------------------------------*/
    do_action('themosis_run');
}
Esempio n. 15
0
 /**
  * Define theme routes namespace.
  */
 public function register()
 {
     Route::group(['namespace' => 'Theme\\Controllers'], function () {
         require themosis_path('theme.resources') . 'routes.php';
     });
 }
Esempio n. 16
0
    if (empty($content)) {
        return $content;
    }
    $content = mb_convert_encoding($content, 'HTML-ENTITIES', "UTF-8");
    $document = new DOMDocument();
    libxml_use_internal_errors(true);
    $document->loadHTML(utf8_decode($content));
    $imgs = $document->getElementsByTagName('img');
    foreach ($imgs as $img) {
        $existing_class = $img->getAttribute('class');
        $img->setAttribute('class', 'img-responsive ' . $existing_class);
    }
    $html = $document->saveHTML();
    return $html;
});
Action::add('wp_head', function ($post_id) {
    if (is_single()) {
        if (empty($post_id)) {
            set_post_view($post_id);
        } else {
            global $post;
            set_post_view($post->ID);
        }
    }
});
/*
 * Load translation
 * */
Action::add('after_setup_theme', function () {
    load_theme_textdomain(THEMOSIS_TEXTDOMAIN, themosis_path("theme") . 'languages');
});
<?php

/**
 * Plugin autoloading configuration.
 */
return ['Tld\\Domain\\Plugin\\Services\\' => themosis_path('plugin.tld.domain.plugin.resources') . 'providers', 'Tld\\Domain\\Plugin\\Controllers\\' => themosis_path('plugin.tld.domain.plugin.resources') . 'controllers'];
Esempio n. 18
0
$sidebars->make();
/*
 * Theme supports.
 */
$supports = new Themosis\Config\Support($theme['config']->get('supports'));
$supports->make();
/*
 * Theme admin files.
 * Autoload files in alphabetical order.
 */
$loader = $theme['loader']->add([themosis_path('theme.admin')]);
$loader->load();
/*
 * Theme widgets.
 */
$widgetLoader = $theme['loader.widget']->add([themosis_path('theme.resources') . 'widgets' . DS]);
$widgetLoader->load();
/*
 * Theme global JS object.
 */
$theme['action']->add('wp_head', 'themosis_theme_global_object');
/**
 * Stop editing. Happy development.
 */
function themosis_theme_cleanup()
{
    global $wp_widget_factory;
    remove_action('wp_head', 'rsd_link');
    remove_action('wp_head', 'wlwmanifest_link');
    remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);
    remove_action('wp_head', 'wp_generator');
Esempio n. 19
0
 /**
  * Setup core framework parameters.
  * At this moment, all activated plugins have been loaded.
  * Each plugin has its service providers registered.
  */
 protected function setup()
 {
     /*
      * Add view paths.
      */
     $viewFinder = $this->container['view.finder'];
     $viewFinder->addLocation(themosis_path('sys') . 'Metabox' . DS . 'Views');
     $viewFinder->addLocation(themosis_path('sys') . 'Page' . DS . 'Views');
     $viewFinder->addLocation(themosis_path('sys') . 'PostType' . DS . 'Views');
     $viewFinder->addLocation(themosis_path('sys') . 'Field' . DS . 'Fields' . DS . 'Views');
     $viewFinder->addLocation(themosis_path('sys') . 'Taxonomy' . DS . 'Views');
     $viewFinder->addLocation(themosis_path('sys') . 'User' . DS . 'Views');
     /*
      * Add paths to asset finder.
      */
     $url = plugins_url('src/Themosis/_assets', __FILE__);
     $assetFinder = $this->container['asset.finder'];
     $assetFinder->addPaths([$url => themosis_path('sys') . '_assets']);
     /*
      * Add framework core assets URL to the global
      * admin JS object.
      */
     add_filter('themosisAdminGlobalObject', function ($data) use($url) {
         $data['_themosisAssets'] = $url;
         return $data;
     });
     /*
      * Register framework media image size.
      */
     $images = new Themosis\Config\Images(['_themosis_media' => [100, 100, true, __('Mini', THEMOSIS_FRAMEWORK_TEXTDOMAIN)]], $this->container['filter']);
     $images->make();
     /*
      * Register framework assets.
      */
     $this->container['asset']->add('themosis-core-styles', 'css/_themosisCore.css', ['wp-color-picker'])->to('admin');
     $this->container['asset']->add('themosis-core-scripts', 'js/_themosisCore.js', ['jquery', 'jquery-ui-sortable', 'underscore', 'backbone', 'mce-view', 'wp-color-picker'], '1.3.0', true)->to('admin');
 }
Esempio n. 20
0
<?php

return ['' => [themosis_path('theme') . 'controllers', themosis_path('theme') . 'models']];
Esempio n. 21
0
<?php

return ['Theme\\Controllers\\' => themosis_path('theme.resources') . 'controllers', 'Theme\\Models\\' => themosis_path('theme.resources') . 'models', 'Theme\\Providers\\' => themosis_path('theme.resources') . 'providers'];