Commit 43ac8237 authored by ~rs's avatar ~rs

Update EditInEditor.php

parent 3ba39a90
Pipeline #1928 passed with stages
in 1 minute and 34 seconds
...@@ -10,24 +10,31 @@ require './Core/BotCore.php'; ...@@ -10,24 +10,31 @@ require './Core/BotCore.php';
* @Status Alpha * @Status Alpha
*/ */
class EditInEditor extends Core { class EditInEditor extends Core {
public function __construct ($Account = null, $Job = null, $pUseHTTPS = true, $botflag = true) { public function __construct ($Account = null, $Job = null, $editor = null) {
$this->$Account = $Account; $this->$Account = $Account;
$this->$Job = $Job; $this->$Job = $Job;
$this->$pUseHTTPS = $pUseHTTPS; $this->$pUseHTTPS = $pUseHTTPS;
$this->$botflag = $botflag; $this->$botflag = $botflag;
$this->$editor = $editor;
$this->$counter = 0; $this->$counter = 0;
} }
public function login($Account = $this->$Account, $Job = $this->$Job, $pUseHTTPS = $this->$pUseHTTPS, $botflag = $this->$botflag) { public function login($Account = null, $Job = null, $pUseHTTPS = true, $botflag = true) {
if ($Account === null) {
$Account = $this->$Account;
} else {
$this->$Account = $Account;
}
if ($Job === null) {
$Job = $this->$Job;
} else {
$this->$Job = $Job;
}
if ($botflag) { if ($botflag) {
$this->initcurl($Account, $Job, $pUseHTTPS, "bot"); $this->initcurl($Account, $Job, $pUseHTTPS, "bot");
} else { } else {
$this->initcurl($Account, $Job, $pUseHTTPS, "user"); //login $this->initcurl($Account, $Job, $pUseHTTPS, "user"); //login
} }
// variables further used from save()
$this->$Account = $Account;
$this->$Job = $Job;
$this->$botflag = $botflag;
} }
//set the editor you want to use with the command used to run it //set the editor you want to use with the command used to run it
...@@ -63,9 +70,12 @@ class EditInEditor extends Core { ...@@ -63,9 +70,12 @@ class EditInEditor extends Core {
echo $diff; echo $diff;
} }
*/ */
public function save(bool $minor, $number = $this->$counter) { public function save($minor, $number = null) {
if (!$number) {
$number = $this->$counter;
}
$this->editPageD($this->$pagename[$number], $this->$pagecontent[$number], $this->$Job, $this->$botflag, $minor, 0, false); $this->editPageD($this->$pagename[$number], $this->$pagecontent[$number], $this->$Job, $this->$botflag, $minor, 0, false);
} }
} }
?> ?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment