function load() { if (!file_exists($this->path)) { return false; } $required = array('username', 'password'); $optional = array('debug', 'debug_display', 'debug_log', 'fs_chmod_dir', 'fs_chmod_file', 'leeflets_api_url'); $both = array_merge($required, $optional); $vars = Inc::variables($this->path, $both); foreach ($required as $var) { if (!isset($vars[$var])) { die('Missing ' . $var . ' from config.php.'); } } foreach ($both as $var) { if (!isset($vars[$var])) { continue; } $this->{$var} = $vars[$var]; } $this->is_loaded = true; return true; }
function get_content_fields() { $content_file = $this->template_file_path('meta-content'); if (!$content_file) { die("Active template's meta-content.php not found."); } $vars = Inc::variables($content_file, array('content')); if (!isset($vars['content'])) { die("Can't load {$content} variable in the active template's meta-content.php."); } return $this->hook->apply('template_get_content_fields', $vars['content']); }