public function modify_static() { $dimImg = array(200, 300); $VStatic = new VStatic(); $images = $VStatic->getNewImages(); $texts = $VStatic->getNewTexts(); $numPage = $VStatic->getNumPage(); $iter = 1; $numContents = 3; $UFile = new UFile(); foreach ($images as $img) { if ($img) { $dir = "images/"; $file = $dir . "img{$iter}" . "_static{$numPage}.jpg"; $image = new USimpleImage(); $image->load($img); $image->resize($dimImg[0], $dimImg[1]); $image->save($file); } $iter++; } for ($iter = 1; $iter < $numContents + 1; $iter++) { if ($texts[$iter - 1]) { $dir = "templates/templates/static_contents/"; $file = $dir . "cnt{$iter}" . "_static{$numPage}"; $UFile->writeFileContent($file, $texts[$iter - 1]); } } $CStatic = new CStatic(); return $CStatic->mux(1); }
public function mux($logged) { $session = new USession(); $VIndex = new VIndex(); switch ($VIndex->getController()) { case 'log': $CLog = new CLog(); $log = $CLog->mux(); if ($VIndex->getTask() == 'in' || $VIndex->getTask() == 'out') { $VIndex->deleteController(); $VIndex->deleteTask(); return $this->setPage(); } else { return $log; } case 'rent': if ($logged >= 0) { $CRent = new CRent(); return $CRent->mux(); } else { return $VIndex->fetch('forbidden_user.tpl'); } case 'user': if ($logged >= 0) { $CUser = new CUser(); return $CUser->mux(); } else { return $VIndex->fetch('forbidden_user.tpl'); } case 'admin': if ($logged >= 1) { $CAdmin = new CAdmin(); return $CAdmin->mux(); } else { return $VIndex->fetch('forbidden_admin.tpl'); } case 'static': $CStatic = new CStatic(); return $CStatic->mux($logged); default: $CStatic = new CStatic(); return $CStatic->mux($logged); } }