mirror of
https://github.com/monstra-cms/monstra.git
synced 2025-08-04 04:07:59 +02:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -3,5 +3,5 @@
|
||||
/**
|
||||
* Set meta generator
|
||||
*/
|
||||
Action::add('theme_header', 'setMetaGenerator');
|
||||
function setMetaGenerator() { echo '<meta name="generator" content="Powered by Monstra '.Core::VERSION.'" />'; }
|
||||
Action::add('theme_meta', 'setMetaGenerator');
|
||||
function setMetaGenerator() { echo '<meta name="generator" content="Powered by Monstra '.Core::VERSION.'" />'; }
|
||||
|
@@ -93,7 +93,7 @@
|
||||
* @return string
|
||||
*/
|
||||
public static function find($url) {
|
||||
$https = (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') ? 'https://' : 'http://';
|
||||
$https = (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') ? 'https://' : 'http://';
|
||||
$pos = strpos($url, $https);
|
||||
if ($pos === false) { $url_output = Option::get('siteurl') . $url; } else { $url_output = $url; }
|
||||
return $url_output;
|
||||
@@ -110,7 +110,22 @@
|
||||
* @return string
|
||||
*/
|
||||
public static function base() {
|
||||
$https = (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') ? 'https://' : 'http://';
|
||||
$https = (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') ? 'https://' : 'http://';
|
||||
return $https . rtrim(rtrim($_SERVER['HTTP_HOST'], '\\/') . dirname($_SERVER['PHP_SELF']), '\\/');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets current URL
|
||||
*
|
||||
* <code>
|
||||
* echo Url::current();
|
||||
* </code>
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function current() {
|
||||
return (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -70,8 +70,8 @@
|
||||
<?php if (isset($files_list)) foreach ($files_list as $file) { $ext = File::ext($file); ?>
|
||||
<?php if ( ! in_array($ext, $forbidden_types)) { ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo Html::anchor(File::name($file), $site_url.'public' . DS .$path.$file, array('target'=>'_blank'));?>
|
||||
<td<?php if (isset(File::$mime_types[$ext]) && preg_match('/image/', File::$mime_types[$ext])) echo ' class="image"'?>>
|
||||
<?php echo Html::anchor(File::name($file), $site_url.'public/' . $path.$file, array('target'=>'_blank'));?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $ext; ?>
|
||||
@@ -90,4 +90,30 @@
|
||||
</tr>
|
||||
<?php } } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</table>
|
||||
|
||||
<div class="modal hide" id="showImage">
|
||||
<div class="modal-header">
|
||||
<a class="close" data-dismiss="modal">×</a>
|
||||
<h3><?php echo __('Image:', 'filesmanager')?> <span></span></h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p><img src=""/></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$('.image').find('a').on('click', function() {
|
||||
var src = $(this).attr('href');
|
||||
var file = $(src.split('/')).last();
|
||||
|
||||
var image = new Image();
|
||||
image.src = src;
|
||||
$(image).load(function() {
|
||||
$('#showImage').modal('show').css({width: image.width + 32, margin: '0 auto', left: 'auto'})
|
||||
.find('img').attr('src', src);
|
||||
$('#showImage').find('h3 span').text(file[0]);
|
||||
});
|
||||
return false;
|
||||
});
|
||||
</script>
|
||||
|
@@ -7,6 +7,17 @@
|
||||
<meta name="description" content="<?php echo Site::description(); ?>">
|
||||
<meta name="keywords" content="<?php echo Site::keywords(); ?>">
|
||||
<meta name="robots" content="<?php echo Page::robots(); ?>">
|
||||
|
||||
<?php Action::run('theme_meta'); ?>
|
||||
|
||||
<!-- Open Graph Protocol -->
|
||||
<meta property="og:site_name" content="<?php echo Site::name(); ?>">
|
||||
<meta property="og:url" content="<?php echo Url::current(); ?>">
|
||||
<meta property="og:title" content="<?php echo Site::title(); ?> | <?php echo Site::name(); ?>">
|
||||
|
||||
<!-- Google+ Snippets -->
|
||||
<meta itemprop="url" content="<?php echo Url::current(); ?>">
|
||||
<meta itemprop="name" content="<?php echo Site::title(); ?> | <?php echo Site::name(); ?>">
|
||||
|
||||
<!-- Styles -->
|
||||
<?php Stylesheet::add('public/assets/css/bootstrap.css', 'frontend', 1); ?>
|
||||
|
Reference in New Issue
Block a user