Skip to content
18 changes: 18 additions & 0 deletions assets/js/jquery-1.6.2.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion assets/plugins/managermanager/functions/fieldvalues.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ function mm_inherit($fields, $roles='', $templates='') {
// dbname $dbname
// newvalue $newvalue
";
$date_format = $modx->toDateFormat(null, 'formatOnly');

switch ($field) {

Expand All @@ -240,7 +241,7 @@ function mm_inherit($fields, $roles='', $templates='') {

case 'pub_date':
case 'unpub_date':
$output .= '$j("input[name='.$fieldname.']").val("'.date('d-m-Y H:i:s', $newvalue).'"); ';
$output .= '$j("input[name='.$fieldname.']").val("'.strftime($date_format . ' %H:%M:%S', $newvalue).'"); ';
break;

default:
Expand Down
2 changes: 1 addition & 1 deletion assets/plugins/managermanager/functions/templates.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function mm_hideTemplates($tplIds, $roles='', $templates='') {

foreach ($tplIds as $tpl) {
$output .= 'if ($j("select#template").val() != '.$tpl. ') { '. "\n";
$output .= '$j("select#template option[value='.$tpl.']").hide();' . "\n";
$output .= '$j("select#template option[value='.$tpl.']").remove();' . "\n";
$output .= '}' . "\n";
}
$e->output($output . "\n");
Expand Down
7 changes: 6 additions & 1 deletion assets/plugins/managermanager/mm.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@
// Set variables
global $content,$default_template, $mm_current_page, $mm_fields;
$mm_current_page = array();
$mm_current_page['template'] = isset($_POST['template']) ? $_POST['template'] : isset($content['template']) ? $content['template'] : $default_template;

if (isset($_POST['template'])) $mm_current_page['template'] = $_POST['template'];
elseif(isset($_GET['newtemplate'])) $mm_current_page['template'] = $_GET['newtemplate'];
elseif(isset($content['template'])) $mm_current_page['template'] = $content['template'];
else $mm_current_page['template'] = $default_template;

$mm_current_page['role'] = $_SESSION['mgrRole'];


Expand Down
4 changes: 2 additions & 2 deletions assets/plugins/managermanager/widgets/!template/!template.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ function mm_widget_template($fields, $other_param='defaultValue', $roles='', $te

// We have functions to include JS or CSS external files you might need
// The standard ModX API methods don't work here
$output .= includeJs('/assets/plugins/managermanager/widgets/template/javascript.js');
$output .= includeCss('/assets/plugins/managermanager/widgets/template/styles.css');
$output .= includeJs('assets/plugins/managermanager/widgets/template/javascript.js');
$output .= includeCss('assets/plugins/managermanager/widgets/template/styles.css');


// Do something for each of the fields supplied
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
width: 320px;
padding: 40px 20px 40px 100px;
border: 6px solid #AAA;
background: #FFF url(/assets/plugins/managermanager/widgets/accessdenied/alert.png) no-repeat 15px;
background: #FFF url(alert.png) no-repeat 15px;
}

#amessage SPAN{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ function mm_widget_showimagetvs($tvs='', $w=300, $h=100, $thumbnailerUrl='', $ro
// Get the new URL
var url = $j(this).val();
url = (url.substr(0,1) == "@") ? "" : url; // If an @ binding, do nothing
url = (url != "" && url.search(/http:\/\//i) == -1) ? ("'.$site.'" + url) : url;

';

Expand All @@ -80,7 +79,8 @@ function mm_widget_showimagetvs($tvs='', $w=300, $h=100, $thumbnailerUrl='', $ro
});
}

}); // Trigger a change event on load
$j.data(this,"lastvalue", $j(this).val());
}).trigger("load"); // Trigger a change event on load


';
Expand All @@ -95,7 +95,7 @@ function mm_widget_showimagetvs($tvs='', $w=300, $h=100, $thumbnailerUrl='', $ro
$j(".imageField").each( function() {
var $this = $j(this);
if ($this.val() != $this.data("lastvalue") ) {
$this.trigger("change").data("lastvalue", $this.val());
$this.trigger("change");
}
});
}
Expand Down
11 changes: 6 additions & 5 deletions plugin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@
* @category plugin
* @version 0.3.10dev
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL)
* @internal @properties &config_chunk=Configuration Chunk;text;mm_demo_rules; &remove_deprecated_tv_types_pref=Remove deprecated TV types;list;yes,no;yes &which_jquery=jQuery source;list;local (assets/js),remote (google code),manual url (specify below);local (assets/js) &js_src_type=jQuery URL override;text;
* @internal @properties &config_chunk=Configuration Chunk;text;mm_demo_rules; &remove_deprecated_tv_types_pref=Remove deprecated TV types;list;yes,no;yes &which_jquery=jQuery source;list;local (assets/js),remote (google code),manual url (specify below);local (assets/js) &js_src_override=jQuery URL override;text;
* @internal @events OnDocFormRender,OnDocFormPrerender,OnPluginFormRender,OnTVFormRender
* @internal @modx_category Manager and Admin
* @internal @legacy_names Image TV Preview, Show Image TVs
* @internal @installset base
*/

// You can put your ManagerManager rules EITHER in a chunk OR in an external file - whichever suits your development style the best

// To use an external file, put your rules in /assets/plugins/managermanager/mm_rules.inc.php
// To use an external file, put your rules in /assets/plugins/managermanager/mm_rules.inc.php
// (you can rename default.mm_rules.inc.php and use it as an example)
// The chunk SHOULD have php opening tags at the beginning and end

Expand All @@ -24,14 +25,14 @@
// The chunk should NOT have php tags at the beginning or end

// ManagerManager requires jQuery 1.3+
// The URL to the jQuery library. Choose from the configuration tab whether you want to use
// The URL to the jQuery library. Choose from the configuration tab whether you want to use
// a local copy (which defaults to the jQuery library distributed with ModX 1.0.1)
// a remote copy (which defaults to the Google Code hosted version)
// or specify a URL to a custom location.
// Here we set some default values, because this is a convenient place to change them if we need to,
// but you should configure your preference via the Configuration tab.
$js_default_url_local = $modx->config['site_url']. '/assets/js/jquery-1.4.4.min.js';
$js_default_url_remote = 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js';
$js_default_url_local = $modx->config['site_url']. 'assets/js/jquery-1.6.2.min.js';
$js_default_url_remote = 'http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js';

// You don't need to change anything else from here onwards
//-------------------------------------------------------
Expand Down