We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28451
    • 46 Posts
    Steffen.Larsen Reply #71, 19 years ago
    I set the full path manually in the last line, now it works. I wonder why I can’t set it dynamically, though...

    Anyway, it works. Thankyou.
      • 19164
      • 1,215 Posts
      I made some improvements for myself, may be they will be helpful for someone else. I am using this version upgraded by laurentc.

      1. Hiding empty "Template variable" section for all (not only english) languages.

      In mm.inc.php in the beginning addх
      global $content,$default_template, $mm_current_page, $mm_fields, $_lang;

      Find at the end
      $("div.sectionHeader:contains(\'Template Variables\')").hide(); // This will only work for English
      and change to
      $("div.sectionHeader:contains(\''.$_lang["tmplvars"].'\')").hide();


      2. I move all of the rules in a separate file.

      Copy to plugin ManagerManager this
      // ManagerManager plugin v0.2.4
      // See readme.htm for licensing and installation instructions
      
      
      // The URL to the Jquery library. Leave blank and it will use the one available from jquery.com
      // or if you want more control, specify your own local copy (e.g. http://www.yoursite.com/assets/js/jquery.js)
      $js_url = '';
      
      
      
      // You don't need to change anything else from here
      // Get the main code
      $asset_path = $modx->config['rb_base_dir'].'plugins/managermanager/';
      include_once($asset_path.'mm.class.inc.php');
      $mm = new mm();
      
      ob_start();
      include ($asset_path.'mm.actions.php');
      $mm_actions = ob_get_contents();
      ob_end_clean();
      
      include($asset_path.'mm.inc.php');


      Create in plugins/managermanager file with name mm.actions.php and write you rules in it like this
      $mm->mm_hideFields('longtitle');
      $mm->mm_hideFields('menutitle');


      <?php ?> and \$ is no needed.

      3. If you have problem with titles encoding, better use htmlspecialchars($new_value) instead of htmlentities($new_value) in all mm.class.inc.php
        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]
        • 14807
        • 1 Posts
        Hi! Thanks for a great plug-in!

        I’m trying to add a case to uncheck the «Show in Menu»-choice, but can’t seem to get it working. I’ve tried doing it the same way as described earlier with the «cacheable»-choice.

        Here’s my code:
        case 'show_in_menu':
               			   if (useThisRule($roles, $templates)) {
                                $new_value = ($new_value=='') ? '0' :  $new_value;
                                $checked = ( $new_value=='0' ) ? '' : 'checked';
                                $output .= '$("input[@name=show_in_menu]").val("'.(int)$new_value.'"); '."\n";
                                $output .= '$("input[@name=hidemenucheck]").attr("checked","'.$checked.'"); '."\n";
                           }
               break;
        


        And here’s my call from the plug-in:
        mm_default('show_in_menu', '0', '', '4');


        It works like a charm when trying the same (as far as I can see) for cacheable, but my new documents always end up being shown in the menu.. Any ideas, anyone?

        (Sorry for being a noob, don’t know too much about PHP coding..)

        I’m running managermanager downloaded from the repository, and modx v. 0.9.6.

        Any help appreciated!

        EDIT: Typo in code
          • 7455
          • 2,204 Posts
          Does no one use ie7?

          I noticed some strange behavior when using IE IE7 all the moved tv’s (moved them to a tab) all looks good when I press the tab but when i move my mouse the fields are gone.
          In ff and IE6 it works flawless.

          does anyone else have the same experience?

          I have it on 3 instalations on 3 differend servers one running 0951 one 096 and 0961

            follow me on twitter: @dimmy01
            • 16879
            • 87 Posts
            Thanks for this - superb. It’ll make all that "Ignore that field it’s not important" stuff in user training sessions redundant. Good work!

            A couple of questions - the "Access Permissions" section - can this be hidden? Can the section names such as "Template Variables" or "Access Permissions" be changed?

            Dimmy - I’m testing in IE7 but not getting any errors.
              • 19164
              • 1,215 Posts
              Another improvment that may be helpful for someone.

              4. Additional parameter value for mm_hideTabs - "permissions" to hide Access permissions window. Use: mm_hideTabs("permissions"’)

              5. New function to hide selected templates in dropdown list (for example "(blank)" or something else)

              In mm.class.inc.php add to the end of file before }//fin class mm
                      function mm_HideTemplate($fields, $roles='', $templates='') {
                      	global  $modx;
                      	
                      	$e = &$modx->Event;
              
                      	if (!is_array($fields)) {
                      		$fields = $this->makeArray($fields);
                      	}
              
                      	if ($this->useThisRule($roles, $templates)) {
              
                      		foreach ($fields as $field) {
                      			$output .= '$("select#template option[@value='.$field.']").hide();';
                      		}
                      		$e->output($output . "\n");
                      	}
                      } 


              Using: $mm->mm_HideTemplate("0", "2"); - hide blank template row in dropdown list for role 2.

              6. New function to rename section headers (Document setting, Document content, Template Variables etc)

              In mm.class.inc.php add to the end of file before }//fin class mm
              		function mm_renameSection($oldtitle, $newtitle, $roles='', $templates='') {
              
                      	global $modx, $_lang;
                      	
                      	$e = &$modx->Event;
              
                      	if ($this->useThisRule($roles, $templates)) {
              
              			switch ($oldtitle) {
              				
              				case 'setting':
              					$output .= '$("div.sectionHeader:contains(\''.$_lang["document_setting"].'\')").empty().prepend("'.htmlspecialchars($newtitle).'");' . "\n";
              				break;	  
              				      				        				
              				case 'content':
              					$output .= '$("div.sectionHeader:contains(\''.$_lang["document_content"].'\')").empty().prepend("'.htmlspecialchars($newtitle).'");' . "\n";
              				break;	
              				
              				case 'templvars':
              					$output .= '$("div.sectionHeader:contains(\''.$_lang["settings_templvars"].'\')").empty().prepend("'.htmlspecialchars($newtitle).'");' . "\n";
              				break;	
              
              				case 'permissions':
              					$output .= '$("div.sectionHeader:contains(\''.$_lang["access_permissions"].'\')").empty().prepend("'.htmlspecialchars($newtitle).'");' . "\n";
              				break;	
              
              				default:
              					$output .= '$("div.sectionHeader:contains(\''.htmlspecialchars($oldtitle).'\')").empty().prepend("'.htmlspecialchars($newtitle).'");' . "\n";
              				break;
              				
              			}
                      				        		
                      	$e->output($output . "\n");
                      	}
                      }
              


              Using: $mm->mm_renameSection("Document setting","Main settings window") or $mm->mm_renameSection("content","New content title")

              First parameter posible values is "setting", "content", "templvars","permissions" or custom title
                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]
                • 19164
                • 1,215 Posts
                Small bug - there is no roles and template check in mm_default function.
                  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]
                  • 19164
                  • 1,215 Posts
                  7. New function to hide sections (Document setting, Document content, Template Variables, Access permissions).
                  In mm.class.inc.php add to the end of file before }//fin class mm
                  		function mm_hideSection($tabs, $roles='', $templates='') {
                  
                          	global $modx, $_lang;
                          	$e = &$modx->Event;
                  
                          	if (!is_array($tabs)) {
                          		$tabs = $this->makeArray($tabs);
                          	}
                  
                          	if ($this->useThisRule($roles, $templates)) {
                  
                          	$output = " // ----------- Hide sections -------------- \n";
                  
                          		foreach($tabs as $tab) {
                  
                          			switch ($tab) {
                          				
                          				case 'setting':
                          					$output .= '$("div.sectionHeader:contains(\''.$_lang["document_setting"].'\')").hide().next("div.sectionBody").hide();';
                          				break;	  
                          				      				        				
                          				case 'content':
                          					$output .= '$("div.sectionHeader:contains(\''.$_lang["document_content"].'\')").hide().next("div.sectionBody").hide();';
                          				break;	
                          				
                          				case 'templvars':
                          					$output .= '$("div.sectionHeader:contains(\''.$_lang["settings_templvars"].'\')").hide().next("div.sectionBody").hide();';
                          				break;	
                  
                          				case 'permissions':
                          					$output .= '$("div.sectionHeader:contains(\''.$_lang["access_permissions"].'\')").hide().next("div.sectionBody").hide();';
                          				break;	
                  
                          				default:
                  							$output .= '$("div.sectionHeader:contains(\''.htmlspecialchars($tab).'\')").hide().next("div.sectionBody").hide();';
                          				break;
                  						
                          			}
                          			$e->output($output . "\n");
                          		}
                          	}
                          } 


                  Using $mm->mm_hideSection(param, roles, templates), where param is "setting", "content", "templvars","permissions" to hide sections Document setting, Document content, Template Variables, Access permissions with standart title, or custom title to hide section if it title was changed by mm_renameSection function.
                    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]
                    • 19164
                    • 1,215 Posts
                    Plugin incorrectly defines the current template if template changing in dropdown list and page is reloading. So all template’s rules are working incorrect.

                    In mm.inc.php find
                    $mm_current_page['template'] = isset($content['template']) ? $content['template'] : $default_template;

                    change to
                    $mm_current_page['template'] = isset($_POST['template']) ? $_POST['template'] : isset($content['template']) ? $content['template'] : $default_template;
                      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]
                      • 4385
                      • 372 Posts
                      Quote from: PatrickSamphire at Oct 16, 2007, 04:25 AM

                      I just downloaded the most recent version of this and it’s taken me half an hour to realise that the version in the repository doesn’t have Rachael Black’s modification to avoid conflict with Mootools. Not sure how the repository versions get updated, but this would be a sensible update to add, otherwise people will keep hitting this problem.

                      I am still having a problem locating the "correct" version too! Some have a class, other don’t. Is there a copy with Metaller updates too?
                        DropboxUploader -- Upload files to a Dropbox account.
                        DIG -- Dynamic Image Generator
                        gus -- Google URL Shortener
                        makeQR -- Uses google chart api to make QR codes.
                        MODxTweeter -- Update your twitter status on publish.

                      This discussion is closed to further replies. Keep calm and carry on.