if($mode=="new"){
$table_name = $modx->getFullTableName( 'site_content' );
$fields = array(
'type' => 'document',
'contentType' => 'text/html',
'content' => '<div class="contentcontainer">[!WebLoginPE?!]</div>
<div class="contentcontainer" style="text-align:left; background-color:#444; padding:40px 0 40px 20%">
[!Ditto? &tpl=`clientTPL` &summarize=`15` &total=`9` &sortBy=`createdon` &sortDir=`ASC` &descendentDepth=`3` !]
</div>
',
'pagetitle' => 'Your Design Pages',
'longtitle' => 'Main Design Pages Area',
'published' => '1', //is the page published?
'parent' => '58', //what is the parent of this new page?
'isfolder' => '1', // lets make this a folder
'template' => '21', //type template id here
'cacheable' => '0',
'createdby' => $wuid,
'createdon' => time(),
'editedon' => time(),
'publishedon' => time(),
'hidemenu' => '1',
'privateweb' => '1',
);
$modx->db->insert( $fields, $table_name); // put the fields in the db (id wil be created incremental.)
//Create placeholder and put the id in a session to use for mail or whatever.
$_SESSION['eigenpaginaid'] = $modx->db->getInsertId();
$modx->setPlaceholder('eigenpaginaid', $modx->db->getInsertId());
$parent= $modx->db->getInsertId();
//start of page creation, copy this part and past below for as many docs you want (I know we could use a loop but than the logtitle and page title are all the same)
$fields = array(
'type' => 'document',
'contentType' => 'text/html',
'content' => '<div class="contentcontainer">[[Jot? &pagination=`10` &captcha=`1` &action=`form,comments` &subjectModerate=`0` &tplComments=`clienttickethistory` &tplForm=`clientticket` ]]</div>',
'pagetitle' => 'Ticket System',
'longtitle' => 'Raise A Ticket',
'published' => '1', //is the page published?
'parent' => $parent, //here we go create a doc in the first doc
'isfolder' => '0',
'template' => '21', //type template id here
'cacheable' => '0',
'createdby' => $wuid,
'createdon' => time(),
'editedon' => time(),
'publishedon' => time(),
'hidemenu' => '1',
'privateweb' => '1',
);
$modx->db->insert( $fields, $table_name); // put the fields in the db (id wil be created incremental.)
//end of page creation
return;
}<?php
if($_SESSION["usertype"] == "manager") {$manager = "1";}
$wuid = "-".$modx->getLoginUserID();
$owner = $modx->documentObject['createdby'];
if($wuid == $owner || $manager == "1"){
return;
}else{
//$modx->sendRedirect($modx->makeUrl($modx->config['site_start']));
return "userid=".$wuid." owner=".$owner;
}
?>
<?php
if($_SESSION["usertype"] == "manager") {$manager = "1";}
$wuid = "-".$modx->getLoginUserID();
$owner = $modx->documentObject['createdby'];
if($wuid == $owner || $manager == "1"){
return;
}else{
$modx->sendRedirect($modx->makeUrl($modx->config['site_start']));
}
?>
if($mode=="new"){
$wuid = '-'.$userid;
$table_name = $modx->getFullTableName( 'site_content' );
$fields = array(
'type' => 'document',
'contentType' => 'text/html',
'content' => '<div class="contentcontainer">[!WebLoginPE?!]</div>
<div class="contentcontainer" style="text-align:left; background-color:#444; padding:40px 0 40px 20%">
[!Ditto? &tpl=`clientTPL` &summarize=`15` &total=`9` &sortBy=`createdon` &sortDir=`ASC` &descendentDepth=`3` !]
</div>
',
'pagetitle' => 'Your Design Pages',
'longtitle' => 'Main Design Pages Area',
'published' => '1', //is the page published?
'parent' => '58', //what is the parent of this new page?
'isfolder' => '1', // lets make this a folder
'template' => '21', //type template id here
'cacheable' => '0',
'createdby' => $wuid,
'createdon' => time(),
'editedon' => time(),
'publishedon' => time(),
'hidemenu' => '1',
'privateweb' => '1',
);
$modx->db->insert( $fields, $table_name); // put the fields in the db (id wil be created incremental.)
//Create placeholder and put the id in a session to use for mail or whatever.
$_SESSION['eigenpaginaid'] = $modx->db->getInsertId();
$modx->setPlaceholder('eigenpaginaid', $modx->db->getInsertId());
$parent= $modx->db->getInsertId();
//start of page creation, copy this part and past below for as many docs you want (I know we could use a loop but than the logtitle and page title are all the same)
$fields = array(
'type' => 'document',
'contentType' => 'text/html',
'content' => '<div class="contentcontainer">[[Jot? &pagination=`10` &captcha=`1` &action=`form,comments` &subjectModerate=`0` &tplComments=`clienttickethistory` &tplForm=`clientticket` ]]</div>',
'pagetitle' => 'Ticket System',
'longtitle' => 'Raise A Ticket',
'published' => '1', //is the page published?
'parent' => $parent, //here we go create a doc in the first doc
'isfolder' => '0',
'template' => '21', //type template id here
'cacheable' => '0',
'createdby' => $wuid,
'createdon' => time(),
'editedon' => time(),
'publishedon' => time(),
'hidemenu' => '1',
'privateweb' => '1',
);
$modx->db->insert( $fields, $table_name); // put the fields in the db (id wil be created incremental.)
//end of page creation
return;
}[!WebLoginPE? &type=`register` &userImage=`500000,250,250` ®isterTpl=`registerTPL` ®HomeId=`29` &groups=`Registered Member` &dateFormat=`%d-%m-%Y` ®SuccessPause=`2` &customFields=`address1,address2,address3`!]
if($mode=="new"){
$wuid = '-'.$userid;
$table_name = $modx->getFullTableName( 'site_content' );
$fields = array(
'type' => 'document',
'contentType' => 'text/html',
'content' => '<div class="contentcontainer">[!WebLoginPE?!]</div>
<div class="contentcontainer" style="text-align:left; background-color:#444; padding:40px 0 40px 20%">
[!Ditto? &tpl=`clientTPL` &summarize=`15` &total=`9` &sortBy=`createdon` &sortDir=`ASC` &descendentDepth=`3` !]
</div>
',
'pagetitle' => 'Your Design Pages',
'longtitle' => 'Main Design Pages Area',
'published' => '1', //is the page published?
'parent' => '58', //what is the parent of this new page?
'isfolder' => '1', // lets make this a folder
'template' => '21', //type template id here
'cacheable' => '0',
'createdby' => $wuid,
'createdon' => time(),
'editedon' => time(),
'publishedon' => time(),
'hidemenu' => '1',
);
$modx->db->insert( $fields, $table_name); // put the fields in the db (id wil be created incremental.)
//Create placeholder and put the id in a session to use for mail or whatever.
$_SESSION['eigenpaginaid'] = $modx->db->getInsertId();
$modx->setPlaceholder('eigenpaginaid', $modx->db->getInsertId());
$parent= $modx->db->getInsertId();
//start of page creation, copy this part and past below for as many docs you want (I know we could use a loop but than the logtitle and page title are all the same)
$fields = array(
'type' => 'document',
'contentType' => 'text/html',
'content' => '<div class="contentcontainer">[[Jot? &pagination=`10` &captcha=`1` &action=`form,comments` &subjectModerate=`0` &tplComments=`clienttickethistory` &tplForm=`clientticket` ]]</div>',
'pagetitle' => 'Ticket System',
'longtitle' => 'Raise A Ticket',
'published' => '1', //is the page published?
'parent' => $parent, //here we go create a doc in the first doc
'isfolder' => '0',
'template' => '21', //type template id here
'cacheable' => '0',
'createdby' => $wuid,
'createdon' => time(),
'editedon' => time(),
'publishedon' => time(),
'hidemenu' => '1',
);
$modx->db->insert( $fields, $table_name); // put the fields in the db (id wil be created incremental.)
//end of page creation
return;
}<?php
if($_SESSION["usertype"] == "manager") {$manager = "1";}
$wuid = "-".$modx->getLoginUserID();
$owner = $modx->documentObject['createdby'];
if($wuid == $owner || $manager == "1"){
return;
}else{
$modx->sendRedirect($modx->makeUrl($modx->config['site_start']));
}
?>