From f1b6128f22d5ccdf99a3feff4cad3f138b791aec Mon Sep 17 00:00:00 2001 From: Danang Probo Sayekti Date: Thu, 6 Aug 2015 21:34:13 +0700 Subject: [PATCH] Multi language tags --- system/admin/views/edit-audio.html.php | 5 ++++- system/admin/views/edit-image.html.php | 5 ++++- system/admin/views/edit-link.html.php | 5 ++++- system/admin/views/edit-post.html.php | 5 ++++- system/admin/views/edit-quote.html.php | 5 ++++- system/admin/views/edit-video.html.php | 6 +++++- 6 files changed, 25 insertions(+), 6 deletions(-) diff --git a/system/admin/views/edit-audio.html.php b/system/admin/views/edit-audio.html.php index 24cf467..220848b 100644 --- a/system/admin/views/edit-audio.html.php +++ b/system/admin/views/edit-audio.html.php @@ -8,6 +8,7 @@ if (isset($p->file)) { $content = file_get_contents($url); $oldtitle = get_content_tag('t', $content, 'Untitled'); $olddescription = get_content_tag('d', $content); +$oldtag = get_content_tag('tag', $content); $oldaudio = get_content_tag('audio', $content); $oldcontent = remove_html_comments($content); @@ -15,7 +16,9 @@ $dir = substr($url, 0, strrpos($url, '/')); $isdraft = explode('/', $dir); $oldurl = explode('_', $url); -$oldtag = $oldurl[1]; +if (empty($oldtag)) { + $oldtag = $oldurl[1]; +} $oldmd = str_replace('.md', '', $oldurl[2]); diff --git a/system/admin/views/edit-image.html.php b/system/admin/views/edit-image.html.php index b0a7bcd..6c7836a 100644 --- a/system/admin/views/edit-image.html.php +++ b/system/admin/views/edit-image.html.php @@ -8,6 +8,7 @@ if (isset($p->file)) { $content = file_get_contents($url); $oldtitle = get_content_tag('t', $content, 'Untitled'); $olddescription = get_content_tag('d', $content); +$oldtag = get_content_tag('tag', $content); $oldimage = get_content_tag('image', $content); $oldcontent = remove_html_comments($content); @@ -15,7 +16,9 @@ $dir = substr($url, 0, strrpos($url, '/')); $isdraft = explode('/', $dir); $oldurl = explode('_', $url); -$oldtag = $oldurl[1]; +if (empty($oldtag)) { + $oldtag = $oldurl[1]; +} $oldmd = str_replace('.md', '', $oldurl[2]); diff --git a/system/admin/views/edit-link.html.php b/system/admin/views/edit-link.html.php index 5de2820..af06c09 100644 --- a/system/admin/views/edit-link.html.php +++ b/system/admin/views/edit-link.html.php @@ -8,6 +8,7 @@ if (isset($p->file)) { $content = file_get_contents($url); $oldtitle = get_content_tag('t', $content, 'Untitled'); $olddescription = get_content_tag('d', $content); +$oldtag = get_content_tag('tag', $content); $oldlink = get_content_tag('link', $content); $oldcontent = remove_html_comments($content); @@ -15,7 +16,9 @@ $dir = substr($url, 0, strrpos($url, '/')); $isdraft = explode('/', $dir); $oldurl = explode('_', $url); -$oldtag = $oldurl[1]; +if (empty($oldtag)) { + $oldtag = $oldurl[1]; +} $oldmd = str_replace('.md', '', $oldurl[2]); diff --git a/system/admin/views/edit-post.html.php b/system/admin/views/edit-post.html.php index ee2c98c..48f2e61 100644 --- a/system/admin/views/edit-post.html.php +++ b/system/admin/views/edit-post.html.php @@ -8,13 +8,16 @@ if (isset($p->file)) { $content = file_get_contents($url); $oldtitle = get_content_tag('t', $content, 'Untitled'); $olddescription = get_content_tag('d', $content); +$oldtag = get_content_tag('tag', $content); $oldcontent = remove_html_comments($content); $dir = substr($url, 0, strrpos($url, '/')); $isdraft = explode('/', $dir); $oldurl = explode('_', $url); -$oldtag = $oldurl[1]; +if (empty($oldtag)) { + $oldtag = $oldurl[1]; +} $oldmd = str_replace('.md', '', $oldurl[2]); diff --git a/system/admin/views/edit-quote.html.php b/system/admin/views/edit-quote.html.php index 42e82bf..7609f29 100644 --- a/system/admin/views/edit-quote.html.php +++ b/system/admin/views/edit-quote.html.php @@ -8,6 +8,7 @@ if (isset($p->file)) { $content = file_get_contents($url); $oldtitle = get_content_tag('t', $content, 'Untitled'); $olddescription = get_content_tag('d', $content); +$oldtag = get_content_tag('tag', $content); $oldquote = get_content_tag('quote', $content); $oldcontent = remove_html_comments($content); @@ -15,7 +16,9 @@ $dir = substr($url, 0, strrpos($url, '/')); $isdraft = explode('/', $dir); $oldurl = explode('_', $url); -$oldtag = $oldurl[1]; +if (empty($oldtag)) { + $oldtag = $oldurl[1]; +} $oldmd = str_replace('.md', '', $oldurl[2]); diff --git a/system/admin/views/edit-video.html.php b/system/admin/views/edit-video.html.php index c2eb4d5..15dcb0f 100644 --- a/system/admin/views/edit-video.html.php +++ b/system/admin/views/edit-video.html.php @@ -8,6 +8,7 @@ if (isset($p->file)) { $content = file_get_contents($url); $oldtitle = get_content_tag('t', $content, 'Untitled'); $olddescription = get_content_tag('d', $content); +$oldtag = get_content_tag('tag', $content); $oldvideo = get_content_tag('video', $content); $oldcontent = remove_html_comments($content); @@ -15,7 +16,10 @@ $dir = substr($url, 0, strrpos($url, '/')); $isdraft = explode('/', $dir); $oldurl = explode('_', $url); -$oldtag = $oldurl[1]; +if (empty($oldtag)) { + $oldtag = $oldurl[1]; +} + $oldmd = str_replace('.md', '', $oldurl[2]);