Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

WF Image src urls set in wf_core.php - update tinymce insert too

  • Loading branch information...
commit 8a433271aedc669856734d0b715fe5e7808ed978 1 parent 4812de5
@majic3 majic3 authored
View
5 app/config/routes.php
@@ -36,8 +36,9 @@
// Image thumbnails
// @TODO shorten to '/i/*'
-Router::connect('/wildflower/thumbnail/*', array('controller' => 'assets', 'action' => 'thumbnail'));
-Router::connect('/wildflower/thumbnail_by_id/*', array('controller' => 'assets', 'action' => 'thumbnail_by_id'));
+$mprefix = Configure::read('Wildflower.mediaRoute');
+Router::connect('/'.$mprefix.'/thumbnail/*', array('controller' => 'assets', 'action' => 'thumbnail'));
+Router::connect('/'.$mprefix.'/thumbnail_by_id/*', array('controller' => 'assets', 'action' => 'thumbnail_by_id'));
// Search
Router::connect('/search', array('controller' => 'dashboards', 'action' => 'search'));
View
1  vendors/wf_core.php
@@ -22,6 +22,7 @@
'rootPageCache' => CACHE . 'wf_root_pages',
'previewCache' => CACHE . 'wf_previews',
'thumbnailsCache' => CACHE . 'wf_thumbnails',
+ 'mediaRoute' => 'i',
'postsParent' => 'p',
'blogIndex' => 'blog',
// Disabling the root page cache may be useful in debugging
View
4 wildflower/jlm/controllers/components/tiny_mce.js
@@ -102,10 +102,10 @@ $.jlm.addComponent('tinyMce', {
resizeHeight = resizeWidth;
}
if (intval(resizeHeight) > 1) {
- imgUrl = $.jlm.base + '/wildflower/thumbnail/' + imgNameEscaped + '/' + resizeWidth + '/' + resizeHeight + '/' + crop;
+ imgUrl = $.jlm.base + '/'+$.jlm.wildflowerMPreix+'/thumbnail/' + imgNameEscaped + '/' + resizeWidth + '/' + resizeHeight + '/' + crop;
}
- // Image HTML
+ // Image HTML - needs to handle class & alt
var imgHtml = '<img alt="' + imgName + '" src="' + imgUrl + '" />';
$.jlm.components.tinyMce.editor.execCommand('mceInsertContent', 0, imgHtml);
View
3  wildflower/views/assets/admin_edit.ctp
@@ -10,7 +10,8 @@ echo $navigation->create(array(
// If file is image display it fitting the wrap
$isImage = (strpos($this->data['Asset']['mime'], 'image') === 0);
if ($isImage) {
- echo $html->image("/wildflower/thumbnail/{$this->data['Asset']['name']}/600/1000"),
+ $mprefix = Configure::read('Wildflower.mediaRoute');
+ echo $html->image("/$mprefix/thumbnail/{$this->data['Asset']['name']}/600/1000"),
'<p class="image-resized-notice">This image is resized. ',
$html->link("View the original image.", '/uploads/' . $this->data['Asset']['name']),
'</p>';
View
6 wildflower/views/assets/admin_index.ctp
@@ -9,7 +9,9 @@
<?php echo $this->element('admin_select_actions'); ?>
<ul class="file-list list">
- <?php foreach ($files as $file): ?>
+ <?php
+ $mprefix = Configure::read('Wildflower.mediaRoute');
+ foreach ($files as $file): ?>
<li id="file-<?php echo $file['Asset']['id']; ?>" class="actions-handle">
<span class="row-check"><?php echo $form->checkbox('id.' . $file['Asset']['id']) ?></span>
@@ -21,7 +23,7 @@
?>
<a class="thumbnail" href="<?php echo $html->url(array('action' => 'edit', $file['Asset']['id'])); ?>">
- <img width="50" height="50" src="<?php echo $html->url("/wildflower/thumbnail/{$file['Asset']['name']}/50/50/1"); ?>" alt="<?php echo hsc($file['Asset']['title']); ?>" />
+ <img width="50" height="50" src="<?php echo $html->url("/$mprefix/thumbnail/{$file['Asset']['name']}/50/50/1"); ?>" alt="<?php echo hsc($file['Asset']['title']); ?>" />
</a>
<h3><?php echo $html->link($label, array('action' => 'edit', $file['Asset']['id'])); ?></h3>
View
15 wildflower/views/assets/admin_insert_image.ctp
@@ -6,11 +6,13 @@
<?php else: ?>
<ul class="file-list list">
- <?php foreach ($images as $file): ?>
+ <?php
+ $mprefix = Configure::read('Wildflower.mediaRoute');
+ foreach ($images as $file): ?>
<li id="file-<?php echo $file['Asset']['id']; ?>" class="actions-handle">
- <img class="thumbnail" width="50" height="50" src="<?php echo $html->url("/wildflower/thumbnail/{$file['Asset']['name']}/50/50/1"); ?>" alt="<?php echo $file['Asset']['name']; ?>" />
+ <img class="thumbnail" width="50" height="50" src="<?php echo $html->url("/$mprefix/thumbnail/{$file['Asset']['name']}/50/50/1"); ?>" alt="<?php echo $file['Asset']['name']; ?>" />
<h3><?php echo hsc($file['Asset']['name']); ?></h3>
@@ -28,9 +30,16 @@
<div id="resize_image">
<h5>Resize</h5>
- Width: <input type="text" id="resize_x" name="data[Resize][width]" size="4"> px&nbsp;&nbsp; Height: <input type="text" name="data[Resize][height]" id="resize_y" size="4"> px
+ Width: <input type="text" id="resize_x" name="data[Resize][width]" size="4"> px&nbsp;&nbsp; Height: <input type="text" name="data[Resize][height]" id="resize_y" size="4" /> px
</div>
+ <!-- div id="image_meta">
+ <h5>Alt</h5>
+ Alternative Text: <input type="text" id="meta_alt" name="data[Meta][alt]" size="75" />
+ <h5>Class</h5>
+ Class: <input type="text" name="data[Meta][class]" id="meta_class" size="4" />
+ </div -->
+
<span class="cleaner"></span>
<button id="insert_image">Insert selected image</button>
<span class="cleaner"></span>
View
3  wildflower/views/layouts/admin_default.ctp
@@ -38,7 +38,8 @@
action: '<?php echo $this->params['action'] ?>',
prefix: '<?php echo $prefix; ?>',
custom: {
- wildflowerUploads: '<?php echo Configure::read('Wildflower.uploadsDirectoryName'); ?>'
+ wildflowerUploads: '<?php echo Configure::read('Wildflower.uploadsDirectoryName'); ?>',
+ wildflowerMPreix: '<?php echo Configure::read('Wildflower.mediaRoute'); ?>'
}
});
View
3  wildflower/views/pages/admin_custom_fields.ctp
@@ -9,10 +9,11 @@
if (empty($customFields)) {
echo '<p>', __('This page has no custom fields defined.', true), '</p>';
} else {
+ $mprefix = Configure::read('Wildflower.mediaRoute');
foreach ($customFields as $field) {
echo $form->input($field['name'], array('type' => $field['type'], 'value' => $field['value'], 'between' => '<br />'));
if ($field['type'] == 'file' and !empty($field['value'])) {
- echo '<img width="80" height="80" src="', $html->url("/wildflower/thumbnail/{$field['value']}/80/80/1"), '" alt="" />';
+ echo '<img width="80" height="80" src="', $html->url("/$mprefix/thumbnail/{$field['value']}/80/80/1"), '" alt="" />';
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.