/**
  * @see FileFinder::find()
  * @return An array with the ids of the new template sets
  */
 function find($currentTemplates = null)
 {
     // if no parameter, then use the list of default global templates
     if ($currentTemplates == null) {
         $currentTemplates = TemplateSets::getGlobalTemplates();
     }
     // call the parent method after the preparations
     parent::find($currentTemplates);
     // and return any new templates
     return $this->getNew();
 }
 /**
  * Adds a global template to the site.
  *
  * @param templateName Name of the template we'd like to add
  * @return Returns true if successful or false otherwise.
  */
 function addGlobalTemplate($templateName)
 {
     $config =& Config::getConfig();
     // check if the value is there and if so, do nothing
     $templateSets = new TemplateSets();
     if ($templateSets->isTemplate($templateName)) {
         return true;
     }
     // let's make sure that we actually got an array... if not, then
     // let's recreate the array to avoid further problems down the road!
     $templates = $templateSets->getGlobalTemplates();
     if (!is_array($templates)) {
         print "recreating the array!";
         $templates = array();
     }
     // if not there, we can add it
     array_push($templates, $templateName);
     // and store the values
     $config->saveValue("templates", $templates);
     return true;
 }