function _get_assets($type) { if (!empty($this->stores[$type])) { return; } $extensions = $this->_get_extensions($type); $store =& $this->stores[$type]; $path = WPHF::d_path(array($this->handle, $this->dirs[$type])); $url = WPHF::path(array($this->url, $this->dirs[$type])); $store = WPHF::directory_map($path, FALSE, $extensions); $store = WPHF::md_array_flatten($store, TRUE); asort($store); foreach ($store as &$file) { $path = pathinfo($file); $file = array('file' => $path['filename'], 'url' => WPHF::path(array($url, $file)), 'deps' => array(), 'ver' => MY_TVERSION); } if ($method = '_filter_' . $type and method_exists($this, $method)) { $this->{$method}(); } else { foreach ($store as $key => $file) { if (strncmp($file['file'], '_', 1) == 0) { $store[] = $store[$key]; unset($store[$key]); } } } }
function theme_admin_page() { extract($this->theme_admin_controller()); // get custom views ob_start(); include WPHF::d_path(array(self::$admin_path, 'guide.php')); $output = ob_get_contents(); if (WPHF::exists($links)) { foreach ($links as $name => $link) { extract($link); $patterns[] = "<a class=\"{$name}\""; $replacement = "<a class=\"{$name}\" href=\"{$url}\""; if (isset($tip)) { $replacement .= " title\"{$tip}\""; } $replacements[] = $replacement; } // TODO - works for now, though would rather use preg_replace $output = str_replace($patterns, $replacements, $output); } ob_end_clean(); echo $output; }