diff --git a/ground/classes/Helper.php b/ground/classes/Helper.php
index 7859a6f..36ca757 100644
--- a/ground/classes/Helper.php
+++ b/ground/classes/Helper.php
@@ -53,7 +53,7 @@ class Helper
return $string;
}
- public static function replaceImgs($string, $replaceType = 'clear')
+ public static function replaceImgs($string, $replaceType = 'clear', $size = 'middle')
{
preg_match_all("(\[img[\|]#(\d+)\])", $string, $images);
$images = isset($images[0]) ? $images[0] : FALSE;
@@ -70,7 +70,7 @@ class Helper
switch ($replaceType) {
case 'html':
$imgObj->caption = $linkTitle = str_replace('"', 'ʺ', $imgObj->caption);
- $imgTag = '
';
+ $imgTag = '';
$string = str_replace($img, $imgTag, $string);
break;
default:
diff --git a/ground/controllers/ArticlesController.php b/ground/controllers/ArticlesController.php
index d317ea3..1b83f32 100644
--- a/ground/controllers/ArticlesController.php
+++ b/ground/controllers/ArticlesController.php
@@ -36,17 +36,19 @@ class ArticlesController extends Controller
$articleId = (int) App::getParam('id');
- self::$layout = 'layoutPage.php';
+ self::$layout = 'layoutClear.php';
self::addScript('/js/jquery-2.1.0.min.js');
self::addScript('/js/jquery-ui-1.10.4.custom.min.js');
self::addScript('/js/bootstrap.min.js');
self::addScript('/js/app.js?ver=' . App::getConfig('version'));
+ self::addScript('/js/articleEdit.js?ver=' . App::getConfig('version'));
self::addScript('http://cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.3/fotorama.js');
self::addStyle('/css/style.css?ver=' . App::getConfig('version'));
self::addStyle('/css/pageStyle.css?ver=' . App::getConfig('version'));
self::addStyle('/css/bootstrap.min.css');
self::addStyle('/css/bootstrap-theme.min.css');
self::addStyle('http://cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.3/fotorama.css');
+ self::addStyle('/css/articleEdit.css?ver=' . App::getConfig('version'));
$article = Article::model()->getByPK($articleId);
@@ -120,7 +122,7 @@ class ArticlesController extends Controller
}
}
- App::redirect('/articles');
+ App::redirect('/articles/edit/id/'.$article->id);
}
static function actionMarkdown()
@@ -131,7 +133,7 @@ class ArticlesController extends Controller
$html = Markdown::processing($html);
$html = nl2br($html);
$html = Helper::replaceLinks($html, 'html');
- $html = Helper::replaceImgs($html, 'html');
+ $html = Helper::replaceImgs($html, 'html', 'small');
print $html;
}
diff --git a/ground/views/articles/edit.php b/ground/views/articles/edit.php
index 6cf3e52..874d6dd 100644
--- a/ground/views/articles/edit.php
+++ b/ground/views/articles/edit.php
@@ -1,142 +1,67 @@
-
-
-
-
-
-
-
Редактирование статьи
-
-