Exemplo n.º 1
0
 /**
  * The function called if we're in index.php (as opposed to one of the
  * special pages).
  */
 static function displayForm($action, $article)
 {
     $title = $article->getTitle();
     if ($title->getNamespace() == SMW_NS_PROPERTY) {
         $createPropertyPage = new SFCreateProperty();
         $createPropertyPage->execute($title->getText());
     } elseif ($title->getNamespace() == NS_TEMPLATE) {
         $createTemplatePage = new SFCreateTemplate();
         $createTemplatePage->execute($title->getText());
     } elseif ($title->getNamespace() == SF_NS_FORM) {
         $createFormPage = new SFCreateForm();
         $createFormPage->execute($title->getText());
     } elseif ($title->getNamespace() == NS_CATEGORY) {
         $createCategoryPage = new SFCreateCategory();
         $createCategoryPage->execute($title->getText());
     }
     return false;
 }
Exemplo n.º 2
0
 /**
  * The function called if we're in index.php (as opposed to one of the
  * special pages)
  */
 static function displayForm($action, $article)
 {
     // TODO: This function will be called as a hook handler and $action will
     //  be a string before MW 1.18. From 1.18 onwards this function will#
     //  only be called for formcreate actions, i.e. the if statement can be
     //  removed then.
     // return "true" if the call failed (meaning, pass on handling
     // of the hook to others), and "false" otherwise
     if (is_string($action) && $action !== 'formcreate') {
         return true;
     }
     $title = $article->getTitle();
     if ($title->getNamespace() == SMW_NS_PROPERTY) {
         $createPropertyPage = new SFCreateProperty();
         $createPropertyPage->execute($title->getText());
     } elseif ($title->getNamespace() == NS_TEMPLATE) {
         $createTemplatePage = new SFCreateTemplate();
         $createTemplatePage->execute($title->getText());
     } elseif ($title->getNamespace() == SF_NS_FORM) {
         $createFormPage = new SFCreateForm();
         $createFormPage->execute($title->getText());
     } elseif ($title->getNamespace() == NS_CATEGORY) {
         $createCategoryPage = new SFCreateCategory();
         $createCategoryPage->execute($title->getText());
     }
     return false;
 }