Here is widget to managermanager that shows images like ShowImageTVs plugin. As in plugin i can’t to find way to trigger the action when value of TV changes defore save, so i simply add button that may be clicked to show just selected image.
Parameters like in many others MM functions.
function mm_widget_tvimage($fields, $roles='', $templates='') {
global $modx, $mm_fields, $_style;
$e = &$modx->Event;
if (useThisRule($roles, $templates)) {
$fields = makeArray($fields);
$icon = str_replace("\"","'",$_style["refresh_tree"]);
foreach ($fields as $field)
{
$output .='
imgURL = $("input[@name=tv'.$field.']").val();
if (imgURL.substr(4)!="http" && imgURL.substr(1)!="/") imgURL = "'.$modx->config['site_url'].'" + imgURL;
$("input[@name=tv'.$field.']").parents("td").append(\'<div class="tvimage"><img class="tvimage" id="tvimage'.$field.'" src="\' + imgURL + \' /></div>\');
$("input[@name=tv'.$field.']").parents("td").prepend("<span style=\'cursor:pointer;\' id=\'span'.$field.'\'>'.$icon.'</span>");
$(document).ready(function(){
$("#span'.$field.']").click(function (){
imgURL = $("input[@name=tv'.$field.']").val();
if (imgURL.substr(0,4)!="http" && imgURL.substr(0,1)!="/") imgURL = "'.$modx->config['site_url'].'" + imgURL;
$("#tvimage'.$field.'").attr("src",imgURL);
});
});
';
}
}
$e->output($output . "\n");
}
DirectResize 0.9 beta. PHPThumb, sets of configurations, configuration, binded to specific path. No backward compatibility. |
DirectResize 0.9. PHPThumb, наборы параметров, параметры, привязанные к определенным путям. Без обратной совместимости.
Unfortunately, DirectResize project is closed. If you want to continue development, PM me for access to project page on Google Code. К сожалению, проект DirectResize закрыт. Если вы желаете продолжить разработки, обращайтесь через ПМ для получения доступа к репозиторию на Google Code.
[PLUGIN] DirectResize - as Maxigallery but for single images ::
Download :: [url=
http://modxcms.com/forums/index.php/topic,21490]
Hey Metaller, I am just building something similar this morning! I’ll take a look and see if I can incorporate. Thanks
New version I am working on has externalised all the widgets so it is easy to modify/add them.
Author:
ManagerManager plugin - customise your ModX manager interface
Rckt - web development, Sheffield, UK
@chrisR i tested it only in FF so may be it not working good in other browsers. But where are waiting for new version from Nick.
@ncrossland Great to hear. I have some ideas about new widget to make tabular data input. Something like this (now it is use some core hacking, what is not good)
DirectResize 0.9 beta. PHPThumb, sets of configurations, configuration, binded to specific path. No backward compatibility. |
DirectResize 0.9. PHPThumb, наборы параметров, параметры, привязанные к определенным путям. Без обратной совместимости.
Unfortunately, DirectResize project is closed. If you want to continue development, PM me for access to project page on Google Code. К сожалению, проект DirectResize закрыт. Если вы желаете продолжить разработки, обращайтесь через ПМ для получения доступа к репозиторию на Google Code.
[PLUGIN] DirectResize - as Maxigallery but for single images ::
Download :: [url=
http://modxcms.com/forums/index.php/topic,21490]
Metaller,
I’ve been working on something like this too (tabular data). How have you done it? Mine was a jquery popup and serialize the data.
@ProWebscape Yes, i use jQuery for creating inteface, data serialized and stored as simple text TV. On the frontend this data fetched with simpe script and render with Data Grid widget (but i think to use something else).
DirectResize 0.9 beta. PHPThumb, sets of configurations, configuration, binded to specific path. No backward compatibility. |
DirectResize 0.9. PHPThumb, наборы параметров, параметры, привязанные к определенным путям. Без обратной совместимости.
Unfortunately, DirectResize project is closed. If you want to continue development, PM me for access to project page on Google Code. К сожалению, проект DirectResize закрыт. Если вы желаете продолжить разработки, обращайтесь через ПМ для получения доступа к репозиторию на Google Code.
[PLUGIN] DirectResize - as Maxigallery but for single images ::
Download :: [url=
http://modxcms.com/forums/index.php/topic,21490]
My showimagestv replacement I’ve written works (I think) better than the real thing -- it doesn’t need to continuously poll the field for changes every second, so reduces the overhead of using it. It is also more efficient in that it only selects the appropriate TVs at the SQL stage, rather than going through the DOM for every one (regardless of if it’s used on that template or not).
The new structure I’ve done for 0.3 means you can easily include a tabular data widget without hacking the ManagerManager core.
So far, it has improvements to the Tags widget, and also has the Image Preview and a Color picker widget. I hope to have a version for you to test in the next couple of days.
Author:
ManagerManager plugin - customise your ModX manager interface
Rckt - web development, Sheffield, UK
Metaller,
That’s just awesome. Can I help test it out?
@ProWebscape Now it’s only an idea to make widget. I’m not start working on it yet. Thanks for your offer, i’m use it later.
DirectResize 0.9 beta. PHPThumb, sets of configurations, configuration, binded to specific path. No backward compatibility. |
DirectResize 0.9. PHPThumb, наборы параметров, параметры, привязанные к определенным путям. Без обратной совместимости.
Unfortunately, DirectResize project is closed. If you want to continue development, PM me for access to project page on Google Code. К сожалению, проект DirectResize закрыт. Если вы желаете продолжить разработки, обращайтесь через ПМ для получения доступа к репозиторию на Google Code.
[PLUGIN] DirectResize - as Maxigallery but for single images ::
Download :: [url=
http://modxcms.com/forums/index.php/topic,21490]
Metaller,
I have a working table version of this here:
http://modxcms.com/forums/index.php/topic,20802.msg159720.html#msg159720
Right now it just POSTS, it doesn’t serialize. But the table works well. I dont know where you’re at on your script, but we may be able to collaborate.
I am stuck. I dont know how to embed this into the manager, and the best way to hide the plain textarea.