We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13320
    • 245 Posts
    This is an auto-generated support/comment thread for CALx.

    Use this forum to post any comments about this addition or any questions you have regarding its use.

    Brief Description:
    It is a personal calendar / agenda which allows one to schedule several events.
      [b]D
      • 13320
      • 245 Posts
      ENGLISH SETUP

      New version v0.6


      • Create a folder in the assets/snippets/ folder of your MODx installation, and name it ‘CALx’
      • Copy the content of the .zip file in it
      • In the Manager, create a new snippet and name it "CALx"
      • In the manager, create a new snippet and name it ‘CALx’ , then copy the following code inside it : :
      			<?php
      				$CALxPath = $modx->config['base_path']. 'assets/snippets/CALx/';
      				include_once($CALxPath.'CALx.class.php');
      				$objCALx = new CALx();
      				
      				$objCALx->getFolder=$getFolder;
      				$objCALx->getTypeProcess=$getTypeProcess;
      				
      				if(isset($cssStyle)){$objCALx->cssStyle=$cssStyle;}else{$objCALx->cssStyle='defaut';}
      				if(isset($chunkCSSName)){$objCALx->chunkCSSName=$chunkCSSName;}
      				if(isset($inactDay)){$objCALx->inactDay=$inactDay;}else{$objCALx->inactDay='6';}
      				if(isset($dayStart)){$objCALx->dayStart=$dayStart;}else{$objCALx->dayStart='0';}
      				if(isset($showOtherMonth)){$objCALx->showOtherMonth=$showOtherMonth;}else{$objCALx->showOtherMonth='none';}
      				if(isset($lang)){$objCALx->lang=$lang;}else{$objCALx->lang='english';}
      				if(isset($useTV)){
      				if(!isset($dateStartTVName) || !isset($dateEndTVName)){
      				$useTV='false';
      				}
      				$objCALx->useTV=$useTV;
      				}else{$objCALx->useTV='false';}
      				if($useTV=='true'){
      				$objCALx->dateStartTVName=$dateStartTVName;
      				$objCALx->dateEndTVName=$dateEndTVName;
      				}
      				if(isset($popupSize)){$objCALx->popupSize=$popupSize;}else{$objCALx->popupSize='300';}
      				if(isset($toolTipPosition)){$objCALx->toolTipPosition=$toolTipPosition;}else{$objCALx->toolTipPosition='CENTER';}
      				if(isset($popupType)){$objCALx->popupType=$popupType;}else{$objCALx->popupType='2';}
      				if(isset($idDocYear)){$objCALx->idDocYear=$idDocYear;}
      				if(isset($idDocMonthEvents)){$objCALx->idDocMonthEvents=$idDocMonthEvents;}
      				
      				$CALx = $objCALx->Run();
      				$objCALx='';
      				return $CALx;
      			?>
      


      • In order to use TV’s: create 2 Tv’s with our utiliser les TV
      • Create 2 Tv’s set as:
        ‘Type’: ’Date’
        ’Widget: ’Date Formatter’
        *Do not change the format.
        ’Select the template where they will be available
      Exemple of TV : Start date


      End Date



      • In order to use the CSS chunk :
      • create a new chunk and paste the content of one the files in /CALx/style, depending of the style of your website[/li
        [list][li]indicate the name of the chunk to the &chunkCSSName parameter.
      • If the chunk is not created, or if the style is not defined, the default style is /CALX/Style/defaut_style.css.

      Call of the snippet :
      In order to call the snippet, copy the following code :
      [/list]
      			[[CALx? &getFolder=`id` &idDocYear=`ìnt` &idDocMonthEvents=`int` 
      				&dayStart=`int` &inactDay=`int` &lang=`string` 
      				&useTV=`bool` &dateStartTVName=`string` 
      				&dateEndTVName=`string` &popupType=`int` &popupSize=`int` 
      				&toolTipPosition=`string` &showOtherMonth=`string` &chunkCSSName=`string` 
      				&getTypeProcess=`string`]]
      
      


      Parameters
      &getFolder [int]
      The number associated with the folder containing the events.

      &lang [string] (english | french | spanish, default: english)
      The name of the language chosen. That’s the prefix of the language file of the ‘lang’ folder.
      Ex : ’french" stands for the file ’lang/french.lang.php’

      &getTypeProcess [createCal | showMultiEvent ]
      createCal -> Creates the calendar, the links and adds color to the cells.
      showMultiEvent -> Creates the listing page, with a link for each event.
      showFullYear : creates the list of calendars of a whole year
      showAllMonthEvent : creates the list of all the events of a month

      &idDocYear [int] (optional) : the number of the document containing the call of the CALx snippet with &getTypeProcess=`showFullYear`.
      Creates a link towards this document below the calendar.

      &idDocMonthEvents=`ìnt` (optional) : the number of the document containing the call of the CALx snippet,
      with the &getTypeProcess=`showAllMonthEvent` parameter.Creates a link towards this document below the calendar

      &dayStart [0 | 1 | 2 | 3 | 4 | 5 | 6] (default: 0)
      The day chosen to start the week.
      The values are :
      0 : Monday
      1 : Tuesday
      2 : Wednesday
      3 : Thursday
      4 : Friday
      5 : Saturday
      6 : Sunday

      &inactDay [0 | 1 | 2 | 3 | 4 | 5 | 6] (par défaut : 6)
      The day of rest
      The values are :
      0 : Monday
      1 : Tuesday
      2 : Wednesday
      3 : Thursday
      4 : Friday
      5 : Saturday
      6 : Sunday

      &useTV [true | false] (par défaut : false)
      If you wish to use Tv’s instead of pub dates, set this parameter as ‘true’
      If you use Tv’s, the dateStartTVName and dateEndTVName parameters are mandatory!

      If you forget them, $useTV will be reset as `false`

      &dateStartTVName [string] Mandatory if &useTV=`true`
      Indicates the name of the Tv associated to the date on which the event begins.

      &dateEndTVName [string] Mandatory if &useTV=`true`
      Indicates the name of the Tv associated to the date on which the event ends.

      &popupType [0 | 1 | 2] (default: 2)
      Indicates the type of pop up chosen for the tooltip.
      Values:
      • 0 : the tooltip appears on hover, no link.
      • 1 : the tooltip appears on hover and allows you to click on a link.
      • 2 : the tooltip appears on click and allows you to click on a link.

      &popupSize [int] (par défaut : 300)
      Size of the pop up ( in pixels )

      &toolTipPosition [CENTER | LEFT | RIGHT | ABOVE | BELOW] (default: CENTER)
      Position of the pop up.

      &chunkCSSName [string] : contains the name of the chunk with the CSS classes.

      &showOtherMonth [previous | both | next | none ] (default: none) : displays the last days of the previous month, the first days of the
      following month, both or neither.

      Notes :
      * If there are over 1 event for one day, a pop up show up with a link to a listing page.
      * The style of this agenda ( colors etc. ) can be totally transformed to suit your needs.
      * Do not erase the document created in the folder holding all the events, it is the document allowing the listing of events.
      * Do not pay attention to the subfolders, I will change them soon in order to make this snippet clearer and simpler.
        [b]D
        • 13320
        • 245 Posts
        FRANCAIS - INSTALLATION

        Nouvelle version v0.6


        • Créer un répertoire ’CALx’ dans le répertoire assets/snippets/ de votre installation modx
        • Copier-coller le contenu de l’archive dans ce répertoire
        • Dans le manager créer un nouveau snippet : CALx
        • [li]Copier le code suivant dedans :
        				<?php
        				$CALxPath = $modx->config['base_path']. 'assets/snippets/CALx/';
        				include_once($CALxPath.'CALx.class.php');
        				$objCALx = new CALx();
        				
        				$objCALx->getFolder=$getFolder;
        				$objCALx->getTypeProcess=$getTypeProcess;
        				
        				if(isset($cssStyle)){$objCALx->cssStyle=$cssStyle;}else{$objCALx->cssStyle='defaut';}
        				if(isset($chunkCSSName)){$objCALx->chunkCSSName=$chunkCSSName;}
        				if(isset($inactDay)){$objCALx->inactDay=$inactDay;}else{$objCALx->inactDay='6';}
        				if(isset($dayStart)){$objCALx->dayStart=$dayStart;}else{$objCALx->dayStart='0';}
        				if(isset($showOtherMonth)){$objCALx->showOtherMonth=$showOtherMonth;}else{$objCALx->showOtherMonth='none';}
        				if(isset($lang)){$objCALx->lang=$lang;}else{$objCALx->lang='english';}
        				if(isset($useTV)){
        				if(!isset($dateStartTVName) || !isset($dateEndTVName)){
        				$useTV='false';
        				}
        				$objCALx->useTV=$useTV;
        				}else{$objCALx->useTV='false';}
        				if($useTV=='true'){
        				$objCALx->dateStartTVName=$dateStartTVName;
        				$objCALx->dateEndTVName=$dateEndTVName;
        				}
        				if(isset($popupSize)){$objCALx->popupSize=$popupSize;}else{$objCALx->popupSize='300';}
        				if(isset($toolTipPosition)){$objCALx->toolTipPosition=$toolTipPosition;}else{$objCALx->toolTipPosition='CENTER';}
        				if(isset($popupType)){$objCALx->popupType=$popupType;}else{$objCALx->popupType='2';}
        				if(isset($idDocYear)){$objCALx->idDocYear=$idDocYear;}
        				if(isset($idDocMonthEvents)){$objCALx->idDocMonthEvents=$idDocMonthEvents;}
        				
        				$CALx = $objCALx->Run();
        				$objCALx='';
        				return $CALx;
        			?>
        



        • Pour utiliser les TV : Créer deux TV avec en :
          ’Type d’entrée : ’ mettre ’Date’
          ’Widget : ’ mettre ’Date Formatter’
          *Ne changez pas le format
          ’Sélectionner le template où elles seront disponibles
        Exemple de TV : Start date


        End Date



        • Pour utiliser les chunk CSS :
        • Crée un nouveau chunk ave le contenu d’un des fichier du répertoire /CALx/style
        • Indiquer le nom du chunk au paramètre &chunkCSSName

        Appel du snippet
        Pour appeler le snippet placer la ligne suivante :
        			[[CALx? &getFolder=`id` &idDocYear=`ìnt` &idDocMonthEvents=`int` 
        				&dayStart=`int` &inactDay=`int` &lang=`string` 
        				&useTV=`bool` &dateStartTVName=`string` 
        				&dateEndTVName=`string` &popupType=`int` &popupSize=`int` 
        				&toolTipPosition=`string` &showOtherMonth=`string` &chunkCSSName=`string` 
        				&getTypeProcess=`string`]]
        



        Explication des paramètres
        &getFolder [int]
        Le numéro du répertoire contenant les évènements

        &idDocYear [int] (facultatif)
        Le numéro du document contenant l’appel de CALx avec &getTypeProcess=`showFullYear`
        Crée un lien qui pointe vers ce document en dessous du calendrier.

        &idDocMonthEvents [int] (facultatif)
        Le numéro du document contenant l’appel de CALx avec &getTypeProcess=`showAllMonthEvent`
        Crée un lien qui pointe vers ce document en dessous du calendrier.

        &lang [string] (par défaut : english)
        Langues disponibles de base : english, french, spanish

        Le nom de la langue à utiliser. C’est le préfixe au fichier de langue du
        répertoire ’lang’.
        Ex : ’french" pour le fichier ’lang/french.lang.php’

        &getTypeProcess [createCal | showMultiEvent ]
        createCal -> créer le calendrier, créer les lien, colore les cellules
        showMultiEvent -> crée la page des liens vers les événements
        showFullYear -> crée la liste des calendriers d’une année complète
        showAllMonthEvent -> crée une liste de tous les événements du mois

        &dayStart [0 | 1 | 2 | 3 | 4 | 5 | 6] (par défaut : 0)
        Le jour de départ de la semaine
        Valeurs possibles :
        0 : lundi
        1 : mardi
        2 : mercredi
        3 : jeudi
        4 : vendredi
        5 : samedi
        6 : dimanche

        &inactDay [0 | 1 | 2 | 3 | 4 | 5 | 6] (par défaut : 6)
        Le jour d’inactivité de la semaine
        Valeurs possibles :
        0 : lundi
        1 : mardi
        2 : mercredi
        3 : jeudi
        4 : vendredi
        5 : samedi
        6 : dimanche

        &useTV [true | false] (par défaut : false)
        Si on souhaite utiliser les TV à la place des dates de publications
        mettre ce paramètre à `true`.
        Si vous utilisez les TV, les paramètres : dateStartTVName, et dateEndTVName
        sont obligatoires.
        Si vous omettez ces deux paramètres $useTV sera mis à `false`

        &dateStartTVName [string] Obligatoire si &useTV=`true`
        Indique le nom de la TV associée à la date de début d’évènement

        &dateEndTVName [string] Obligatoire si &useTV=`true`
        Indique le nom de la TV associée à la date de fin d’évènement

        &popupType [0 | 1 | 2] (par défaut : 2)
        Indique le type de popup à utiliser pour les info bulle:
        Valeurs possibles :
        0 : l’infobulle apparait sur le survol, mais disparait sur un mouvement de souris
        Pas de lien cliquable pour le détail
        1 : l’inobulle apparait sur un survol, permet de cliquer sur un lien pour le détail
        2 : l’infobulle apparait sur un clic, permet de cliquer sur un lien pour le détail

        &chunkCSSName [string] (facultatif)
        Indique le nom du chunk contenant les classes CSS

        &showOtherMonth [previous | both | next | none ] (par défaut : none)
        Affiche les jours du mois précédent, suivant, les deux, ou aucun

        &popupSize [int] (par défaut : 300)
        Taille en pixel de la popup

        &toolTipPosition [CENTER | LEFT | RIGHT | ABOVE | BELOW] (par défaut : CENTER)
        Emplacement de l’apparition de la popup

        Indications
        * Qu’un événement soit passé ou à venir, il est affiché dans le calendrier.
        Si une journée contient plusieurs événements, un lien dans une info bulle permet d’afficher la liste et un autre lien au détail.
        * Le style du calendrier et des info bulles (couleurs etc...) sont modifiables dans le fichier agenda/style/style.css
        * un document est créer dans le répertoire des événements pour l’affichage du multi event, il ne faut pas le supprimer.
        * ne tient pas compte des sous répertoires, c’est un des ajouts que je vais faire en premier, pour le classement des event c’est qd même plus clair.
          [b]D
          • 25307
          • 114 Posts
          ;D thanx jab! was that just for me? awww... just kidding. I’ll be testing the new version this morning, can’t wait to see it in action... One thing I noticed was that some of the repository info text isn’t displaying proper, thought you’d wanna see it. Thanks again, I’ll document anything I bump into during install of new version. cheers.
            • 13320
            • 245 Posts
            Heya,

            Yes i saw the bug, in the Repository, i fix that when i have a couple of minutes smiley

            But I post the 2 setup instruction here smiley
              [b]D
              • 5253
              • 17 Posts
              heyya!

              thanks very much for this cool calendar. Well done!
              If just included it to my site. But I’ve one little question: Is there any possibility to generate event entries from subfolders? My news are structured in 3 separate subfolders. When i call just one folder it works fine. But i need to include all of them within one calendar...
              is there any possibility, or will you add this feature in the next release?

              thanks a lot!

              EDIT: I just discoverd, that some variables are added to the link of the event (e.g. Link: http://localhost/modx/index.php?id=39&jour=10&mois=8&annee=2007 with searchfriendly URLs ans SEOverride it becomes:
              http://localhost/modx/news/subfolder/next-party?&jour=10&mois=8&annee=2007)
              What are these vars for? Perhaps you’ll add the support for searchengine friendly URLs in the next release as well... grin
                *there are no strangers - just friends who never met*
                • 13320
                • 245 Posts
                Hi,

                CALx works with one directory for now smiley

                But Okay, just for you, i’ll work to change that wink

                Sorry, I’m french and i don’t understand all the Edit of your post :/, if you have one event, the id of document can show it, but if you have more than one event, the day, month, year, are necessary to CALx to found what events shown in the list.

                Do I answer your question ?
                  [b]D
                  • 30128
                  • 78 Posts
                  This looks great! But I just can’t get it to work...

                  I’ve made a new document and marked it as "container" , the id is 48. Then inside this folder i’ve made a few test-documents with template variables set.

                  In my main page I added this snippet call:

                  [[CALx? &getFolder=`48` &idDocYear=`50` &idDocMonthEvents=`49` &dayStart=`0` &inactDay=`6` &useTV=`true` &dateStartTVName=`startDateOfEvent` &dateEndTVName=`endDateOfEvent` &popupType=`1` &popupSize=`250` &toolTipPosition=`CENTER` &showOtherMonth=`both` &getTypeProcess=`calCreate`]]


                  but nothing at all shows up. When I check the source code of that page, the CALx javascripts has been included, so something works.

                  When I changed getTypeProcess to ’showMultiEvents’, CALx prints out "No events schedule for this journey."

                  I’ve also tried this simple call:
                  [[CALx? &getFolder=`48` &getTypeProcess=`calCreate`]]

                  but I still get nil output.

                  All this leads me to believe that I’ve completely misunderstood how to actually create a new event. How do I actually create a new event?

                  Is a new event not simply a document in the folder pointed to by getFolder, and with a start and end date set by the template variables?
                    • 13320
                    • 245 Posts
                    Hi,

                    What are the date who are put on the TV’s ?

                    The TV’s name are correct ?

                    The calendar appears or nothing at all ?
                      [b]D
                      • 30128
                      • 78 Posts
                      Bah.. so even though I was sure I copied everything directly from this site, if you look close I actually had
                      &getTypeProcess=`calCreate` 

                      instead of
                      &getTypeProcess=`createCal` 

                      which made all the difference smiley