Revision 1841
Added by Dietmar almost 12 years ago
- fixed index depth in access files
functions.php | ||
---|---|---|
5 | 5 |
* @package framework |
6 | 6 |
* @author Ryan Djurovich,WebsiteBaker Project |
7 | 7 |
* @copyright 2009-2012, WebsiteBaker Org. e.V. |
8 |
* @link http://www.websitebaker2.org/
|
|
8 |
* @link http://www.websitebaker2.org/
|
|
9 | 9 |
* @license http://www.gnu.org/licenses/gpl.html |
10 | 10 |
* @platform WebsiteBaker 2.8.x |
11 | 11 |
* @requirements PHP 5.2.2 and higher |
12 | 12 |
* @version $Id$ |
13 |
* @filesource $HeadURL$
|
|
13 |
* @filesource $HeadURL$
|
|
14 | 14 |
* @lastmodified $Date$ |
15 | 15 |
* |
16 | 16 |
*/ |
... | ... | |
747 | 747 |
$parents .= '/'.$parent_folder; |
748 | 748 |
$acces_file = WB_PATH.PAGES_DIRECTORY.$parents; |
749 | 749 |
// can only be dirs |
750 |
if(!file_exists($acces_file)) {
|
|
750 |
if(!is_readable($acces_file)) {
|
|
751 | 751 |
if(!make_dir($acces_file)) { |
752 |
// $admin->print_error($MESSAGE['PAGES_CANNOT_CREATE_ACCESS_FILE_FOLDER']);
|
|
752 |
$retVal[] = $MESSAGE['PAGES_CANNOT_CREATE_ACCESS_FILE_FOLDER'];
|
|
753 | 753 |
$retVal[] = $MESSAGE['MEDIA_DIR_ACCESS_DENIED']; |
754 | 754 |
} |
755 | 755 |
} |
756 | 756 |
} |
757 | 757 |
} |
758 |
|
|
758 | 759 |
// The depth of the page directory in the directory hierarchy |
759 |
// '/pages' is at depth 1
|
|
760 |
$pages_dir_depth = count(explode('/',PAGES_DIRECTORY))-1;
|
|
760 |
// '/pages' is at depth 2
|
|
761 |
$bPagesDirectorySet = (sizeof(explode('/',PAGES_DIRECTORY))==1);
|
|
761 | 762 |
// Work-out how many ../'s we need to get to the index page |
762 |
$index_location = ''; |
|
763 |
for($i = 0; $i < $level + $pages_dir_depth; $i++) { |
|
764 |
$index_location .= '../'; |
|
765 |
} |
|
763 |
$pages_dir_depth = sizeof($parent_folders)-intval($bPagesDirectorySet); |
|
764 |
$index_location = str_repeat ( '../' , $pages_dir_depth ); |
|
766 | 765 |
$content = |
767 | 766 |
'<?php'."\n". |
768 | 767 |
'// *** This file is generated by WebsiteBaker Ver.'.VERSION."\n". |
Also available in: Unified diff