示例#1
0
 function getFeaturePages()
 {
     $res = array();
     $allFeatures = getWpapi()->listprefix("101feature:");
     var_dump($allFeatures);
     foreach ($allFeatures as $f) {
         $page = new FeaturePage($content = $f['title']);
         array_push($res, $page);
     }
     return $res;
 }
示例#2
0
function getCategories()
{
    $categories = getWpapi()->listcategories();
    $categoryNames = array();
    foreach ($categories as $c) {
        array_push($categoryNames, $c['*']);
        $subCategories = getSubCategories($c['*']);
        foreach ($subCategories as $sc) {
            array_push($categoryNames, $sc);
        }
    }
    return $categoryNames;
}
示例#3
0
 function __construct($title)
 {
     parent::__construct($title);
     $this->namespace = "Category";
     $this->members = array();
     echo "Getting category members for " . $title . PHP_EOL;
     $subCats = getWpapi()->categorymembers($title);
     var_dump($subCats);
     if ($subCats == NULL) {
         return;
     }
     foreach ($subCats as $sc) {
         if (substr_count($sc['title'], "Category") == 1) {
             //found a Category
             echo "Adding a category page: " . $sc['title'] . PHP_EOL;
             $page = new CategoryPage($sc['title']);
             array_push($this->members, $page);
         } else {
             if (substr_count($sc['title'], "101implementation") == 1) {
                 //found an implementation page
                 echo "Adding an implementation page: " . $sc['title'] . PHP_EOL;
                 $page = new ImplementationPage($sc['title']);
                 array_push($this->members, $page);
             } else {
                 if (substr_count($sc['title'], "101feature") == 1) {
                     echo "Adding an feature page: " . $sc['title'] . PHP_EOL;
                     $page = new FeaturePage($sc['title']);
                     array_push($this->members, $page);
                 } else {
                     echo "Adding a page: " . $sc['title'] . PHP_EOL;
                     $page = new Page($sc['title']);
                     array_push($this->members, $page);
                 }
             }
         }
     }
 }