Example #1
0
define("COLORSHEME_HTML", <<<HTML
<center><a href=""
\tonclick="return popupSheme('http://www.poligrafi.com/new/popup_materials.html');">
\tВыбор цветов и материалов
</a></center>
HTML
);
$db =& DB::connect(CONN_DSN);
if (PEAR::isError($db)) {
    print $db->getMessage();
    exit;
}
$pathBuilder = new HtmlPathBuilder($db, CMD_SEL_CATEGORY);
$pathBuilder->basePath = BASE_URL;
$pathBuilder->linkAttrs = "style='color:#0265a4; text-decoration:underline;'";
FileUtils::removeDir(OUTPUT_DIR);
mkdir(OUTPUT_DIR);
generateCategory();
print "Generating finished.\n";
/*
function getCategoriesCode($rows) {
	$res = "";

	foreach ($rows as $row) {
		$res .= $row->name . " | ";
	}

	return $res;
}
*/
function addEmptyItems(&$items, $columns)
Example #2
0
 /**
  * –екурсивное удаление директории
  * @access static
  */
 function removeDir($root)
 {
     if (!is_dir($root)) {
         return;
     }
     $files = dir($root);
     while (($f = $files->read()) !== false) {
         if ($f == "." || $f == "..") {
             continue;
         }
         $f = $root . "/" . $f;
         if (is_file($f)) {
             unlink($f);
         } else {
             if (is_dir($f)) {
                 FileUtils::removeDir($f);
             }
         }
     }
     $files->close();
     rmdir($root);
 }
Example #3
0
 public static function deleteGood($id)
 {
     $dbPref = new DBPreferencesType();
     $catalogPath = $dbPref->getPreference(Constants::CATALOG_PATH)[DB::TABLE_PREFERENCES__VALUE];
     $goodsType = new DBGoodsType();
     $code = $goodsType->getCode($id);
     //remove directory with images
     FileUtils::removeDir($catalogPath . $code);
     $infoRemove = $goodsType->delete($id);
     return $infoRemove;
 }