Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Moving page template display names to the bp_grab_page_templates() fu…

…nction.
  • Loading branch information...
commit 151a1c2b9a273de35f00b751997dffff351bbc5c 1 parent 643ae07
@ben-zene authored
Showing with 4 additions and 3 deletions.
  1. +1 −1  bp_lib/bp_content.php
  2. +3 −2 bp_lib/bp_functions.php
View
2  bp_lib/bp_content.php
@@ -168,7 +168,7 @@ public function create($raw_page, $page_template='blank') {
$page_file = PATH.'/bp_content/'.$page.'.php';
if (file_exists($page_file)) { $this->debug[] = 'The specified page name already exists.'; return false; }
//set default content
- if ($page_template != 'blank' && in_array($page_template, bp_grab_page_templates())) {
+ if ($page_template != 'blank' && array_key_exists($page_template, bp_grab_page_templates())) {
$this->content = file_get_contents(PATH.'/bp_lib/page_templates/'.$page_template.'.html');
}
else {
View
5 bp_lib/bp_functions.php
@@ -98,13 +98,14 @@ function bp_grab_themes() {
//look for page templates we can use
function bp_grab_page_templates() {
- $templates = array();
+ $templates = array('blank' => 'Blank Page');
$templates_dir = @opendir(PATH.'/bp_lib/page_templates');
if (false === $templates_dir) { return $templates; }
while (false !== ($template_dir = readdir($templates_dir))) {
if (is_dir(PATH.'/bp_lib/page_templates/'.$template_dir) || false === is_readable(PATH.'/bp_lib/page_templates/'.$template_dir)) { continue; }
if (substr($template_dir,0,1) == '.' || substr($template_dir, -5) != '.html') { continue; }
- $templates[] = substr($template_dir, 0, -5);
+ $tmp = substr($template_dir, 0, -5);
+ $templates[$tmp] = ucwords(str_replace("_", " ", $tmp));
}
return $templates;
}
Please sign in to comment.
Something went wrong with that request. Please try again.