Jump to content

PWaddict

Members
  • Posts

    908
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by PWaddict

  1. 10 hours ago, horst said:

    what issue? that it is not recognized by the upgrader? this is expected, as i haven't changed anythig than the version number from string "0.9.17" to number 100. :)

     

    Shouldn't be say: Session: Current installed version is already up-to-date like on the other modules?

  2. 1 hour ago, horst said:

    Uhm, thats sort of a Problem!

    I think I cannot simply update it this way, as it may break systems. There are also the check for updates right in the config screen of the module itself, what currently works well. Needs more testing before.

    It would be helpful to get some minds / thoughts about this from the veterans.

    • manually update needs to copy all new files over the existing ones
    • (optionally ?) flush the modules cash
    • Install the new wrapper module

    I can push it to a test-branch for those who are reading this. But this is not of help for those who want / need updates via PW (individual in module config or via updater module) ??

     

    Take your time to do it right.
    I'm using the 0.9.17 version and when I check for updates from the module config I get: Session: Error reported by web service: Unable to find that module

    EDIT: I've just manually upgrade to 1.0.0 and the issue still exists.

  3. 1 hour ago, horst said:

    No, this is not possible, because if the original update could be with different dimensions than the previous version. If so, there is big potential to crash the image manipulation script with crop settings out of bound of the new original image.

    Ok thanks for the info.

    Let us know if you update the module to be visible on the Upgrades.

  4. 1 hour ago, bernhard said:

    i think it's more related to setting up a proper rewrite base than changing this module.

    https://processwire.com/docs/tutorials/troubleshooting-guide/page3

    I'm not sure cause every other link on ProcessWire works great except the link injection in this module. 

    On the AdminCustomFiles.module I replaced the 249 line:

    'relative' => substr($base, strpos($base, '/site/templates/')),

    to this and it worked:

    'relative' => substr($base, strpos($base, '/mysite.com/site/templates/')),

    It seems that the module can't recognize that ProccessWire installed on localhost/mysite.com.

    • Like 1
  5. The module injects broken links.

    My main localhost url is: http://localhost/mysite.com/ and the module injects the css link as:

    <link type='text/css' href='/site/templates/AdminCustomFiles/ProcessPageEdit.css' rel='stylesheet' />

    where the correct one should be:

    <link type='text/css' href='/mysite.com/site/templates/AdminCustomFiles/ProcessPageEdit.css' rel='stylesheet' />

     

  6. 14 hours ago, bernhard said:

    i would suggest doing the following:

    • create a new template file for your page that holds the map data with exactly the code from the google example (javascript + html): https://developers.google.com/maps/documentation/javascript/examples/map-simple?hl=de
    • change nothing but your api-key.
    • when you view this page you should see the same map as on the google docs page.
    • replace the fixed values for lat/lng/zoom by those saved in your processwire site. see my example above ($page->map->lat...)
    • view your page, it should show the map at the position that you specified in your backend
    • change your style by adding the styles options (see code below)
    • view your page, you should see the new style
    • if everything works, try to implement your map in your original template file
    
    var map;
    function initMap() {
      map = new google.maps.Map(document.getElementById('map'), {
        center: {lat: -34.397, lng: 150.644},
        zoom: 8, // add comma here
        styles: [
      {
        "stylers": [
          { "hue": "#c1d72e" }
        ]
      }
    ]
      });
    }

     

    Thanks to your suggestions I finally figured out the problem. I had to replace the % on map's css to px.

  7. 2 hours ago, bernhard said:

    just don't use the modules render() method and write the code on your own. you should know how to do that as you say you already did it without the module ;)

    you have all the necessary field data in these variables:

    
    echo $page->map->address;   // outputs the address you entered
    echo $page->map->lat;       // outputs the latitude
    echo $page->map->lng;       // outputs the longitude
    echo $page->map->zoom;      // outputs the zoom level

    you can also just copy the generated markup of your render method and then adjust the necessary (parts of your) scripts.

    I've copied my code from an older website I've created a map with changed colors without using the module and it doesn't even load the map on the website I'm currently developing. It's driving me crazy...

    window.onload = function () {
    
    			var latlng = new google.maps.LatLng(12.3456789, 12.3456789);
    
    			var styles = [
      {
        "stylers": [
          { "hue": "#c1d72e" }
        ]
      }
    ];
    
    			var myOptions = {
    				zoom: 17,
    				center: latlng,
    				mapTypeId: google.maps.MapTypeId.ROADMAP,
    				disableDefaultUI: true,
    				styles: styles
    			};
    
    			map = new google.maps.Map(document.getElementById('map'), myOptions);
    			
    			var myCenter = new google.maps.LatLng(12.3456789, 12.3456789);
        var myIcon = new google.maps.MarkerImage(
        "https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=%E2%80%A2|c1d72e",
        new google.maps.Size(24,30),
        new google.maps.Point(0,0),
        new google.maps.Point(12,23)
        );
     
     
        var marker = new google.maps.Marker({position: myCenter, icon: myIcon, map: map});

    On the 2nd method you proposed I don't know how to apply the code to change the color.

    If anyone managed to change the colors with this module PLEASE let me know how you dit it. Thanks.

  8. 1 hour ago, bernhard said:

    yes, it is: https://www.google.com/search?q=change google map colours

    should be very easy using their readymade styles: https://snazzymaps.com/

    Yeah I know it's possible. I've already did on a map without using this module. I should be more specific.

    On a map without using this module I used this js to change the colors:

    var styles = [
      {
        "stylers": [
          { "hue": "#c1d72e" }
        ]
      }
    ];

    So the proper question is how can I apply the above code on a map using this module? 

  9. 9 hours ago, blynx said:

    Oh! 
    Thanks for the tip - will try to take care of that today if I find the time - otherwise next week, will be away from the computer for the weekend.

    I will let you know when it is fixed -

     

    To quickly fix the issue just replace the below code from TextformatterVideoEmbedOptions.config.json

    "yt_showinfo": {
            "type": null,
            "value": 0,
            "label":"YouTube: Show Info",
            "description":"Supported values are 0 and 1.",
            "notes": "Default: 0"
          }

    to this:

    "yt_showinfo": {
            "type": null,
            "value": 1,
            "label":"YouTube: Show Info",
            "description":"Supported values are 0 and 1.",
            "notes": "Default: 1"
          }

     

    • Like 2
  10. I found another problem. ProcessWire doesn't display the correct version of your module. It keeps saying that I have 0.2.7 and that there is a newer version 0.3.3 which is false cause I already have the latest module version installed. I opened the module file to confirm that: 'version' => 033. Please fix that too.

  11. The YouTube: Show Info field is broken. When the value is 0 it doesn't add the parameter: &showinfo=0 at the video url to hide the info but if the value is changed to 1 then it adds &showinfo=1 on the url which is useless cause YouTube shows info by default. Please fix it.

  12. On 1/16/2015 at 11:42 PM, adrian said:

    I didn't think about the pagination issue.

    I am not sure there is an easy fix for that with the current options for hooking into ProcessPageList

    Just out of interest though, here is a new version that uses ProcessPageList::find as the hook - it simplifies some things quite a lot, but still doesn't fix the pagination issue :(

    
    <?php
    
    /**
     *
     *
     * ProcessWire 2.x
     * Copyright (C) 2010 by Ryan Cramer
     * Licensed under GNU/GPL v2, see LICENSE.TXT
     *
     * http://www.processwire.com
     * http://www.ryancramer.com
     *
     */
    
    class HideOtherUserPages extends WireData implements Module {
    
        public static function getModuleInfo() {
    
            return array(
                'title' => 'HideOtherUserPages',
                'author' => 'Adrian Jones',
                'version' => 1,
                'singular' => true,
                'autoload' => true
                );
        }
    
        public function init() {
            // only add hook only if the render parameter is set
            // (as used by ProcessPageList)
            // or if superuser, also exit
            if(!isset($_GET['render']) || $this->user->isSuperuser()) return;
            $this->addHookAfter('ProcessPageList::find', $this, 'pageListHiddenPages');
    
        }
    
        public function pageListHiddenPages(HookEvent $event){
    
            $pages = $event->return;
    
            // make sure it's an ajax request
            if($this->config->ajax){
                // manipulate the json returned and remove any pages found from array
                foreach($pages as $p) {
                    if($p->parent->name != 'visitenkarte') continue;
                    if($p->name != $this->user->name) $pages->remove($p);
                }
                $event->return = $pages;
            }
        }
    }

    I've used the above module to hide specific children pages with the template selector:

    I've changed this line:

    if($p->parent->name != 'visitenkarte') continue;

    to this:

    if($p->template->name != 'tour-content') continue;

    and it partially works cause ProcessWire remembers what pages you click lately and if those pages have children and you reload the page that holds the page tree then all the children pages you want to hide are visible. Do you know how to fix this?

    EDIT: Nevermind, no longer need to hide them but if you know how to fix that problem maybe you should share it for other users.

  13. I figured it out. I changed this function:

        public function afterBuildForm(HookEvent $event){
    
            if($this->user->isSuperuser()) return;
    
            $form = $event->return;
    
            foreach($this->data['viewTabs'] as $tab) {
                if(!$this->user->hasPermission("tab-".strtolower($tab)."-view")) {
                    $this->removeTabs($tab, $event);
                }
            }
    
            foreach($this->data['hideTabs'] as $tab) {
                if($this->user->hasPermission("tab-".strtolower($tab)."-hide")) {
                    $this->removeTabs($tab, $event);
                }
            }
    
            $event->return = $form;
        }

    to this:

        public function afterBuildForm(HookEvent $event){
    
            if($this->user->isSuperuser()) return;
    
            $form = $event->return;
            $p = $event->object->getPage();
    
            foreach($this->data['viewTabs'] as $tab) {
                if(!$this->user->hasPermission("tab-".strtolower($tab)."-view")) {
                    $this->removeTabs($tab, $event);
                }
            }
    
            foreach($this->data['hideTabs'] as $tab) {
                if($this->user->hasPermission("tab-".strtolower($tab)."-hide") && $p->template->name == 'mytemplatename') {
                    $this->removeTabs($tab, $event);
                }
            }
    
            $event->return = $form;
        }

     

    • Like 1
  14. 2 minutes ago, adrian said:

    Can't really help without knowing exactly how you did the hiding :)

    Sorry you're right :)

    I've edited the function removeTabs:

        public function removeTabs ($tab, $event) {
    
            $form = $event->return;
            $p = $event->object->getPage();
    
            if($p->template->name == 'mytemplatename' && $tab == "Children") {
                $fieldset = $form->find("id=ProcessPageEdit".$tab)->first();
            }
            else {
                $fieldset = $form->find("id=ProcessPageEdit".$tab);
            }
    
            $form->remove($fieldset);
            $event->object->removeTab("ProcessPageEdit".$tab);
        }

     

  15. 58 minutes ago, adrian said:

    Currently no, the module is designed for site-wide use, but you could extend it to have a template selector in the module config, or just steal the relevant code from the module and add it as a hook in your /site/ready.php file.

    Ok I hide the children tab on the template I wanted but now the order of tabs is changed on the other templates. It shows them in this order: Content, Settings, Delete, View, Children instead of Content, Children, Settings, Delete, View. I'm not sure how can I fix that.

×
×
  • Create New...