We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10313
    • 375 Posts
    @BnH: Do you see a scrollbar in the "manage pictures"-tab to scroll down to the following pictures?
      • 3689
      • 264 Posts
      Quote from: FuryDE at Feb 02, 2010, 02:10 AM

      @BnH: Do you see a scrollbar in the "manage pictures"-tab to scroll down to the following pictures?
      Nope dont have any scrollbar at all
        • 10313
        • 375 Posts
        Okay, then that is the problem.

        Please change the file [tt]/assets/plugins/managermanager/widgets/mg_backend_manager/mg_backend_manager.php[/tt] to

        <?php
        
        //---------------------------------------------------------------------------------
        // mm_widget_mg_backend_manager 
        //--------------------------------------------------------------------------------- 
        
        function mm_widget_mg_backend_manager($docid='', $title = '', $roles='', $templates='') {
        	
        	global $modx, $id, $content, $manager_theme;
        	$e = &$modx->Event;
        	
        	echo $iid;
        	if (useThisRule($roles, $templates)){
        		
        		$title = empty($title) ? "Edit gallery" : $title;
        
        	if($id != 0){
               mm_createTab($title, 'mgmanager', '', '', '<iframe id="mgmanager" src="'.$modx->config['site_url'].'/?id='.$docid.'&mmgal_id='.$id.'" height="500" width="100%" scrolling="yes" frameborder="0"></iframe>');
        	}
        	else
        	{
               mm_createTab($title, 'mgmanager', '', '', 'To manage the pictures, save this document first and then re-open it for editing.');}	
        	}
        	$e->output($output . "\n");
        }
        
        ?>


        The above is the whole file. This new code addresses two issues:

        1) It adds the scrollbars.

        2) It echoes a message in the MG-tab, when the user tries to manage the gallery before the document was saved. The widget needs to know the document ID in order to know where to store the gallery images.

        Hope this helps.
          • 3689
          • 264 Posts
          Quote from: FuryDE at Feb 02, 2010, 08:27 AM

          Okay, then that is the problem.

          Please change the file [tt]/assets/plugins/managermanager/widgets/mg_backend_manager/mg_backend_manager.php[/tt] to

          <?php
          
          //---------------------------------------------------------------------------------
          // mm_widget_mg_backend_manager 
          //--------------------------------------------------------------------------------- 
          
          function mm_widget_mg_backend_manager($docid='', $title = '', $roles='', $templates='') {
          	
          	global $modx, $id, $content, $manager_theme;
          	$e = &$modx->Event;
          	
          	echo $iid;
          	if (useThisRule($roles, $templates)){
          		
          		$title = empty($title) ? "Edit gallery" : $title;
          
          	if($id != 0){
                 mm_createTab($title, 'mgmanager', '', '', '<iframe id="mgmanager" src="'.$modx->config['site_url'].'/?id='.$docid.'&mmgal_id='.$id.'" height="500" width="100%" scrolling="yes" frameborder="0"></iframe>');
          	}
          	else
          	{
                 mm_createTab($title, 'mgmanager', '', '', 'To manage the pictures, save this document first and then re-open it for editing.');}	
          	}
          	$e->output($output . "\n");
          }
          
          ?>


          The above is the whole file. This new code addresses two issues:

          1) It adds the scrollbars.

          2) It echoes a message in the MG-tab, when the user tries to manage the gallery before the document was saved. The widget needs to know the document ID in order to know where to store the gallery images.

          Hope this helps.

          thanks! got it workin smiley
            • 10313
            • 375 Posts
            Hello,

            I’ve got a strange problem here. I’m using evolution 1.0.2 with ManagerManager 0.3.6 and MaxiGallery 0.6 beta. And I have installed the mg_backend_manager widget about wich we are talking here.

            Additionally I have YAMS up and running on that site.


            I got it all running very fine. It worked, meaning I could use the manager to upload pictures for my galleries.

            Yesterday, I setup a second template wich would make use of galleries AND the mg_backen_manager. For that, I have created a second "blank" document wich holds the MG manage call (It’s a duplicate of the working first document, only with canged max_pic_size). Finally, I added a second mm_rule to generate the picture manager tab.

            When I now edit documents with that second template, I can see the MaxiGallery manager form. But, and this is the actual problem, when I upload a picture, I get a popup-message from Firefox reading
            Diese Webseite wird auf eine neue Adresse weitergeleitet. Sollen die eingegebenen Formulardaten an die neue Adresse gesendet werden?
            This means as much as
            This page is redericted to a different address. Should the form data be sent to the new address?

            When I confirm with "OK", I see the empty form again. Nothing happened, the picture is not uploaded correctly. When I "cancel" the tab stays blank.

            Today I have noticed that the first template, wich worked very fine yesterday, shows the same behavior as the second one today, exactly as described above.

            What can this be?

            Any help very much appreciated.
              • 25260
              • 156 Posts
              I had the same problem, exactly as yours, even the version of MODx, MaxiGallery and ManagerManager :-D

              BTW, I (think) I almost solved it, but now I don’t have time to write my solution.
              Tomorrow I’ll try to achieve the final result ad then post everything.

              Cheers,

              Roberto
                • 25483
                • 741 Posts
                With this code the auto height of the iframe should work good again (tested in modx evo 1.0.2)

                <?php
                //---------------------------------------------------------------------------------
                // mm_widget_mg_backend_manager 
                //--------------------------------------------------------------------------------- 
                
                function mm_widget_mg_backend_manager($docid='', $title = '', $roles='', $templates='') {
                	
                	global $modx, $id, $content, $manager_theme;
                	$e = &$modx->Event;
                	
                	echo $iid;
                	if (useThisRule($roles, $templates)){
                		
                		$title = empty($title) ? "Edit gallery" : $title;
                		
                		$output = "//  -------------- mg_backend_manager widget include ------------- \n";
                		
                		$output .= <<<HTML
                		function doIframe(){
                	o = document.getElementsByTagName('iframe');
                	for(i=0;i<o.length;i++){
                		if (/\bautoHeight\b/.test(o[i].className)){
                			setHeight(o[i]);
                			addEvent(o[i],'load', doIframe);
                		}
                	}
                }
                
                function setHeight(e){
                	if(e.contentDocument){
                		e.height = e.contentDocument.body.offsetHeight + 35;
                	} else {
                		e.height = e.contentWindow.document.body.scrollHeight;
                	}
                }
                
                function addEvent(obj, evType, fn){
                	if(obj.addEventListener)
                	{
                	obj.addEventListener(evType, fn,false);
                	return true;
                	} else if (obj.attachEvent){
                	var r = obj.attachEvent("on"+evType, fn);
                	return r;
                	} else {
                	return false;
                	}
                }
                
                if (document.getElementById && document.createTextNode){
                 addEvent(window,'load', doIframe);	
                }
                HTML;
                
                	if($id != 0){
                       mm_createTab($title, 'mgmanager', '', '', '<iframe id="mgmanager" src="'.$modx->config['site_url'].'/?id='.$docid.'&mmgal_id='.$id.'" width="100%" class="autoHeight" scrolling="auto" frameborder="0"></iframe>');
                	}
                	else
                	{
                       mm_createTab($title, 'mgmanager', '', '', 'To manage the pictures, save this document first and then re-open it for editing.');}	
                	}
                	$e->output($output . "\n");
                }
                ?>
                  with regards,

                  Ronald Lokers
                  'Front-end developer' @ h2o Media

                  • 10313
                  • 375 Posts
                  Hmmmm, in my Firefox 3.6 (Win Vista) this produces an iframe which is just as high as the scroll down and scroll up buttons at the ends of the scrollbars. Using Evolution 1.0.2,
                    • 25260
                    • 156 Posts
                    @FuryDE: the solution for the YAMS problem will be published soon, I didn’t forgot it smiley
                      • 25483
                      • 741 Posts
                      Quote from: FuryDE at Feb 08, 2010, 05:21 AM

                      Hmmmm, in my Firefox 3.6 (Win Vista) this produces an iframe which is just as high as the scroll down and scroll up buttons at the ends of the scrollbars. Using Evolution 1.0.2,

                      OOPS! forgot to test that...

                      I only tested in Safari, at this moment I don’t have the time to look better to it. Maybe that I will look into that later!
                        with regards,

                        Ronald Lokers
                        'Front-end developer' @ h2o Media