Compare commits

...

22 Commits

Author SHA1 Message Date
Andy Miller
11869ad4ec Merge branch 'release/0.9.35' 2015-08-06 18:38:48 -06:00
Andy Miller
11fc34cfed version update 2015-08-06 18:38:35 -06:00
Andy Miller
b5717c2cbb Merge branch 'develop' of https://github.com/getgrav/grav into develop
# By Djamil Legato (1) and Sommerregen (1)
# Via Andy Miller (1) and Djamil Legato (1)
* 'develop' of https://github.com/getgrav/grav:
  Fixed GPM issue when using cURL throwing an `Undefined offset: 1` exception
  Fix #248 (Plugin language interference) and fixed summary
2015-08-06 18:31:21 -06:00
Andy Miller
0c085a5aab Override save to not store the username field 2015-08-06 18:31:08 -06:00
Andy Miller
5cee23cbfa Added new unsetRoute() to allow route() to rebuild 2015-08-06 18:30:50 -06:00
Andy Miller
1e168b3100 made username disabled 2015-08-06 18:30:24 -06:00
Djamil Legato
018f7a6dec Fixed GPM issue when using cURL throwing an Undefined offset: 1 exception 2015-08-06 11:31:37 -07:00
Andy Miller
a62e88f22b Merge pull request #249 from Sommerregen/bugfix/plugin-language-interference
Fix #248 (Plugin language interference) and fixed summary
2015-08-06 12:20:52 -06:00
Sommerregen
dc5ba9eff4 Fix #248 (Plugin language interference) and fixed summary 2015-08-06 19:59:20 +02:00
Andy Miller
4bebdfe0c7 fixed metadata merging (hopefully!) 2015-08-05 22:27:26 -06:00
Andy Miller
f8fd065192 removed unused body_classes in modular type 2015-08-05 22:26:57 -06:00
Andy Miller
9d38d0818b fix robots field 2015-08-05 22:26:41 -06:00
Andy Miller
a1ad9b7f4d list of pages should show all except root 2015-08-05 18:06:50 -06:00
Andy Miller
29cb55e91c visible toggle and help commands on new page 2015-08-05 18:06:07 -06:00
Andy Miller
0687d2ff78 added body_classes to modular type 2015-08-05 18:05:34 -06:00
Andy Miller
cd04572b78 using new templates field type 2015-08-05 18:04:57 -06:00
Andy Miller
6bb47124a9 added body classes 2015-08-05 18:03:34 -06:00
Andy Miller
1a21186ba1 removed duplicate hidden type field 2015-08-05 18:03:16 -06:00
Andy Miller
82d1193090 removed required from title 2015-08-05 18:02:48 -06:00
Andy Miller
ea76ac024a Merge pull request #244 from notklaatu/develop
added conf settings for running grav in sud dir, on nginx
2015-08-05 09:39:21 -06:00
Klaatu
ff52d61322 added conf settings for running grav in sud dir, on nginx 2015-08-05 11:44:38 +12:00
Andy Miller
83e970731e Merge branch 'release/0.9.34' into develop 2015-08-04 16:53:33 -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.
*