53 $this->wiki = $a_wiki;
54 $this->user = $a_user;
67 $set = $this->db->query(
"SELECT * FROM wiki_user_html_export ".
68 " WHERE wiki_id = ".$this->db->quote($this->wiki->getId(),
"integer")
70 if (!$this->data = $this->db->fetchAssoc($set))
72 $this->data = array();
84 $this->log->debug(
"getProcess");
87 $this->db->lockTables(
93 if ($this->data[
"start_ts"] !=
"" &&
94 $this->data[
"start_ts"] > $last_change)
97 $this->db->unlockTables();
98 return self::PROCESS_UPTODATE;
101 if (!isset($this->data[
"wiki_id"]))
103 $this->db->manipulate(
"INSERT INTO wiki_user_html_export ".
104 "(wiki_id, usr_id, progress, start_ts, status) VALUES (".
105 $this->db->quote($this->wiki->getId(),
"integer").
",".
106 $this->db->quote($this->user->getId(),
"integer").
",".
107 $this->db->quote(0,
"integer").
",".
108 $this->db->quote($ts,
"timestamp").
",".
109 $this->db->quote(self::RUNNING,
"integer").
114 $this->db->manipulate(
"UPDATE wiki_user_html_export SET ".
115 " start_ts = ".$this->db->quote($ts,
"timestamp").
",".
116 " usr_id = ".$this->db->quote($this->user->getId(),
"integer").
",".
117 " progress = ".$this->db->quote(0,
"integer").
",".
118 " status = ".$this->db->quote(self::RUNNING,
"integer").
119 " WHERE status = ".$this->db->quote(self::NOT_RUNNING,
"integer").
120 " AND wiki_id = ".$this->db->quote($this->wiki->getId(),
"integer")
124 $this->db->unlockTables();
126 if ($this->data[
"start_ts"] == $ts && $this->data[
"usr_id"] == $this->user->getId())
129 return self::PROCESS_STARTED;
133 return self::PROCESS_OTHER_USER;
144 $this->db->manipulate(
"UPDATE wiki_user_html_export SET ".
145 " progress = ".$this->db->quote((
int) $a_progress,
"integer").
",".
146 " status = ".$this->db->quote((
int) $a_status,
"integer").
147 " WHERE wiki_id = ".$this->db->quote($this->wiki->getId(),
"integer").
148 " AND usr_id = ".$this->db->quote($this->user->getId(),
"integer")
162 $set = $this->db->query(
"SELECT progress, status FROM wiki_user_html_export ".
163 " WHERE wiki_id = ".$this->db->quote($this->wiki->getId(),
"integer")
165 $rec = $this->db->fetchAssoc($set);
167 return array(
"progress" => (
int) $rec[
"progress"],
"status" => (
int) $rec[
"status"]);
189 ignore_user_abort(
true);
191 include_once(
"./Modules/Wiki/classes/class.ilWikiHTMLExport.php");
194 $exp->buildExportFile();
205 $this->log->debug(
"deliver");
206 include_once(
"./Modules/Wiki/classes/class.ilWikiHTMLExport.php");
209 $file = $exp->getUserExportFile();
210 $this->log->debug(
"file: ".
$file);
updateStatus($a_progress, $a_status)
Update status.
__construct(ilObjWiki $a_wiki, ilDB $a_db, ilObjUser $a_user)
Construct.
deliverFile()
Deliver file.
initUserHTMLExport()
Init user html export.
static getLastChangeByParent($a_parent_type, $a_parent_id, $a_lang="")
Get all pages for parent object.
static now()
Return current timestamp in Y-m-d H:i:s format.
Class manages user html export.
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
getProgress()
Get Progress.
startUserHTMLExport()
Start user html export.
Wiki HTML exporter class.
static getLogger($a_component_id)
Get component logger.