Пример #1
0
 /**
  * Validate that the product, and manual if any, are static
  * 
  * @global OutputPage $wgOut
  * @param PonyDocsProduct $product
  * @param mixed $manual PonyDocsManual or NULL
  * @return boolean 
  */
 private function validateProductAndManualAreStatic($product, $manual)
 {
     global $wgOut;
     $valid = TRUE;
     if (is_null($manual) && !$product->isStatic()) {
         $wgOut->addHTML("<h3>{$product->getLongName()} is not defined as a static product.</h3>");
         $wgOut->addHTML("<p>In order to define it as a product, please visit the product management page from the link" . " below and follow the instructions.</p>");
         $valid = FALSE;
     } elseif (!is_null($manual) && !$manual->isStatic()) {
         $wgOut->addHTML("<h3>{$manual->getLongName()} is not defined as a static manual.</h3>");
         $wgOut->addHTML("<p>In order to define it as a static manual, please visit the manuals management page from the link" . " below and follow the instructions.</p>");
         $valid = FALSE;
     }
     return $valid;
 }