Joomla Platform  13.1
Documentation des API du framework Joomla Platform
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe JMediawikiPages
+ Graphe d'héritage de JMediawikiPages:
+ Graphe de collaboration de JMediawikiPages:

Liste de tous les membres

Fonctions membres publiques

 editPage ($title, $section=null, $sectiontitle=null, $text=null, $summary=null)
 deletePageByName ($title, $reason=null, $watchlist=null, $oldimage=null)
 deletePageByID ($pageid, $reason=null, $watchlist=null, $oldimage=null)
 undeletePage ($title, $reason=null, $timestamp=null, $watchlist=null)
 movePageByName ($from, $to, $reason=null, $movetalk=null, $movesubpages=null, $noredirect=null, $watchlist=null, $ignorewarnings=null)
 movePageByID ($fromid, $to, $reason=null, $movetalk=null, $movesubpages=null, $noredirect=null, $watchlist=null, $ignorewarnings=null)
 rollback ($title, $user, $summary=null, $markbot=null, $watchlist=null)
 changeProtection ($title, $protections, $expiry=null, $reason=null, $cascade=null, $watchlist=null)
 getPageInfo (array $titles, array $inprop=null, array $intoken=null, $incontinue=null)
 getPageProperties (array $titles, $ppcontinue=null, $ppprop=null)
 getRevisions (array $titles, array $rvprop=null, $rvparse=null, $rvlimit=null)
 getPageTemplates (array $titles, array $tlnamespace=null, $tllimit=null, $tlcontinue=null, $tltemplates=null, $tldir=null)
 getBackLinks ($bltitle, $blpageid=null, $blcontinue=null, array $blnamespace=null, $blfilterredirect=null, $bllimit=null, $blredirect=null)
 getIWBackLinks ($iwbltitle, $iwblprefix=null, $iwblcontinue=null, $iwbllimit=null, array $iwblprop=null)
 getToken ($user, $intoken)
- Fonctions membres publiques inherited from JMediawikiObject
 __construct (JRegistry $options=null, JMediawikiHttp $client=null)
 buildParameter (array $params)
 validateResponse ($response)

Additional Inherited Members

- Fonctions membres protégées inherited from JMediawikiObject
 fetchUrl ($path)
- Attributs protégés inherited from JMediawikiObject
 $options
 $client

Description détaillée

Définition à la ligne 19 du fichier pages.php.


Documentation des fonctions membres

JMediawikiPages::changeProtection (   $title,
  $protections,
  $expiry = null,
  $reason = null,
  $cascade = null,
  $watchlist = null 
)

Method to change the protection level of a page.

Paramètres:
string$titleTitle of the page you want to (un)protect.
string$protectionsPipe-separated list of protection levels.
string$expiryExpiry timestamps.
string$reasonReason for (un)protecting (optional).
string$cascadeEnable cascading protection.
string$watchlistUnconditionally add or remove the page from your watchlist.
Renvoie:
object
Depuis:
12.3

Définition à la ligne 302 du fichier pages.php.

{
// Get the token.
$token = $this->getToken($title, 'unblock');
// Build the request path.
$path = '?action=protect';
// Build the request data.
$data = array(
'title' => $title,
'token' => $token,
'protections' => $protections,
'expiry' => $expiry,
'reason' => $reason,
'cascade' => $cascade,
'watchlist' => $watchlist
);
// Send the request.
$response = $this->client->post($this->fetchUrl($path), $data);
return $this->validateResponse($response);
}
JMediawikiPages::deletePageByID (   $pageid,
  $reason = null,
  $watchlist = null,
  $oldimage = null 
)

Method to delete a page.

Paramètres:
string$pageidPage ID of the page you want to delete.
string$reasonReason for the deletion.
string$watchlistUnconditionally add or remove the page from your watchlis.
string$oldimageThe name of the old image to delete.
Renvoie:
object
Depuis:
12.3

Définition à la ligne 105 du fichier pages.php.

{
// Get the token.
$token = $this->getToken($pageid, 'delete');
// Build the request path.
$path = '?action=delete';
// Build the request data.
$data = array(
'pageid' => $pageid,
'token' => $token,
'reason' => $reason,
'watchlist' => $watchlist,
'oldimage' => $oldimage
);
// Send the request.
$response = $this->client->post($this->fetchUrl($path), $data);
return $this->validateResponse($response);
}
JMediawikiPages::deletePageByName (   $title,
  $reason = null,
  $watchlist = null,
  $oldimage = null 
)

Method to delete a page.

Paramètres:
string$titleTitle of the page you want to delete.
string$reasonReason for the deletion.
string$watchlistUnconditionally add or remove the page from your watchlis.
string$oldimageThe name of the old image to delete.
Renvoie:
object
Depuis:
12.3

Définition à la ligne 70 du fichier pages.php.

{
// Get the token.
$token = $this->getToken($title, 'delete');
// Build the request path.
$path = '?action=delete';
// Build the request data.
$data = array(
'title' => $title,
'token' => $token,
'reason' => $reason,
'watchlist' => $watchlist,
'oldimage' => $oldimage
);
// Send the request.
$response = $this->client->post($this->fetchUrl($path), $data);
return $this->validateResponse($response);
}
JMediawikiPages::editPage (   $title,
  $section = null,
  $sectiontitle = null,
  $text = null,
  $summary = null 
)

Method to edit a page.

Paramètres:
string$titlePage title.
int$sectionSection number.
string$sectiontitleThe title for a new section.
string$textPage content.
string$summaryTitle of the page you want to delete.
Renvoie:
object
Depuis:
12.3

Définition à la ligne 34 du fichier pages.php.

{
// Get the token.
$token = $this->getToken($title, 'edit');
// Build the request path.
$path = '?action=edit';
// Build the request data.
$data = array(
'title' => $title,
'token' => $token,
'section' => $section,
'sectiontitle' => $section,
'text' => $text,
'summary' => $summary
);
// Send the request.
$response = $this->client->post($this->fetchUrl($path), $data);
return $this->validateResponse($response);
}
JMediawikiPages::getBackLinks (   $bltitle,
  $blpageid = null,
  $blcontinue = null,
array  $blnamespace = null,
  $blfilterredirect = null,
  $bllimit = null,
  $blredirect = null 
)

Method to get all pages that link to the given page.

Paramètres:
string$bltitleTitle to search.
integer$blpageidPageid to search.
boolean$blcontinueWhen more results are available, use this to continue.
array$blnamespaceThe namespace to enumerate.
string$blfilterredirectHow to filter for redirects..
integer$bllimitHow many total pages to return.
boolean$blredirectIf linking page is a redirect, find all pages that link to that redirect as well.
Renvoie:
object
Depuis:
12.3

Définition à la ligne 512 du fichier pages.php.

{
// Build the request.
$path = '?action=query&list=backlinks';
if (isset($bltitle))
{
$path .= '&bltitle=' . $bltitle;
}
if (isset($blpageid))
{
$path .= '&blpageid=' . $blpageid;
}
if ($blcontinue)
{
$path .= '&blcontinue=';
}
if (isset($blnamespace))
{
$path .= '&blnamespace=' . $this->buildParameter($blnamespace);
}
if (isset($blfilterredirect))
{
$path .= '&blfilterredirect=' . $blfilterredirect;
}
if (isset($bllimit))
{
$path .= '&bllimit=' . $bllimit;
}
if ($blredirect)
{
$path .= '&blredirect=';
}
// Send the request.
$response = $this->client->get($this->fetchUrl($path));
return $this->validateResponse($response);
}
JMediawikiPages::getIWBackLinks (   $iwbltitle,
  $iwblprefix = null,
  $iwblcontinue = null,
  $iwbllimit = null,
array  $iwblprop = null 
)

Method to get all pages that link to the given interwiki link.

Paramètres:
string$iwbltitleInterwiki link to search for. Must be used with iwblprefix.
string$iwblprefixPrefix for the interwiki.
boolean$iwblcontinueWhen more results are available, use this to continue.
integer$iwbllimitHow many total pages to return.
array$iwblpropWhich properties to get.
Renvoie:
object
Depuis:
12.3

Définition à la ligne 572 du fichier pages.php.

{
// Build the request
$path = '?action=query&list=iwbacklinks';
if (isset($iwbltitle))
{
$path .= '&iwbltitle=' . $iwbltitle;
}
if (isset($iwblprefix))
{
$path .= '&iwblprefix=' . $iwblprefix;
}
if ($iwblcontinue)
{
$path .= '&iwblcontinue=';
}
if (isset($iwbllimit))
{
$path .= '&bllimit=' . $iwbllimit;
}
if (isset($iwblprop))
{
$path .= '&iwblprop=' . $this->buildParameter($iwblprop);
}
// Send the request.
$response = $this->client->get($this->fetchUrl($path));
return $this->validateResponse($response);
}
JMediawikiPages::getPageInfo ( array  $titles,
array  $inprop = null,
array  $intoken = null,
  $incontinue = null 
)

Method to get basic page information.

Paramètres:
array$titlesPage titles to retrieve info.
array$inpropWhich additional properties to get.
array$intokenRequest a token to perform a data-modifying action on a page
boolean$incontinueWhen more results are available, use this to continue.
Renvoie:
object
Depuis:
12.3

Définition à la ligne 339 du fichier pages.php.

{
// Build the request
$path = '?action=query&prop=info';
// Append titles to the request.
$path .= '&titles=' . $this->buildParameter($titles);
if (isset($inprop))
{
$path .= '&inprop=' . $this->buildParameter($inprop);
}
if (isset($intoken))
{
$path .= '&intoken=' . $this->buildParameter($intoken);
}
if ($incontinue)
{
$path .= '&incontinue=';
}
// Send the request.
$response = $this->client->get($this->fetchUrl($path));
return $this->validateResponse($response);
}
JMediawikiPages::getPageProperties ( array  $titles,
  $ppcontinue = null,
  $ppprop = null 
)

Method to get various properties defined in the page content.

Paramètres:
array$titlesPage titles to retrieve properties.
boolean$ppcontinueWhen more results are available, use this to continue.
string$pppropPage prop to look on the page for.
Renvoie:
object
Depuis:
12.3

Définition à la ligne 379 du fichier pages.php.

{
// Build the request
$path = '?action=query&prop=pageprops';
// Append titles to the request.
$path .= '&titles=' . $this->buildParameter($titles);
if ($ppcontinue)
{
$path .= '&ppcontinue=';
}
if (isset($ppprop))
{
$path .= '&ppprop=' . $ppprop;
}
// Send the request.
$response = $this->client->get($this->fetchUrl($path));
return $this->validateResponse($response);
}
JMediawikiPages::getPageTemplates ( array  $titles,
array  $tlnamespace = null,
  $tllimit = null,
  $tlcontinue = null,
  $tltemplates = null,
  $tldir = null 
)

Method to get all page templates from the given page.

Paramètres:
array$titlesPage titles to retrieve templates.
array$tlnamespaceShow templates in this namespace(s) only.
integer$tllimitHow many templates to return.
boolean$tlcontinueWhen more results are available, use this to continue.
string$tltemplatesOnly list these templates.
string$tldirThe direction in which to list.
Renvoie:
object
Depuis:
12.3

Définition à la ligne 458 du fichier pages.php.

{
// Build the request.
$path = '?action=query&prop=templates';
// Append titles to the request.
$path .= '&titles=' . $this->buildParameter($titles);
if (isset($tlnamespace))
{
$path .= '&tlnamespace=' . $this->buildParameter($tlnamespace);
}
if (isset($tllimit))
{
$path .= '&tllimit=' . $tllimit;
}
if ($tlcontinue)
{
$path .= '&tlcontinue=';
}
if (isset($tltemplates))
{
$path .= '&tltemplates=' . $tltemplates;
}
if (isset($tldir))
{
$path .= '&tldir=' . $tldir;
}
// Send the request.
$response = $this->client->get($this->fetchUrl($path));
return $this->validateResponse($response);
}
JMediawikiPages::getRevisions ( array  $titles,
array  $rvprop = null,
  $rvparse = null,
  $rvlimit = null 
)

Method to get a list of revisions.

Paramètres:
array$titlesPage titles to retrieve revisions.
array$rvpropWhich properties to get for each revision.
boolean$rvparseParse revision content.
int$rvlimitLimit how many revisions will be returned.
Renvoie:
object
Depuis:
12.3

Définition à la ligne 415 du fichier pages.php.

{
// Build the request
$path = '?action=query&prop=revisions';
// Append titles to the request.
$path .= '&titles=' . $this->buildParameter($titles);
if (isset($rvprop))
{
$path .= '&rvprop=' . $this->buildParameter($rvprop);
}
if ($rvparse)
{
$path .= '&rvparse=';
}
if (isset($rvlimit))
{
$path .= '&rvlimit=' . $rvlimit;
}
// Send the request.
$response = $this->client->get($this->fetchUrl($path));
return $this->validateResponse($response);
}
JMediawikiPages::getToken (   $user,
  $intoken 
)

Method to get access token.

Paramètres:
string$userThe User to get token.
string$intokenThe type of token.
Renvoie:
object
Depuis:
12.1

Définition à la ligne 618 du fichier pages.php.

{
// Build the request path.
$path = '?action=query&prop=info&intoken=' . $intoken . '&titles=User:' . $user;
// Send the request.
$response = $this->client->post($this->fetchUrl($path), null);
return (string) $this->validateResponse($response)->query->pages->page[$intoken . 'token'];
}
JMediawikiPages::movePageByID (   $fromid,
  $to,
  $reason = null,
  $movetalk = null,
  $movesubpages = null,
  $noredirect = null,
  $watchlist = null,
  $ignorewarnings = null 
)

Method to move a page.

Paramètres:
int$fromidPage ID of the page you want to move.
string$toTitle you want to rename the page to.
string$reasonReason for the move (optional).
string$movetalkMove the talk page, if it exists.
string$movesubpagesMove subpages, if applicable.
boolean$noredirectDon't create a redirect.
string$watchlistUnconditionally add or remove the page from your watchlist.
boolean$ignorewarningsIgnore any warnings.
Renvoie:
object
Depuis:
12.3

Définition à la ligne 223 du fichier pages.php.

{
// Get the token.
$token = $this->getToken($fromid, 'move');
// Build the request path.
$path = '?action=move';
// Build the request data.
$data = array(
'fromid' => $fromid,
'to' => $reason,
'token' => $token,
'reason' => $reason,
'movetalk' => $movetalk,
'movesubpages' => $movesubpages,
'noredirect' => $noredirect,
'watchlist' => $watchlist,
'ignorewarnings' => $ignorewarnings
);
// Send the request.
$response = $this->client->post($this->fetchUrl($path), $data);
return $this->validateResponse($response);
}
JMediawikiPages::movePageByName (   $from,
  $to,
  $reason = null,
  $movetalk = null,
  $movesubpages = null,
  $noredirect = null,
  $watchlist = null,
  $ignorewarnings = null 
)

Method to move a page.

Paramètres:
string$fromTitle of the page you want to move.
string$toTitle you want to rename the page to.
string$reasonReason for the move (optional).
string$movetalkMove the talk page, if it exists.
string$movesubpagesMove subpages, if applicable.
boolean$noredirectDon't create a redirect.
string$watchlistUnconditionally add or remove the page from your watchlist.
boolean$ignorewarningsIgnore any warnings.
Renvoie:
object
Depuis:
12.3

Définition à la ligne 179 du fichier pages.php.

{
// Get the token.
$token = $this->getToken($from, 'move');
// Build the request path.
$path = '?action=move';
// Build the request data.
$data = array(
'from' => $from,
'to' => $reason,
'token' => $token,
'reason' => $reason,
'movetalk' => $movetalk,
'movesubpages' => $movesubpages,
'noredirect' => $noredirect,
'watchlist' => $watchlist,
'ignorewarnings' => $ignorewarnings
);
// Send the request.
$response = $this->client->post($this->fetchUrl($path), $data);
return $this->validateResponse($response);
}
JMediawikiPages::rollback (   $title,
  $user,
  $summary = null,
  $markbot = null,
  $watchlist = null 
)

Method to undo the last edit to the page.

Paramètres:
string$titleTitle of the page you want to rollback.
string$userName of the user whose edits are to be rolled back.
string$summaryCustom edit summary. If not set, default summary will be used.
string$markbotMark the reverted edits and the revert as bot edits.
string$watchlistUnconditionally add or remove the page from your watchlist.
Renvoie:
object
Depuis:
12.3

Définition à la ligne 264 du fichier pages.php.

{
// Get the token.
$token = $this->getToken($title, 'rollback');
// Build the request path.
$path = '?action=rollback';
// Build the request data.
$data = array(
'title' => $title,
'token' => $token,
'user' => $user,
'expiry' => $summary,
'markbot' => $markbot,
'watchlist' => $watchlist
);
// Send the request.
$response = $this->client->post($this->fetchUrl($path), $data);
return $this->validateResponse($response);
}
JMediawikiPages::undeletePage (   $title,
  $reason = null,
  $timestamp = null,
  $watchlist = null 
)

Method to restore certain revisions of a deleted page.

Paramètres:
string$titleTitle of the page you want to restore.
string$reasonReason for restoring (optional).
string$timestampTimestamps of the revisions to restore.
string$watchlistUnconditionally add or remove the page from your watchlist.
Renvoie:
object
Depuis:
12.3

Définition à la ligne 140 du fichier pages.php.

{
// Get the token.
$token = $this->getToken($title, 'undelete');
// Build the request path.
$path = '?action=undelete';
// Build the request data.
$data = array(
'title' => $title,
'token' => $token,
'reason' => $reason,
'timestamp' => $timestamp,
'watchlist' => $watchlist,
);
// Send the request.
$response = $this->client->post($this->fetchUrl($path), $data);
return $this->validateResponse($response);
}

La documentation de cette classe a été générée à partir du fichier suivant :