Beispiel #1
0
 /**
  * Check completion status
  *
  * @return  object
  */
 public function getStatus($pub = NULL, $manifest = NULL, $elementId = NULL)
 {
     // Start status
     $status = new \Components\Publications\Models\Status();
     $status->status = 1;
     // Load license class
     $objL = new \Components\Publications\Tables\License($this->_parent->_db);
     if ($pub->license_type && $objL->load($pub->license_type)) {
         $agreement = $pub->params->get('licenseagreement');
         // Missing agreement?
         if ($objL->agreement == 1 && !$agreement) {
             $status->setError(Lang::txt('PLG_PROJECTS_PUBLICATIONS_LICENSE_NEED_AGREEMENT'));
             $status->status = 0;
         }
         if ($objL->customizable == 1 && $objL->text && !$pub->license_text) {
             $status->setError(Lang::txt('PLG_PROJECTS_PUBLICATIONS_LICENSE_NEED_TEXT'));
             $status->status = 0;
         }
         if ($pub->license_text) {
             preg_replace('/\\[([^]]+)\\]/', ' ', $pub->license_text, -1, $bingo);
             if ($bingo) {
                 $status->setError(Lang::txt('Default values need to be substituted'));
                 $status->status = 0;
             }
         }
     } else {
         $status->status = 0;
     }
     return $status;
 }