Beispiel #1
0
function __AdmSettingsDrawRow($module_id, $Option)
{
    $arControllerOption = CControllerClient::GetInstalledOptions($module_id);
    if (!is_array($Option)) {
        ?>
		<tr class="heading">
			<td colspan="2"><?php 
        echo $Option;
        ?>
</td>
		</tr>
	<?php 
    } elseif (isset($Option["note"])) {
        ?>
		<tr>
			<td colspan="2" align="center">
				<?php 
        echo BeginNote('align="center"');
        ?>
				<?php 
        echo $Option["note"];
        ?>
				<?php 
        echo EndNote();
        ?>
			</td>
		</tr>
	<?php 
    } else {
        if ($Option[0] != "") {
            $val = COption::GetOptionString($module_id, $Option[0], $Option[2]);
        } else {
            $val = $Option[2];
        }
        $type = $Option[3];
        $disabled = array_key_exists(4, $Option) && $Option[4] == 'Y' ? ' disabled' : '';
        $sup_text = array_key_exists(5, $Option) ? $Option[5] : '';
        ?>
		<tr>
			<td<?php 
        if ($type[0] == "multiselectbox" || $type[0] == "textarea" || $type[0] == "statictext" || $type[0] == "statichtml") {
            echo ' class="adm-detail-valign-top"';
        }
        ?>
 width="50%"><?php 
        if ($type[0] == "checkbox") {
            echo "<label for='" . htmlspecialcharsbx($Option[0]) . "'>" . $Option[1] . "</label>";
        } else {
            echo $Option[1];
        }
        if (strlen($sup_text) > 0) {
            ?>
<span class="required"><sup><?php 
            echo $sup_text;
            ?>
</sup></span><?php 
        }
        ?>
<a name="opt_<?php 
        echo htmlspecialcharsbx($Option[0]);
        ?>
"></a></td>
			<td width="50%"><?php 
        if ($type[0] == "checkbox") {
            ?>
<input type="checkbox" <?php 
            if (isset($arControllerOption[$Option[0]])) {
                echo ' disabled title="' . GetMessage("MAIN_ADMIN_SET_CONTROLLER_ALT") . '"';
            }
            ?>
 id="<?php 
            echo htmlspecialcharsbx($Option[0]);
            ?>
" name="<?php 
            echo htmlspecialcharsbx($Option[0]);
            ?>
" value="Y"<?php 
            if ($val == "Y") {
                echo " checked";
            }
            echo $disabled;
            if ($type[2] != '') {
                echo " " . $type[2];
            }
            ?>
><?php 
        } elseif ($type[0] == "text" || $type[0] == "password") {
            ?>
<input type="<?php 
            echo $type[0];
            ?>
"<?php 
            if (isset($arControllerOption[$Option[0]])) {
                echo ' disabled title="' . GetMessage("MAIN_ADMIN_SET_CONTROLLER_ALT") . '"';
            }
            ?>
 size="<?php 
            echo $type[1];
            ?>
" maxlength="255" value="<?php 
            echo htmlspecialcharsbx($val);
            ?>
" name="<?php 
            echo htmlspecialcharsbx($Option[0]);
            ?>
"<?php 
            echo $disabled;
            echo $type[0] == "password" || $type["noautocomplete"] ? ' autocomplete="off"' : '';
            ?>
><?php 
        } elseif ($type[0] == "selectbox") {
            $arr = $type[1];
            if (!is_array($arr)) {
                $arr = array();
            }
            ?>
<select name="<?php 
            echo htmlspecialcharsbx($Option[0]);
            ?>
" <?php 
            if (isset($arControllerOption[$Option[0]])) {
                echo ' disabled title="' . GetMessage("MAIN_ADMIN_SET_CONTROLLER_ALT") . '"';
            }
            ?>
 <?php 
            echo $disabled;
            ?>
><?php 
            foreach ($arr as $key => $v) {
                ?>
<option value="<?php 
                echo $key;
                ?>
"<?php 
                if ($val == $key) {
                    echo " selected";
                }
                ?>
><?php 
                echo htmlspecialcharsbx($v);
                ?>
</option><?php 
            }
            ?>
</select><?php 
        } elseif ($type[0] == "multiselectbox") {
            $arr = $type[1];
            if (!is_array($arr)) {
                $arr = array();
            }
            $arr_val = explode(",", $val);
            ?>
<select size="5" <?php 
            if (isset($arControllerOption[$Option[0]])) {
                echo ' disabled title="' . GetMessage("MAIN_ADMIN_SET_CONTROLLER_ALT") . '"';
            }
            ?>
 multiple name="<?php 
            echo htmlspecialcharsbx($Option[0]);
            ?>
[]"<?php 
            echo $disabled;
            ?>
><?php 
            foreach ($arr as $key => $v) {
                ?>
<option value="<?php 
                echo $key;
                ?>
"<?php 
                if (in_array($key, $arr_val)) {
                    echo " selected";
                }
                ?>
><?php 
                echo htmlspecialcharsbx($v);
                ?>
</option><?php 
            }
            ?>
</select><?php 
        } elseif ($type[0] == "textarea") {
            ?>
<textarea <?php 
            if (isset($arControllerOption[$Option[0]])) {
                echo ' disabled title="' . GetMessage("MAIN_ADMIN_SET_CONTROLLER_ALT") . '"';
            }
            ?>
 rows="<?php 
            echo $type[1];
            ?>
" cols="<?php 
            echo $type[2];
            ?>
" name="<?php 
            echo htmlspecialcharsbx($Option[0]);
            ?>
"<?php 
            echo $disabled;
            ?>
><?php 
            echo htmlspecialcharsbx($val);
            ?>
</textarea><?php 
        } elseif ($type[0] == "statictext") {
            echo htmlspecialcharsbx($val);
        } elseif ($type[0] == "statichtml") {
            echo $val;
        }
        ?>
</td>
		</tr>
	<?php 
    }
}
Beispiel #2
0
function __AdmSettingsDrawRow($module_id, $Option)
{
	$arControllerOption = CControllerClient::GetInstalledOptions($module_id);
	if(!is_array($Option)):
	?>
		<tr class="heading">
			<td valign="top" colspan="2" align="center"><b><?php 
echo $Option;
?>
</b></td>
		</tr>
	<?
	elseif(isset($Option["note"])):
	?>
		<tr>
			<td valign="top" colspan="2" align="center">
				<?echo BeginNote('align="center"');?>
				<?php 
echo $Option["note"];
?>
				<?echo EndNote();?>
			</td>
		</tr>
	<?
	else:
		$val = COption::GetOptionString($module_id, $Option[0], $Option[2]);
		$type = $Option[3];
		$disabled = array_key_exists(4, $Option) && $Option[4] == 'Y' ? ' disabled' : '';
		$sup_text = array_key_exists(5, $Option) ? $Option[5] : '';
	?>
		<tr>
			<td valign="top" width="50%" class="field-name"><?
				if($type[0]=="checkbox")
					echo "<label for='".htmlspecialcharsbx($Option[0])."'>".$Option[1]."</label>";
				else
					echo $Option[1];
				if (strlen($sup_text) > 0)
				{
					?><span class="required"><sup><?php 
echo $sup_text;
?>
</sup></span><?
				}
					?></td>
			<td valign="middle" width="50%"><?
			if($type[0]=="checkbox"):
				?><input type="checkbox" <?if(isset($arControllerOption[$Option[0]]))echo ' disabled title="'.GetMessage("MAIN_ADMIN_SET_CONTROLLER_ALT").'"';?> id="<?echo htmlspecialcharsbx($Option[0])?>" name="<?echo htmlspecialcharsbx($Option[0])?>" value="Y"<?if($val=="Y")echo" checked";?><?php 
echo $disabled;
?>
<?if($type[2]<>'') echo " ".$type[2]?>><?
			elseif($type[0]=="text" || $type[0]=="password"):
				?><input type="<?echo $type[0]?>"<?if(isset($arControllerOption[$Option[0]]))echo ' disabled title="'.GetMessage("MAIN_ADMIN_SET_CONTROLLER_ALT").'"';?> size="<?echo $type[1]?>" maxlength="255" value="<?echo htmlspecialcharsbx($val)?>" name="<?echo htmlspecialcharsbx($Option[0])?>"<?php 
echo $disabled;
echo $type[0] == "password" ? ' autocomplete="off"' : '';
?>
><?
			elseif($type[0]=="selectbox"):
				$arr = $type[1];
				if(!is_array($arr))
					$arr = array();
				$arr_keys = array_keys($arr);
				?><select name="<?echo htmlspecialcharsbx($Option[0])?>" <?if(isset($arControllerOption[$Option[0]]))echo ' disabled title="'.GetMessage("MAIN_ADMIN_SET_CONTROLLER_ALT").'"';?> <?php 
echo $disabled;
?>
><?
					for($j=0; $j<count($arr_keys); $j++):
						?><option value="<?echo $arr_keys[$j]?>"<?if($val==$arr_keys[$j])echo" selected"?>><?echo htmlspecialcharsbx($arr[$arr_keys[$j]])?></option><?
					endfor;
					?></select><?
			elseif($type[0]=="multiselectbox"):
				$arr = $type[1];
				if(!is_array($arr))
					$arr = array();
				$arr_keys = array_keys($arr);
				$arr_val = explode(",",$val);
				?><select size="5" <?if(isset($arControllerOption[$Option[0]]))echo ' disabled title="'.GetMessage("MAIN_ADMIN_SET_CONTROLLER_ALT").'"';?> multiple name="<?echo htmlspecialcharsbx($Option[0])?>[]"<?php 
echo $disabled;
?>
><?
					for($j=0; $j<count($arr_keys); $j++):
						?><option value="<?echo $arr_keys[$j]?>"<?if(in_array($arr_keys[$j],$arr_val)) echo " selected"?>><?echo htmlspecialcharsbx($arr[$arr_keys[$j]])?></option><?
					endfor;
				?></select><?
			elseif($type[0]=="textarea"):
				?><textarea <?if(isset($arControllerOption[$Option[0]]))echo ' disabled title="'.GetMessage("MAIN_ADMIN_SET_CONTROLLER_ALT").'"';?> rows="<?echo $type[1]?>" cols="<?echo $type[2]?>" name="<?echo htmlspecialcharsbx($Option[0])?>"<?php 
echo $disabled;
?>
><?echo htmlspecialcharsbx($val)?></textarea><?
			elseif($type[0]=="statictext"):
				echo htmlspecialcharsbx($val);
			elseif($type[0]=="statichtml"):
				echo $val;
			endif;
			?></td>
		</tr>
	<?
	endif;
}