Merge branch 'release/0.9.35'

This commit is contained in:
Andy Miller
2015-08-06 18:38:48 -06:00
12 changed files with 120 additions and 48 deletions

View File

@@ -1,3 +1,24 @@
# v0.9.35
## 08/06/2015
1. [](#new)
* Added `body_classes` field
* Added `visiblity` toggle and help tooltips on new page form
* Added new `Page.unsetRoute()` method to allow admin to regenerate the route
1. [](#improved)
* User save no longer stores username each time
* Page list form field now shows all pages except root
* Removed required option from page title
* Added configuration settings for running Nginx in sub directory
1. [](#bugfix)
* Fixed issue with GPM and cURL throwing `Undefined offset: 1` error
* Fixed deep translation merging
* Fixed broken **metadata** merging with site defaults
* Fixed broken **summary** field
* Fixed broken robots field
* Fixed GPM issue when using cURL, throwing an `Undefined offset: 1` exception
* Removed duplicate hidden page `type` field
# v0.9.34
## 08/04/2015

View File

@@ -26,6 +26,21 @@ http {
if (!-e $request_filename){ rewrite ^(.*)$ /index.php last; }
}
# if you want grav in a sub-directory of your main site
# (for example, example.com/mygrav) then you need this rewrite:
location /mygrav {
index index.php;
if (!-e $request_filename){ rewrite ^(.*)$ /mygrav/$2 last; }
try_files $uri $uri/ /index.php?$args;
}
# if using grav in a sub-directory of your site,
# prepend the actual path to each location
# for example: /mygrav/images
# and: /mygrav/user
# and: /mygrav/cache
# and so on
location /images/ {
# Serve images as static
}

View File

@@ -10,10 +10,6 @@ form:
validation: loose
fields:
type:
type: hidden
label: Page Type
default: default
tabs:
type: tabs
@@ -29,8 +25,6 @@ form:
type: text
style: vertical
label: Title
validate:
required: true
content:
type: markdown
@@ -118,13 +112,11 @@ form:
max: 120
header.metadata.robots:
type: checkboxes
type: text
toggleable: true
label: Robots
options:
noindex: No index
nofollow: No follow
use: keys
validate:
max: 120
taxonomies:
type: section
@@ -150,6 +142,17 @@ form:
column1:
type: column
fields:
settings:
type: section
title: Settings
underline: true
header.body_classes:
type: text
label: Body Classes
folder:
type: text
label: Folder Name
@@ -166,12 +169,13 @@ form:
'/': '- Root -'
type:
type: select
type: templates
classes: fancy
label: Display Template
default: default
@data-options: '\Grav\Common\Page\Pages::types'
column2:
type: column

View File

@@ -44,3 +44,4 @@ form:
type: ignore
uploads:
type: ignore

View File

@@ -15,18 +15,18 @@ form:
title:
type: text
label: Page Title
help: "The title of the page"
validate:
required: true
folder:
type: text
label: Folder Name
help: "The folder name that will be stored in the filesystem for this page"
validate:
type: slug
required: true
route:
type: select
label: Parent Page
@@ -40,6 +40,7 @@ form:
type:
type: select
help: "The page type that translates into which twig template renders the page"
classes: fancy
label: Display Template
default: default
@@ -47,6 +48,20 @@ form:
validate:
required: true
visible:
type: toggle
label: Visible
help: "Determines if a page is visible in the navigation."
highlight: ''
default: ''
options:
'': Auto
1: Yes
0: No
validate:
type: bool
required: true
blueprint:
type: blueprint

View File

@@ -12,6 +12,7 @@ form:
type: text
size: large
label: Username
disabled: true
readonly: true
email:

View File

@@ -2,7 +2,7 @@
// Some standard defines
define('GRAV', true);
define('GRAV_VERSION', '0.9.34');
define('GRAV_VERSION', '0.9.35');
define('DS', '/');
// Directories and Paths

View File

@@ -371,9 +371,7 @@ class Config extends Data
foreach ((array) $languageFiles['user/plugins'] as $plugin => $item) {
$lang_file = CompiledYamlFile::instance($item['file']);
$content = $lang_file->content();
foreach ((array) $content as $lang => $value) {
$this->languages->join($lang, $value, '/');
}
$this->languages->mergeRecursive($content);
}
}

View File

@@ -160,6 +160,8 @@ class Response
private static function getCurl()
{
$args = func_get_args();
$args = count($args) > 1 ? $args : array_shift($args);
$uri = $args[0];
$options = $args[1];
$callback = $args[2];

View File

@@ -332,7 +332,7 @@ class Page
// Return summary based on settings in site config file
if (!$config['enabled']) {
return $content;
return $this->content();
}
// Set up variables to process summary from page or from custom summary
@@ -1058,43 +1058,34 @@ class Page
// if not metadata yet, process it.
if (null === $this->metadata) {
$header_tag_http_equivs = ['content-type', 'default-style', 'refresh'];
$this->metadata = array();
$this->metadata = [];
// Set the Generator tag
$this->metadata['generator'] = array('name'=>'generator', 'content'=>'GravCMS ' . GRAV_VERSION);
// Get initial metadata for the page
$metadata = self::getGrav()['config']->get('site.metadata');
if (isset($this->header->metadata)) {
$page_header = $this->header->metadata;
// Merge any site.metadata settings in with page metadata
$defaults = (array) self::getGrav()['config']->get('site.metadata');
$metadata = array_merge($metadata, $this->header->metadata);
}
if (isset($page_header)) {
$page_header = array_merge($defaults, $page_header);
// Build an array of meta objects..
foreach ((array)$metadata as $key => $value) {
// If this is a property type metadata: "og", "twitter", "facebook" etc
if (is_array($value)) {
foreach ($value as $property => $prop_value) {
$prop_key = $key.":".$property;
$this->metadata[$prop_key] = array('property'=>$prop_key, 'content'=>htmlspecialchars($prop_value, ENT_QUOTES));
}
// If it this is a standard meta data type
} else {
$page_header = $defaults;
}
// Build an array of meta objects..
foreach ((array)$page_header as $key => $value) {
// If this is a property type metadata: "og", "twitter", "facebook" etc
if (is_array($value)) {
foreach ($value as $property => $prop_value) {
$prop_key = $key.":".$property;
$this->metadata[$prop_key] = array('property'=>$prop_key, 'content'=>htmlspecialchars($prop_value, ENT_QUOTES));
}
// If it this is a standard meta data type
if (in_array($key, $header_tag_http_equivs)) {
$this->metadata[$key] = array('http_equiv'=>$key, 'content'=>htmlspecialchars($value, ENT_QUOTES));
} else {
if (in_array($key, $header_tag_http_equivs)) {
$this->metadata[$key] = array('http_equiv'=>$key, 'content'=>htmlspecialchars($value, ENT_QUOTES));
} else {
$this->metadata[$key] = array('name'=>$key, 'content'=>htmlspecialchars($value, ENT_QUOTES));
}
$this->metadata[$key] = array('name'=>$key, 'content'=>htmlspecialchars($value, ENT_QUOTES));
}
}
}
@@ -1233,6 +1224,15 @@ class Page
return $this->route;
}
/**
* Helper method to clear the route out so it regenerates next time you use it
*/
public function unsetRoute()
{
unset($this->route);
}
public function rawRoute($var = null)
{
if ($var !== null) {
@@ -1943,7 +1943,7 @@ class Page
*/
protected function doRelocation($reorder)
{
if (empty($this->_original)) {
if (empty($this->_original) ) {
return;
}

View File

@@ -384,7 +384,8 @@ class Pages
}
$list = array();
if ($current->routable()) {
if (!$current->root()) {
$list[$current->route()] = str_repeat('  ', ($level-1)*2) . $current->title();
}

View File

@@ -91,6 +91,20 @@ class User extends Data
return (bool) $result;
}
/**
* Save user without the username
*/
public function save()
{
$file = $this->file();
if ($file) {
$username = $this->get('username');
unset($this->username);
$file->save($this->items);
$this->set('username', $username);
}
}
/**
* Checks user authorization to the action.
*