Пример #1
0
$symlink_warning = '<p class="elgg-text-help">' . elgg_echo('installation:cache_symlink:description') . '</p>';
if ($cache_symlinked) {
    $params['class'] = 'elgg-state-disabled';
    $params['label_class'] = 'elgg-state-disabled';
    $symlink_warning .= elgg_format_element('span', ['class' => 'elgg-text-help'], elgg_echo('installation:cache_symlink:warning'));
}
$symlink_input = elgg_view('input/checkbox', $params);
$symlink_source = elgg_get_root_path() . 'cache/';
$symlink_target = elgg_get_cache_path() . 'views_simplecache/';
$symlink_paths_help = elgg_echo('installation:cache_symlink:paths', [$symlink_source, $symlink_target]);
$symlink_warning .= elgg_format_element('span', ['class' => 'elgg-text-help'], $symlink_paths_help);
// minify
$minify_description = elgg_echo('installation:minify:description');
$minify_js_input = elgg_view("input/checkbox", array('label' => elgg_echo('installation:minify_js:label'), 'name' => 'simplecache_minify_js', 'checked' => (bool) elgg_get_config('simplecache_minify_js'), 'label_class' => $simple_cache_disabled_class, 'switch' => true));
$minify_css_input = elgg_view("input/checkbox", array('label' => elgg_echo('installation:minify_css:label'), 'name' => 'simplecache_minify_css', 'checked' => (bool) elgg_get_config('simplecache_minify_css'), 'label_class' => $simple_cache_disabled_class, 'switch' => true));
$system_cache_input = elgg_view_field(['#type' => 'checkbox', 'label' => elgg_echo('installation:systemcache:label'), 'help' => elgg_echo('installation:systemcache:description'), 'name' => 'system_cache_enabled', 'switch' => true, 'checked' => elgg_is_system_cache_enabled(), '#class' => 'mtm']);
$body = <<<BODY
\t<div>
\t\t{$simple_cache_input}
\t\t{$simple_cache_warning}
\t</div>
\t<div>
\t\t{$symlink_input}
\t\t{$symlink_warning}
\t</div>
\t<div>
\t\t<p>{$minify_description}</p>
\t\t{$minify_js_input}<br />
\t\t{$minify_css_input}
\t</div>
Пример #2
0
<?php

/**
 * Developer settings
 */
$data = array('simple_cache' => array('type' => 'checkbox', 'value' => 1, 'checked' => elgg_get_config('simplecache_enabled') == 1, 'readonly' => $GLOBALS['_ELGG']->simplecache_enabled_in_settings), 'system_cache' => array('type' => 'checkbox', 'value' => 1, 'checked' => elgg_is_system_cache_enabled(), 'readonly' => false), 'display_errors' => array('type' => 'checkbox', 'value' => 1, 'checked' => elgg_get_plugin_setting('display_errors', 'developers') == 1, 'readonly' => false), 'debug_level' => array('type' => 'dropdown', 'value' => elgg_get_config('debug'), 'options_values' => array(false => elgg_echo('developers:debug:off'), 'ERROR' => elgg_echo('developers:debug:error'), 'WARNING' => elgg_echo('developers:debug:warning'), 'NOTICE' => elgg_echo('developers:debug:notice'), 'INFO' => elgg_echo('developers:debug:info')), 'readonly' => false), 'screen_log' => array('type' => 'checkbox', 'value' => 1, 'checked' => elgg_get_plugin_setting('screen_log', 'developers') == 1, 'readonly' => false), 'show_strings' => array('type' => 'checkbox', 'value' => 1, 'checked' => elgg_get_plugin_setting('show_strings', 'developers') == 1, 'readonly' => false), 'show_modules' => array('type' => 'checkbox', 'value' => 1, 'checked' => elgg_get_plugin_setting('show_modules', 'developers') == 1, 'readonly' => false), 'wrap_views' => array('type' => 'checkbox', 'value' => 1, 'checked' => elgg_get_plugin_setting('wrap_views', 'developers') == 1, 'readonly' => false), 'log_events' => array('type' => 'checkbox', 'value' => 1, 'checked' => elgg_get_plugin_setting('log_events', 'developers') == 1, 'readonly' => false), 'show_gear' => array('type' => 'checkbox', 'value' => 1, 'checked' => elgg_get_plugin_setting('show_gear', 'developers') == 1, 'readonly' => false));
$form_vars = array('id' => 'developer-settings-form', 'class' => 'elgg-form-settings');
$body_vars = array('data' => $data);
echo elgg_view_form('developers/settings', $form_vars, $body_vars);
Пример #3
0
<?php

/**
 * Quick introduction to the theme sandbox
 *
 * @todo links to resources?
 */
?>

<p>This theme sandbox provides a visual catalog for many of the theming elements
	that Elgg uses. The primary css selector is listed with each theme element.
	The sandbox is divided into sections that are listed in the sidebar.
</p>
<?php 
$simple_cache = elgg_get_config('simplecache_enabled');
$system_cache = elgg_is_system_cache_enabled();
if ($simple_cache || $system_cache) {
    $advanced = elgg_view('output/url', array('text' => 'Advanced Settings', 'href' => 'admin/settings/advanced', 'is_trusted' => true));
    $developers = elgg_view('output/url', array('text' => 'Developers\' Plugin Settings', 'href' => 'admin/developers/settings', 'is_trusted' => true));
    $body = "Caches are enabled. Changes you make to CSS and views might not appear. It is\n\talways recommended to disable caches while developing themes and plugins. To\n\tdisable caches, visit the {$advanced} or {$developers} pages.";
    echo elgg_view_module('info', 'Warning', $body);
}
?>
<p>
<?php 
echo elgg_view('output/url', array('text' => elgg_echo('theme_sandbox:breakout'), 'href' => current_page_url(), 'target' => '_parent', 'is_trusted' => true));
?>
</p>
Пример #4
0
 /**
  * Load both core and plugin translations
  *
  * By default this loads only English and the language of the logged
  * in user.
  *
  * The optional $language argument can be used to load translations
  * on-demand in case we need to translate something to a language not
  * loaded by default for the current request.
  *
  * @param string $language Language code
  * @access private
  */
 public function loadTranslations($language = null)
 {
     if (elgg_is_system_cache_enabled()) {
         $loaded = true;
         if ($language) {
             $languages = array($language);
         } else {
             $languages = array_unique(array('en', $this->getCurrentLanguage()));
         }
         foreach ($languages as $language) {
             $data = elgg_load_system_cache("{$language}.lang");
             if ($data) {
                 $this->addTranslation($language, unserialize($data));
             } else {
                 $loaded = false;
             }
         }
         if ($loaded) {
             $GLOBALS['_ELGG']->i18n_loaded_from_cache = true;
             // this is here to force
             $GLOBALS['_ELGG']->language_paths[$this->defaultPath] = true;
             return;
         }
     }
     // load core translations from languages directory
     $this->registerTranslations($this->defaultPath, false, $language);
     // Plugin translation have already been loaded for the default
     // languages by ElggApplication::bootCore(), so there's no need
     // to continue unless loading a specific language on-demand
     if ($language) {
         $this->loadPluginTranslations($language);
     }
 }