@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @package Blogs |
|
| 4 | - * @category modules |
|
| 5 | - * @author Nazar Mokrynskyi <[email protected]> |
|
| 6 | - * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi |
|
| 7 | - * @license MIT License, see license.txt |
|
| 8 | - */ |
|
| 3 | + * @package Blogs |
|
| 4 | + * @category modules |
|
| 5 | + * @author Nazar Mokrynskyi <[email protected]> |
|
| 6 | + * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi |
|
| 7 | + * @license MIT License, see license.txt |
|
| 8 | + */ |
|
| 9 | 9 | namespace cs; |
| 10 | 10 | Event::instance()->on( |
| 11 | 11 | 'admin/System/components/modules/install/after', |
@@ -1,11 +1,11 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @package Blogs |
|
| 4 | - * @category modules |
|
| 5 | - * @author Nazar Mokrynskyi <[email protected]> |
|
| 6 | - * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi |
|
| 7 | - * @license MIT License, see license.txt |
|
| 8 | - */ |
|
| 3 | + * @package Blogs |
|
| 4 | + * @category modules |
|
| 5 | + * @author Nazar Mokrynskyi <[email protected]> |
|
| 6 | + * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi |
|
| 7 | + * @license MIT License, see license.txt |
|
| 8 | + */ |
|
| 9 | 9 | namespace cs\modules\Blogs; |
| 10 | 10 | use |
| 11 | 11 | cs\Config, |
@@ -27,8 +27,8 @@ discard block |
||
| 27 | 27 | $Route = Route::instance(); |
| 28 | 28 | $Sections = Sections::instance(); |
| 29 | 29 | /** |
| 30 | - * At first - determine part of url and get sections list based on that path |
|
| 31 | - */ |
|
| 30 | + * At first - determine part of url and get sections list based on that path |
|
| 31 | + */ |
|
| 32 | 32 | $sections = $Sections->get_by_path( |
| 33 | 33 | array_slice($Route->path, 1) |
| 34 | 34 | ); |
@@ -37,49 +37,49 @@ discard block |
||
| 37 | 37 | } |
| 38 | 38 | $sections = $Sections->get($sections); |
| 39 | 39 | /** |
| 40 | - * Now lets set page title using sections names from page path |
|
| 41 | - * We will not remove `$section` variable after, since it will be direct parent of each shown post |
|
| 42 | - */ |
|
| 40 | + * Now lets set page title using sections names from page path |
|
| 41 | + * We will not remove `$section` variable after, since it will be direct parent of each shown post |
|
| 42 | + */ |
|
| 43 | 43 | foreach ($sections as $section) { |
| 44 | 44 | $Page->title($section['title']); |
| 45 | 45 | } |
| 46 | 46 | /** |
| 47 | - * Now add link to Atom feed for posts from current section only |
|
| 48 | - */ |
|
| 47 | + * Now add link to Atom feed for posts from current section only |
|
| 48 | + */ |
|
| 49 | 49 | /** @noinspection PhpUndefinedVariableInspection */ |
| 50 | 50 | $Page->atom( |
| 51 | 51 | "Blogs/atom.xml/?section=$section[id]", |
| 52 | 52 | implode($Config->core['title_delimiter'], [$L->latest_posts, $L->section, $section['title']]) |
| 53 | 53 | ); |
| 54 | 54 | /** |
| 55 | - * Set page of blog type (Open Graph protocol) |
|
| 56 | - */ |
|
| 55 | + * Set page of blog type (Open Graph protocol) |
|
| 56 | + */ |
|
| 57 | 57 | $Meta->blog(); |
| 58 | 58 | /** |
| 59 | - * Determine current page |
|
| 60 | - */ |
|
| 59 | + * Determine current page |
|
| 60 | + */ |
|
| 61 | 61 | $page = max( |
| 62 | 62 | isset($Route->ids[0]) ? array_slice($Route->ids, -1)[0] : 1, |
| 63 | 63 | 1 |
| 64 | 64 | ); |
| 65 | 65 | /** |
| 66 | - * If this is not first page - show that in page title |
|
| 67 | - */ |
|
| 66 | + * If this is not first page - show that in page title |
|
| 67 | + */ |
|
| 68 | 68 | if ($page > 1) { |
| 69 | 69 | $Page->title($L->blogs_nav_page($page)); |
| 70 | 70 | } |
| 71 | 71 | /** |
| 72 | - * Get posts for current page in JSON-LD structure format |
|
| 73 | - */ |
|
| 72 | + * Get posts for current page in JSON-LD structure format |
|
| 73 | + */ |
|
| 74 | 74 | $posts_per_page = $Config->module('Blogs')->posts_per_page; |
| 75 | 75 | $posts = $Posts->get_for_section($section['id'], $page, $posts_per_page); |
| 76 | 76 | /** |
| 77 | - * Base url (without page number) |
|
| 78 | - */ |
|
| 77 | + * Base url (without page number) |
|
| 78 | + */ |
|
| 79 | 79 | $base_url = $Config->base_url().'/'.path($L->Blogs).'/'.path($L->section)."/$section[full_path]"; |
| 80 | 80 | /** |
| 81 | - * Render posts page |
|
| 82 | - */ |
|
| 81 | + * Render posts page |
|
| 82 | + */ |
|
| 83 | 83 | Helpers::show_posts_list( |
| 84 | 84 | $posts, |
| 85 | 85 | $section['posts'], |
@@ -1,11 +1,11 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @package Blogs |
|
| 4 | - * @category modules |
|
| 5 | - * @author Nazar Mokrynskyi <[email protected]> |
|
| 6 | - * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi |
|
| 7 | - * @license MIT License, see license.txt |
|
| 8 | - */ |
|
| 3 | + * @package Blogs |
|
| 4 | + * @category modules |
|
| 5 | + * @author Nazar Mokrynskyi <[email protected]> |
|
| 6 | + * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi |
|
| 7 | + * @license MIT License, see license.txt |
|
| 8 | + */ |
|
| 9 | 9 | namespace cs\modules\Blogs; |
| 10 | 10 | use |
| 11 | 11 | cs\Config, |
@@ -27,61 +27,61 @@ discard block |
||
| 27 | 27 | $Tags = Tags::instance(); |
| 28 | 28 | $Route = Route::instance(); |
| 29 | 29 | /** |
| 30 | - * If no tag specified |
|
| 31 | - */ |
|
| 30 | + * If no tag specified |
|
| 31 | + */ |
|
| 32 | 32 | if (!isset($Route->route[1])) { |
| 33 | 33 | throw new ExitException(404); |
| 34 | 34 | } |
| 35 | 35 | /** |
| 36 | - * Find tag |
|
| 37 | - */ |
|
| 36 | + * Find tag |
|
| 37 | + */ |
|
| 38 | 38 | $tag = $Tags->get_by_text($Route->route[1]); |
| 39 | 39 | if (!$tag) { |
| 40 | 40 | throw new ExitException(404); |
| 41 | 41 | } |
| 42 | 42 | $tag = $Tags->get($tag); |
| 43 | 43 | /** |
| 44 | - * Add tag to page title |
|
| 45 | - */ |
|
| 44 | + * Add tag to page title |
|
| 45 | + */ |
|
| 46 | 46 | $Page |
| 47 | 47 | ->title($tag['text']); |
| 48 | 48 | /** |
| 49 | - * Now add link to Atom feed for posts with current tag only |
|
| 50 | - */ |
|
| 49 | + * Now add link to Atom feed for posts with current tag only |
|
| 50 | + */ |
|
| 51 | 51 | $Page->atom( |
| 52 | 52 | "Blogs/atom.xml/?tag=$tag[id]", |
| 53 | 53 | implode($Config->core['title_delimiter'], [$L->latest_posts, $L->tag, $tag['text']]) |
| 54 | 54 | ); |
| 55 | 55 | /** |
| 56 | - * Set page of blog type (Open Graph protocol) |
|
| 57 | - */ |
|
| 56 | + * Set page of blog type (Open Graph protocol) |
|
| 57 | + */ |
|
| 58 | 58 | $Meta->blog(); |
| 59 | 59 | /** |
| 60 | - * Determine current page |
|
| 61 | - */ |
|
| 60 | + * Determine current page |
|
| 61 | + */ |
|
| 62 | 62 | $page = max( |
| 63 | 63 | isset($Route->route[2]) ? $Route->route[2] : 1, |
| 64 | 64 | 1 |
| 65 | 65 | ); |
| 66 | 66 | /** |
| 67 | - * If this is not first page - show that in page title |
|
| 68 | - */ |
|
| 67 | + * If this is not first page - show that in page title |
|
| 68 | + */ |
|
| 69 | 69 | if ($page > 1) { |
| 70 | 70 | $Page->title($L->blogs_nav_page($page)); |
| 71 | 71 | } |
| 72 | 72 | /** |
| 73 | - * Get posts for current page in JSON-LD structure format |
|
| 74 | - */ |
|
| 73 | + * Get posts for current page in JSON-LD structure format |
|
| 74 | + */ |
|
| 75 | 75 | $posts_per_page = $Config->module('Blogs')->posts_per_page; |
| 76 | 76 | $posts = $Posts->get_for_tag($tag['id'], $L->clang, $page, $posts_per_page); |
| 77 | 77 | $posts_count = $Posts->get_for_tag_count($tag['id'], $L->clang); |
| 78 | 78 | /** |
| 79 | - * Base url (without page number) |
|
| 80 | - */ |
|
| 79 | + * Base url (without page number) |
|
| 80 | + */ |
|
| 81 | 81 | $base_url = $Config->base_url().'/'.path($L->Blogs).'/'.path($L->tag).'/'.$Route->route[1]; |
| 82 | 82 | /** |
| 83 | - * Render posts page |
|
| 84 | - */ |
|
| 83 | + * Render posts page |
|
| 84 | + */ |
|
| 85 | 85 | Helpers::show_posts_list( |
| 86 | 86 | $posts, |
| 87 | 87 | $posts_count, |
@@ -1,11 +1,11 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @package Blogs |
|
| 4 | - * @category modules |
|
| 5 | - * @author Nazar Mokrynskyi <[email protected]> |
|
| 6 | - * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi |
|
| 7 | - * @license MIT License, see license.txt |
|
| 8 | - */ |
|
| 3 | + * @package Blogs |
|
| 4 | + * @category modules |
|
| 5 | + * @author Nazar Mokrynskyi <[email protected]> |
|
| 6 | + * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi |
|
| 7 | + * @license MIT License, see license.txt |
|
| 8 | + */ |
|
| 9 | 9 | namespace cs\modules\Blogs; |
| 10 | 10 | use |
| 11 | 11 | cs\Config, |
@@ -25,42 +25,42 @@ discard block |
||
| 25 | 25 | $Posts = Posts::instance(); |
| 26 | 26 | $Route = Route::instance(); |
| 27 | 27 | /** |
| 28 | - * Page title |
|
| 29 | - */ |
|
| 28 | + * Page title |
|
| 29 | + */ |
|
| 30 | 30 | $Page->title($L->latest_posts); |
| 31 | 31 | /** |
| 32 | - * Now add link to Atom feed for latest posts |
|
| 33 | - */ |
|
| 32 | + * Now add link to Atom feed for latest posts |
|
| 33 | + */ |
|
| 34 | 34 | $Page->atom('Blogs/atom.xml', $L->latest_posts); |
| 35 | 35 | /** |
| 36 | - * Set page of blog type (Open Graph protocol) |
|
| 37 | - */ |
|
| 36 | + * Set page of blog type (Open Graph protocol) |
|
| 37 | + */ |
|
| 38 | 38 | $Meta->blog(); |
| 39 | 39 | /** |
| 40 | - * Determine current page |
|
| 41 | - */ |
|
| 40 | + * Determine current page |
|
| 41 | + */ |
|
| 42 | 42 | $page = max( |
| 43 | 43 | isset($Route->ids[0]) ? array_slice($Route->ids, -1)[0] : 1, |
| 44 | 44 | 1 |
| 45 | 45 | ); |
| 46 | 46 | /** |
| 47 | - * If this is not first page - show that in page title |
|
| 48 | - */ |
|
| 47 | + * If this is not first page - show that in page title |
|
| 48 | + */ |
|
| 49 | 49 | if ($page > 1) { |
| 50 | 50 | $Page->title($L->blogs_nav_page($page)); |
| 51 | 51 | } |
| 52 | 52 | /** |
| 53 | - * Get posts for current page in JSON-LD structure format |
|
| 54 | - */ |
|
| 53 | + * Get posts for current page in JSON-LD structure format |
|
| 54 | + */ |
|
| 55 | 55 | $posts_per_page = $Config->module('Blogs')->posts_per_page; |
| 56 | 56 | $posts = $Posts->get_latest_posts($page, $posts_per_page); |
| 57 | 57 | /** |
| 58 | - * Base url (without page number) |
|
| 59 | - */ |
|
| 58 | + * Base url (without page number) |
|
| 59 | + */ |
|
| 60 | 60 | $base_url = $Config->base_url().'/'.path($L->Blogs).'/'.path($L->latest_posts); |
| 61 | 61 | /** |
| 62 | - * Render posts page |
|
| 63 | - */ |
|
| 62 | + * Render posts page |
|
| 63 | + */ |
|
| 64 | 64 | Helpers::show_posts_list( |
| 65 | 65 | $posts, |
| 66 | 66 | $Posts->get_total_count(), |
@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @package Blogs |
|
| 4 | - * @category modules |
|
| 5 | - * @author Nazar Mokrynskyi <[email protected]> |
|
| 6 | - * @copyright Copyright (c) 2015-2016, Nazar Mokrynskyi |
|
| 7 | - * @license MIT License, see license.txt |
|
| 8 | - */ |
|
| 3 | + * @package Blogs |
|
| 4 | + * @category modules |
|
| 5 | + * @author Nazar Mokrynskyi <[email protected]> |
|
| 6 | + * @copyright Copyright (c) 2015-2016, Nazar Mokrynskyi |
|
| 7 | + * @license MIT License, see license.txt |
|
| 8 | + */ |
|
| 9 | 9 | namespace cs\modules\Blogs; |
| 10 | 10 | use |
| 11 | 11 | h, |
@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @package Blogs |
|
| 4 | - * @category modules |
|
| 5 | - * @author Nazar Mokrynskyi <[email protected]> |
|
| 6 | - * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi |
|
| 7 | - * @license MIT License, see license.txt |
|
| 8 | - */ |
|
| 3 | + * @package Blogs |
|
| 4 | + * @category modules |
|
| 5 | + * @author Nazar Mokrynskyi <[email protected]> |
|
| 6 | + * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi |
|
| 7 | + * @license MIT License, see license.txt |
|
| 8 | + */ |
|
| 9 | 9 | namespace cs\modules\Blogs; |
| 10 | 10 | use |
| 11 | 11 | cs\Language; |
@@ -1,11 +1,11 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @package Blogs |
|
| 4 | - * @category modules |
|
| 5 | - * @author Nazar Mokrynskyi <[email protected]> |
|
| 6 | - * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi |
|
| 7 | - * @license MIT License, see license.txt |
|
| 8 | - */ |
|
| 3 | + * @package Blogs |
|
| 4 | + * @category modules |
|
| 5 | + * @author Nazar Mokrynskyi <[email protected]> |
|
| 6 | + * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi |
|
| 7 | + * @license MIT License, see license.txt |
|
| 8 | + */ |
|
| 9 | 9 | namespace cs\modules\Blogs; |
| 10 | 10 | use |
| 11 | 11 | cs\Config, |
@@ -26,31 +26,31 @@ discard block |
||
| 26 | 26 | $User = User::instance(); |
| 27 | 27 | $Page->title($L->drafts); |
| 28 | 28 | /** |
| 29 | - * Determine current page |
|
| 30 | - */ |
|
| 29 | + * Determine current page |
|
| 30 | + */ |
|
| 31 | 31 | $page = max( |
| 32 | 32 | isset($Route->ids[0]) ? array_slice($Route->ids, -1)[0] : 1, |
| 33 | 33 | 1 |
| 34 | 34 | ); |
| 35 | 35 | /** |
| 36 | - * If this is not first page - show that in page title |
|
| 37 | - */ |
|
| 36 | + * If this is not first page - show that in page title |
|
| 37 | + */ |
|
| 38 | 38 | if ($page > 1) { |
| 39 | 39 | $Page->title($L->blogs_nav_page($page)); |
| 40 | 40 | } |
| 41 | 41 | /** |
| 42 | - * Get posts for current page in JSON-LD structure format |
|
| 43 | - */ |
|
| 42 | + * Get posts for current page in JSON-LD structure format |
|
| 43 | + */ |
|
| 44 | 44 | $posts_per_page = $Config->module('Blogs')->posts_per_page; |
| 45 | 45 | $posts = $Posts->get_drafts($User->id, $page, $posts_per_page); |
| 46 | 46 | $posts_count = $Posts->get_drafts_count($User->id); |
| 47 | 47 | /** |
| 48 | - * Base url (without page number) |
|
| 49 | - */ |
|
| 48 | + * Base url (without page number) |
|
| 49 | + */ |
|
| 50 | 50 | $base_url = $Config->base_url().'/'.path($L->Blogs).'/'.path($L->drafts); |
| 51 | 51 | /** |
| 52 | - * Render posts page |
|
| 53 | - */ |
|
| 52 | + * Render posts page |
|
| 53 | + */ |
|
| 54 | 54 | Helpers::show_posts_list( |
| 55 | 55 | $posts, |
| 56 | 56 | $posts_count, |
@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @package Json_ld |
|
| 4 | - * @category plugins |
|
| 5 | - * @author Nazar Mokrynskyi <[email protected]> |
|
| 6 | - * @copyright Copyright (c) 2015-2016, Nazar Mokrynskyi |
|
| 7 | - * @license MIT License, see license.txt |
|
| 8 | - */ |
|
| 3 | + * @package Json_ld |
|
| 4 | + * @category plugins |
|
| 5 | + * @author Nazar Mokrynskyi <[email protected]> |
|
| 6 | + * @copyright Copyright (c) 2015-2016, Nazar Mokrynskyi |
|
| 7 | + * @license MIT License, see license.txt |
|
| 8 | + */ |
|
| 9 | 9 | |
| 10 | 10 | namespace cs\plugins\Json_ld; |
| 11 | 11 | use |
@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @package Composer assets |
|
| 4 | - * @category plugins |
|
| 5 | - * @author Nazar Mokrynskyi <[email protected]> |
|
| 6 | - * @copyright Copyright (c) 2015-2016, Nazar Mokrynskyi |
|
| 7 | - * @license MIT License, see license.txt |
|
| 8 | - */ |
|
| 3 | + * @package Composer assets |
|
| 4 | + * @category plugins |
|
| 5 | + * @author Nazar Mokrynskyi <[email protected]> |
|
| 6 | + * @copyright Copyright (c) 2015-2016, Nazar Mokrynskyi |
|
| 7 | + * @license MIT License, see license.txt |
|
| 8 | + */ |
|
| 9 | 9 | namespace cs\plugins\Composer_assets; |
| 10 | 10 | use |
| 11 | 11 | Exception, |
@@ -88,7 +88,7 @@ |
||
| 88 | 88 | <FilesMatch "\.css$"> |
| 89 | 89 | Header set Content-Type text/css |
| 90 | 90 | </FilesMatch> |
| 91 | -HTACCESS |
|
| 91 | +htaccess |
|
| 92 | 92 | ); |
| 93 | 93 | } |
| 94 | 94 | foreach ($files as $file) { |