/**
  * Initialises the _savestate variable
  *
  * @param   integer  $defaultSaveState  The default value for the savestate
  *
  * @return  void
  */
 public function populateSavestate($defaultSaveState = -999)
 {
     if (is_null($this->_savestate)) {
         $savestate = $this->input->getInt('savestate', $defaultSaveState);
         if ($savestate == -999) {
             $savestate = true;
         }
         $this->savestate($savestate);
     }
 }
 /**
  * Gets a URL suffix with the Itemid parameter. If it's not the front-end of the site, or if
  * there is no Itemid set it returns an empty string.
  *
  * @return  string  The &Itemid=123 URL suffix, or an empty string if Itemid is not applicable
  */
 public function getItemidURLSuffix()
 {
     if (FOFPlatform::getInstance()->isFrontend() && $this->input->getCmd('Itemid', 0) != 0) {
         return '&Itemid=' . $this->input->getInt('Itemid', 0);
     } else {
         return '';
     }
 }