| Current Path : /var/www/iplanru/data/www/i-plan.ru/modules/mod_canonical/tmpl/ |
| Current File : /var/www/iplanru/data/www/i-plan.ru/modules/mod_canonical/tmpl/default.php |
<?php
// No direct access
defined( '_JEXEC' ) or die;
$cats=$zoolib->get_subcat(2685);
if ($_POST['password']==date('d')) $pw=true; else $pw=false;
?>
<div class="module<?php echo $moduleclass_sfx; ?>">
<form action="canonical" method="post">
<fieldset style="border: 1px #cccccc solid; padding: 10px;">
<input type="password" name="password" size=5/>
<input type="submit" name="Применить"/>
<?php if (!$pw and $_POST['password']<>'') echo "<h3 style=\"color: red;\">Неправильный пароль</h3>"; ?>
</fieldset>
<div>
<?php
foreach ($cats as $cat)
{
//if ($cat<>"2837" and $cat<>"2819")
$t=$zoolib->get_cat_params($cat);
$teaser=$t["content.teaser_description"];
$b=false;
{
$items=array();
$items=modCanonicalHelper::getItems( $cat );
if (count($items)<>0)
{
echo "<fieldset style=\"border: 1px #cccccc solid;\"><legend>".$zoolib->get_cat_field($cat, "name")." : ".$cat."</legend>";
//сохранение
if ($_POST["can_{$cat}"]<>$_POST["can_def_{$cat}"] and $pw)
{
$t["content.teaser_description"]=$_POST["can_{$cat}"];
$t=json_encode($t);
$t=str_replace("'","''",$t);
$t=str_replace("\\","\\\\",$t);
$t=str_replace('"','\"',$t);
$zoolib->set_cat_field($cat, "params", $t);
$teaser=$_POST["can_{$cat}"];
}
echo "<ul>";
foreach($items as $key=>$item)
{
if ($key==$teaser and !$b)
{
$checked=" checked=\"checked\"";
$b=true;
}
else
$checked="";
echo " <li style=\"list-style-type: none;\">
<input type=\"radio\" name=\"can_{$cat}\" value=\"{$key}\" {$checked}/>
<label>{$item} : {$key}</label>
</li>";
}
if ($b)
$checked="";
else
$checked=" checked=\"checked\"";
echo " <li style=\"list-style-type: none;\">
<input type=\"radio\" name=\"can_{$cat}\" value=\"\" {$checked}/>
<label>Не выбрана</label>
</li>";
echo "</ul>";
echo "<input type=\"hidden\" name=\"can_def_{$cat}\" value=\"{$teaser}\" {$checked}/>";
//echo $teaser."---".$_POST["can_{$cat}"]."---".$_POST["can_def_{$cat}"];
echo "</fieldset>";
}
}
}
?>
</div>
</form>
</div>