1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-08-04 12:17:42 +02:00

Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Awilum
2012-12-29 23:56:04 +02:00
4 changed files with 60 additions and 8 deletions

View File

@@ -3,5 +3,5 @@
/**
* Set meta generator
*/
Action::add('theme_header', 'setMetaGenerator');
Action::add('theme_meta', 'setMetaGenerator');
function setMetaGenerator() { echo '<meta name="generator" content="Powered by Monstra '.Core::VERSION.'" />'; }

View File

@@ -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'];
}
}

View File

@@ -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; ?>
@@ -91,3 +91,29 @@
<?php } } ?>
</tbody>
</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>

View File

@@ -8,6 +8,17 @@
<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); ?>
<?php Stylesheet::add('public/themes/default/css/default.css', 'frontend', 2); ?>