Tinymce changes on plugins, Dom Helper, changes on Clean Blog Theme
This commit is contained in:
parent
48d5c94dd1
commit
0ebee8526a
|
@ -199,6 +199,7 @@ include(PATH_HELPERS.'alert.class.php');
|
||||||
include(PATH_HELPERS.'paginator.class.php');
|
include(PATH_HELPERS.'paginator.class.php');
|
||||||
include(PATH_HELPERS.'image.class.php');
|
include(PATH_HELPERS.'image.class.php');
|
||||||
include(PATH_HELPERS.'tcp.class.php');
|
include(PATH_HELPERS.'tcp.class.php');
|
||||||
|
include(PATH_HELPERS.'dom.class.php');
|
||||||
|
|
||||||
if (file_exists(PATH_KERNEL.'bludit.pro.php')) {
|
if (file_exists(PATH_KERNEL.'bludit.pro.php')) {
|
||||||
include(PATH_KERNEL.'bludit.pro.php');
|
include(PATH_KERNEL.'bludit.pro.php');
|
||||||
|
|
|
@ -122,6 +122,10 @@ elseif ($Url->whereAmI()==='home') {
|
||||||
buildPagesForHome();
|
buildPagesForHome();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($pages[0])) {
|
||||||
|
$page = $Page = $pages[0];
|
||||||
|
}
|
||||||
|
|
||||||
// Set page 404 not found
|
// Set page 404 not found
|
||||||
if ($Url->notFound()) {
|
if ($Url->notFound()) {
|
||||||
$pageNotFoundKey = $Site->pageNotFound();
|
$pageNotFoundKey = $Site->pageNotFound();
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
<?php defined('BLUDIT') or die('Bludit CMS.');
|
||||||
|
|
||||||
|
class DOM {
|
||||||
|
|
||||||
|
public static function getFirstImage($content)
|
||||||
|
{
|
||||||
|
$dom = new DOMDocument();
|
||||||
|
$dom->loadHTML('<meta http-equiv="content-type" content="text/html; charset=utf-8">'.$content);
|
||||||
|
$finder = new DomXPath($dom);
|
||||||
|
|
||||||
|
$images = $finder->query("//img");
|
||||||
|
|
||||||
|
if($images->length>0) {
|
||||||
|
// First image from the list
|
||||||
|
$image = $images->item(0);
|
||||||
|
// Get value from attribute src
|
||||||
|
$imgSrc = $image->getAttribute('src');
|
||||||
|
// Returns the image src
|
||||||
|
return $imgSrc;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -89,7 +89,7 @@ class pluginLinks extends Plugin {
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
$html .= '<div>';
|
$html .= '<div>';
|
||||||
$html .= '<button name="addLink" class="blue" type="submit">Add</button>';
|
$html .= '<button name="addLink" class="blue" type="submit">'.$Language->get('Add').'</button>';
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
$html .= '<legend>'.$Language->get('Links').'</legend>';
|
$html .= '<legend>'.$Language->get('Links').'</legend>';
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
"plugin-data":
|
"plugin-data":
|
||||||
{
|
{
|
||||||
"name": "RSS Feed",
|
"name": "RSS Feed",
|
||||||
"description": "This plugin generates an RSS feed of your site. The feed has the URL http://mydomain.com/rss.xml."
|
"description": "This plugin generates an RSS feed of your site.<br>The feed has the URL https://example.com/rss.xml"
|
||||||
},
|
},
|
||||||
"amount-of-items-to-show-on-the-feed": "Amount of items to show on the feed."
|
"amount-of-items-to-show-on-the-feed": "Amount of items to show on the feed.",
|
||||||
|
"rss-url": "RSS URL"
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
"plugin-data":
|
"plugin-data":
|
||||||
{
|
{
|
||||||
"name": "RSS Feed",
|
"name": "RSS Feed",
|
||||||
"description": "Este plugin genera contenido dinamico en formato RSS de tu sitio."
|
"description": "Este plugin genera contenido dinamico en formato RSS de tu sitio.<br>El plugin genera la URL https://example.com/rss.xml"
|
||||||
},
|
},
|
||||||
"amount-of-items-to-show-on-the-feed": "Cantidad de artículos para mostrar."
|
"amount-of-items-to-show-on-the-feed": "Cantidad de artículos para mostrar.",
|
||||||
|
"rss-url": "URL del RSS"
|
||||||
}
|
}
|
|
@ -16,6 +16,11 @@ class pluginRSS extends Plugin {
|
||||||
global $Language;
|
global $Language;
|
||||||
|
|
||||||
$html = '<div>';
|
$html = '<div>';
|
||||||
|
$html .= '<label>'.$Language->get('RSS URL').'</label>';
|
||||||
|
$html .= '<a href="'.Theme::rssUrl().'">'.Theme::rssUrl().'</a>';
|
||||||
|
$html .= '</div>';
|
||||||
|
|
||||||
|
$html .= '<div>';
|
||||||
$html .= '<label>'.$Language->get('Amount of items').'</label>';
|
$html .= '<label>'.$Language->get('Amount of items').'</label>';
|
||||||
$html .= '<input id="jsamountOfItems" name="amountOfItems" type="text" value="'.$this->getValue('amountOfItems').'">';
|
$html .= '<input id="jsamountOfItems" name="amountOfItems" type="text" value="'.$this->getValue('amountOfItems').'">';
|
||||||
$html .= '<span class="tip">'.$Language->get('Amount of items to show on the feed').'</span>';
|
$html .= '<span class="tip">'.$Language->get('Amount of items to show on the feed').'</span>';
|
||||||
|
|
|
@ -43,7 +43,7 @@ class pluginTinymce extends Plugin {
|
||||||
paste_as_text: true,
|
paste_as_text: true,
|
||||||
document_base_url: "'.DOMAIN_UPLOADS.'",
|
document_base_url: "'.DOMAIN_UPLOADS.'",
|
||||||
plugins: [
|
plugins: [
|
||||||
"autosave fullpage",
|
"autosave",
|
||||||
"searchreplace autolink directionality",
|
"searchreplace autolink directionality",
|
||||||
"visualblocks visualchars",
|
"visualblocks visualchars",
|
||||||
"fullscreen image link media template",
|
"fullscreen image link media template",
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?php
|
||||||
|
/*
|
||||||
|
This file is loaded before the theme
|
||||||
|
You can add some configuration code in this file
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Background image
|
||||||
|
$backgroundImage = 'https://source.unsplash.com/1600x900/?nature';
|
||||||
|
if ($page->coverImage()===false) {
|
||||||
|
$domImage = DOM::getFirstImage($page->content($fullContent=true));
|
||||||
|
if ($domImage!==false) {
|
||||||
|
$backgroundImage = $domImage;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$backgroundImage = $page->coverImage($absolute=true);
|
||||||
|
}
|
|
@ -3,5 +3,6 @@
|
||||||
{
|
{
|
||||||
"name": "Clean Blog",
|
"name": "Clean Blog",
|
||||||
"description": "Clean blog is a carefully styled Bootstrap blog theme that is perfect for personal or company blogs. This theme features four HTML pages including a blog index, an about page, a sample post, and a contact page."
|
"description": "Clean blog is a carefully styled Bootstrap blog theme that is perfect for personal or company blogs. This theme features four HTML pages including a blog index, an about page, a sample post, and a contact page."
|
||||||
}
|
},
|
||||||
|
"posted-by": "Posted by"
|
||||||
}
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
<!-- Page Header -->
|
<!-- Page Header -->
|
||||||
<header class="masthead" style="background-image: url('https://source.unsplash.com/1600x900/?nature')">
|
<header class="masthead" style="background-image: url('<?php echo $backgroundImage ?>')">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-8 col-md-10 mx-auto">
|
<div class="col-lg-8 col-md-10 mx-auto">
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
<h2 class="post-title"><?php echo $page->title() ?></h2>
|
<h2 class="post-title"><?php echo $page->title() ?></h2>
|
||||||
<h3 class="post-subtitle"><?php echo $page->description() ?></h3>
|
<h3 class="post-subtitle"><?php echo $page->description() ?></h3>
|
||||||
</a>
|
</a>
|
||||||
<p class="post-meta">Posted by <a href="#">Start Bootstrap</a> on September 18, 2017</p>
|
<p class="post-meta"><?php echo $Language->get('Posted by').' '.$page->user('username').' - '.$page->date() ?></p>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<!-- Page Header -->
|
<!-- Page Header -->
|
||||||
<header class="masthead" style="background-image: url('img/post-bg.jpg')">
|
<header class="masthead" style="background-image: url('<?php echo $backgroundImage ?>')">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-8 col-md-10 mx-auto">
|
<div class="col-lg-8 col-md-10 mx-auto">
|
||||||
<div class="post-heading">
|
<div class="post-heading">
|
||||||
<h1><?php echo $page->title() ?></h1>
|
<h1><?php echo $page->title() ?></h1>
|
||||||
<h2 class="subheading"><?php echo $page->description() ?></h2>
|
<h2 class="subheading"><?php echo $page->description() ?></h2>
|
||||||
<span class="meta">Posted by <a href="#">Start Bootstrap</a> on August 24, 2017</span>
|
<p class="meta"><?php echo $Language->get('Posted by').' '.$page->user('username').' - '.$page->date() ?></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue