$_SESSION['account_id'])) == 0) { // this account does NOT have any license yet; create default license License::copyLicense(array("filelicenseid" => 713092476, "toaccountid" => $_SESSION['account_id'])); } // include pricemodel functionality require_once CROOT."/midware/Pricemodel.class.php"; if (Pricemodel::countPricemodels(array("setupaccountid" => $_SESSION['account_id'])) == 0) { // this account does NOT have any pricemodel yet; create default pricemodel Pricemodel::copyPricemodel(array("filepricemodelid" => 781697536, "toaccountid" => $_SESSION['account_id'])); } // get the search parameters $params = json_decode($_REQUEST['subtarget'], true); if (!isset($params['selectsource'])) { $params['selectsource'] = "localupload"; } if (isset($params['replace'])) { $params['replace'] = intval($params['replace']); } else { $params['replace'] = 0; } if (intval($params['replace']) > 0) { // some fileid passed where users wants to replace the original file require_once CROOT."/midware/Factory.class.php"; // load file data $file = Factory::getFileByID($params['replace']); $data = $file->getData(); if (intval($data['setupaccountid']) === intval($_SESSION['account_id'])) { // original uploader and current user match -- proceed } else { unset($params['replace']); } } // object id if (isset($params['id'])) { $id = intval($params['id']); } else { $id = 0; } if (isset($params['processid'])) { // load process for editing the new object $process = Tools::getNextStep(array("currentstep" => "submitfiles", "processid" => $params['processid'])); } if ($id > 0) { // user is uploading to an object require_once CROOT."/midware/Factory.class.php"; require_once CROOT."/midware/Search.class.php"; // set the tab which this template belongs to; $tab = 'objects'; // global $metadata; moved to frame_vars // log action => increment object page view Tools::log_action($id, 1); try { $structure = Factory::getObjectByID($id); } catch (Exception $e) { $error = true; $msg = $e->getMessage(); } if (is_object($structure)) { $content_vars['object'] = $structure->getDisplayData(); } } $content_vars['removedatepicker'] = true; $content_vars['author_name'] = $_SESSION['account_fileownername']; // overwrite, when we have another name later??? // get licenses $licenses = License::getLicenseNameKey($_SESSION['account_id']); // get pricemodels $pricemodels = Pricemodel::getPricemodelNameKey($_SESSION['account_id']); // get ownerships $query = "SELECT id, longtext FROM fileownership WHERE NOT id = 2 ORDER BY sort;"; $content_vars['ownerships'] = query($query); // get categories // > we have them already in framevars // var_dump($frame_vars['cattree']); if (isset($frame_vars['cattree'])) { $content_vars['cattree'] = $frame_vars['cattree']; } else { $content_vars['cattree'] = ""; } // get collections $query = sprintf("SELECT l.name, l.id FROM lightbox l WHERE (NOT l.deleted) AND foraccountid = %u AND NOT visibility = 'invisible' ORDER BY l.setupdate DESC NULLS LAST;", $_SESSION['account_id']); $albums = query($query); #var_dump($content_vars['collections']); if (isset($_SESSION['lng'])) { $lng = $_SESSION['lng']; } else { $lng = "en"; } // get available languages $query = sprintf('SELECT languageid, "name", isocode FROM language WHERE NOT deleted ORDER BY languageid', $lng); $content_vars['languages'] = query($query); /* dooley 2011-04-04 when &o=numeric, we come possible from phorio object page and want to upload a file to this object with this is */ if (isset($id) && is_numeric($id)){ if (isset($structure) && is_object($structure)) { // only when object exists $content_vars['to_object'] = $id; } } /* below is not used ? */ /* switch (strip_tags($_GET['c'])){ case "showupload"; show_uploaded_files(); default: uploader_standard(); break; } */ function show_uploaded_files(){ global $app_vars; if ($_FILES){ // handle file upload here (make thumbs, save, move and that... $app_vars['showuploadedfiles'] = true; $app_vars['files'] = $_FILES; $app_vars['postdata'] = $_POST; } } function get_lightbox_names_html(){ $coll = array( 'lightbox_id1' => 'my upload collection', 'lightbox_id2' => 'dooleys public collection', 'lightbox_id3' => 'another collection' ); $tmp = ''; return $tmp; } function uploader_standard(){ global $app_vars; $app_vars['upload_collections'] = get_lightbox_names_html(); $app_vars['accordion'] = true; } // creating the file row into file table require_once CROOT."/midware/Filecategory.class.php"; $filecategories = Filecategory::getCategories(array("filecategoryid" => 7)); $filecategories = $filecategories[7]['children']; require_once CROOT."/midware/File.class.php"; $fileownerships = File::getFileownerships(); require_once CROOT."/midware/Account.class.php"; // read account data of current user $accountdata = Account::getAccountData(array("accountid" => $_SESSION['account_id'])); /* echo "
"; var_dump($accountdata); echo ""; */ ?>