update
This commit is contained in:
parent
48adc55bdc
commit
3c89d9d77b
1 changed files with 158 additions and 141 deletions
|
|
@ -285,6 +285,133 @@ class Setting
|
|||
$this->is_value_added = true;
|
||||
}
|
||||
|
||||
public function addBackgroundSetting($desc, $default)
|
||||
{
|
||||
if ($this->is_value_added)
|
||||
return;
|
||||
$idx = $this->getCurrentCount();
|
||||
if ($idx == 0) {
|
||||
$imgval = $this->cs_value;
|
||||
$img = $this->cs_value ? "<img src=\"{$imgval}\" class=\"prev_thumb\"/>" : "이미지 미등록";
|
||||
$color1 = $this->cs_etc_1;
|
||||
$repeat = $this->cs_etc_2;
|
||||
$align = $this->cs_etc_3;
|
||||
$size = $this->cs_etc_4;
|
||||
$position = $this->cs_etc_5 == "fixed" ? " selected" : "";
|
||||
|
||||
$repeats = ["", "", ""];
|
||||
$aligns = ["", "", "", "", "", "", "", ""];
|
||||
$sizes = ["", "", ""];
|
||||
|
||||
switch ($repeat) {
|
||||
case "no-repeat":
|
||||
$repeats[0] = " selected";
|
||||
break;
|
||||
case "repeat-x":
|
||||
$repeats[1] = " selected";
|
||||
break;
|
||||
case "repeat-y":
|
||||
$repeats[2] = " selected";
|
||||
break;
|
||||
}
|
||||
|
||||
switch ($align) {
|
||||
case "left center":
|
||||
$aligns[0] = " selected";
|
||||
break;
|
||||
case "left bottom":
|
||||
$aligns[1] = " selected";
|
||||
break;
|
||||
case "center top":
|
||||
$aligns[2] = " selected";
|
||||
break;
|
||||
case "center center":
|
||||
$aligns[3] = " selected";
|
||||
break;
|
||||
case "center bottom":
|
||||
$aligns[4] = " selected";
|
||||
break;
|
||||
case "right top":
|
||||
$aligns[5] = " selected";
|
||||
break;
|
||||
case "right center":
|
||||
$aligns[6] = " selected";
|
||||
break;
|
||||
case "right bottom":
|
||||
$aligns[7] = " selected";
|
||||
break;
|
||||
}
|
||||
|
||||
switch ($size) {
|
||||
case "contain":
|
||||
$sizes[0] = " selected";
|
||||
break;
|
||||
case "cover":
|
||||
$sizes[0] = " selected";
|
||||
break;
|
||||
case "100% 100%":
|
||||
$sizes[0] = " selected";
|
||||
break;
|
||||
}
|
||||
|
||||
$this->settings[] = [
|
||||
"type" => "background",
|
||||
"html" => "
|
||||
<td rowspan=\"4\" class=\"bo-right bo-left txt-center\">
|
||||
{$img}
|
||||
</td>
|
||||
<td>
|
||||
<div class=\"setter\">직접등록<input type=\"file\" name=\"cs_value_file[{$this->idx}]\" value=\"\" size=\"50\"></div>
|
||||
</td></tr><tr>
|
||||
<td>
|
||||
<div class=\"setter\">외부경로<input type=\"text\" name=\"cs_value[{$this->idx}]\" value=\"{$imgval}\" size=\"50\"/></div>
|
||||
</td></tr><tr>
|
||||
<td>
|
||||
<div class=\"setter\">색상<input type=\"text\" name=\"cs_etc_1[{$this->idx}]\" value=\"{$color1}\" class=\"neo_color\" size=\"30\" maxlength=\"255\" placeholder=\"#색상코드\" /></div>
|
||||
</td></tr><tr>
|
||||
<td>
|
||||
<div class=\"setter\">배경반복
|
||||
<select name=\"cs_etc_2[{$this->idx}]\">
|
||||
<option value=\"\">반복</option>
|
||||
<option value=\"no-repeat\"{$repeats[0]}>반복없음</option>
|
||||
<option value=\"repeat-x\"{$repeats[1]}>가로반복</option>
|
||||
<option value=\"repeat-y\"{$repeats[2]}>세로반복</option>
|
||||
</select>
|
||||
배경위치
|
||||
<select name=\"cs_etc_3[{$this->idx}]\">
|
||||
<option value=\"\">왼쪽 상단</option>
|
||||
<option value=\"left center\"{$aligns[0]}>왼쪽 중단</option>
|
||||
<option value=\"left bottom\"{$aligns[1]}>왼쪽 하단</option>
|
||||
|
||||
<option value=\"center top\"{$aligns[2]}>중간 상단</option>
|
||||
<option value=\"center center\"{$aligns[3]}>중간 중단</option>
|
||||
<option value=\"center bottom\"{$aligns[4]}>중간 하단</option>
|
||||
|
||||
<option value=\"right top\"{$aligns[5]}>오른쪽 상단</option>
|
||||
<option value=\"right center\"{$aligns[6]}>오른쪽 중단</option>
|
||||
<option value=\"right bottom\"{$aligns[7]}>오른쪽 하단</option>
|
||||
</select>
|
||||
</div>
|
||||
<br />
|
||||
<div class=\"setter\">
|
||||
배경크기
|
||||
<select name=\"cs_etc_4[{$this->idx}]\">
|
||||
<option value=\"\">원본크기</option>
|
||||
<option value=\"contain\"{$sizes[0]}>맞춤</option>
|
||||
<option value=\"cover\"{$sizes[1]}>꽉참</option>
|
||||
<option value=\"100% 100%\"{$sizes[2]}>늘이기</option>
|
||||
</select>
|
||||
고정
|
||||
<select name=\"cs_etc_5[{$this->idx}]\">
|
||||
<option value=\"\">스크롤</option>
|
||||
<option value=\"fixed\"{$position}>고정</option>
|
||||
</select>
|
||||
</div>
|
||||
</td>"
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
public function addFontSetting($desc, $default, $placeholder = "")
|
||||
{
|
||||
$idx = $this->getCurrentCount() + 1;
|
||||
|
|
@ -585,144 +712,34 @@ class Setting
|
|||
}
|
||||
}
|
||||
|
||||
public function addBackgroundSetting($desc, $default)
|
||||
{
|
||||
if ($this->is_value_added)
|
||||
return;
|
||||
$idx = $this->getCurrentCount();
|
||||
if ($idx == 0) {
|
||||
$imgval = $this->cs_value;
|
||||
$img = $this->cs_value ? "<img src=\"{$imgval}\" class=\"prev_thumb\"/>" : "이미지 미등록";
|
||||
$color1 = $this->cs_etc_1;
|
||||
$repeat = $this->cs_etc_2;
|
||||
$align = $this->cs_etc_3;
|
||||
$size = $this->cs_etc_4;
|
||||
$position = $this->cs_etc_5 == "fixed" ? " selected" : "";
|
||||
|
||||
$repeats = ["", "", ""];
|
||||
$aligns = ["", "", "", "", "", "", "", ""];
|
||||
$sizes = ["", "", ""];
|
||||
|
||||
switch ($repeat) {
|
||||
case "no-repeat":
|
||||
$repeats[0] = " selected";
|
||||
break;
|
||||
case "repeat-x":
|
||||
$repeats[1] = " selected";
|
||||
break;
|
||||
case "repeat-y":
|
||||
$repeats[2] = " selected";
|
||||
break;
|
||||
}
|
||||
|
||||
switch ($align) {
|
||||
case "left center":
|
||||
$aligns[0] = " selected";
|
||||
break;
|
||||
case "left bottom":
|
||||
$aligns[1] = " selected";
|
||||
break;
|
||||
case "center top":
|
||||
$aligns[2] = " selected";
|
||||
break;
|
||||
case "center center":
|
||||
$aligns[3] = " selected";
|
||||
break;
|
||||
case "center bottom":
|
||||
$aligns[4] = " selected";
|
||||
break;
|
||||
case "right top":
|
||||
$aligns[5] = " selected";
|
||||
break;
|
||||
case "right center":
|
||||
$aligns[6] = " selected";
|
||||
break;
|
||||
case "right bottom":
|
||||
$aligns[7] = " selected";
|
||||
break;
|
||||
}
|
||||
|
||||
switch ($size) {
|
||||
case "contain":
|
||||
$sizes[0] = " selected";
|
||||
break;
|
||||
case "cover":
|
||||
$sizes[0] = " selected";
|
||||
break;
|
||||
case "100% 100%":
|
||||
$sizes[0] = " selected";
|
||||
break;
|
||||
}
|
||||
|
||||
$this->settings[] = [
|
||||
"type" => "background",
|
||||
"html" => "
|
||||
<td rowspan=\"4\" class=\"bo-right bo-left txt-center\">
|
||||
{$img}
|
||||
</td>
|
||||
<td>
|
||||
<div class=\"setter\">직접등록<input type=\"file\" name=\"cs_value_file[{$this->idx}]\" value=\"\" size=\"50\"></div>
|
||||
</td></tr><tr>
|
||||
<td>
|
||||
<div class=\"setter\">외부경로<input type=\"text\" name=\"cs_value[{$this->idx}]\" value=\"{$imgval}\" size=\"50\"/></div>
|
||||
</td></tr><tr>
|
||||
<td>
|
||||
<div class=\"setter\">색상<input type=\"text\" name=\"cs_etc_1[{$this->idx}]\" value=\"{$color1}\" class=\"neo_color\" size=\"30\" maxlength=\"255\" placeholder=\"#색상코드\" /></div>
|
||||
</td></tr><tr>
|
||||
<td>
|
||||
<div class=\"setter\">배경반복
|
||||
<select name=\"cs_etc_2[{$this->idx}]\">
|
||||
<option value=\"\">반복</option>
|
||||
<option value=\"no-repeat\"{$repeats[0]}>반복없음</option>
|
||||
<option value=\"repeat-x\"{$repeats[1]}>가로반복</option>
|
||||
<option value=\"repeat-y\"{$repeats[2]}>세로반복</option>
|
||||
</select>
|
||||
배경위치
|
||||
<select name=\"cs_etc_3[{$this->idx}]\">
|
||||
<option value=\"\">왼쪽 상단</option>
|
||||
<option value=\"left center\"{$aligns[0]}>왼쪽 중단</option>
|
||||
<option value=\"left bottom\"{$aligns[1]}>왼쪽 하단</option>
|
||||
|
||||
<option value=\"center top\"{$aligns[2]}>중간 상단</option>
|
||||
<option value=\"center center\"{$aligns[3]}>중간 중단</option>
|
||||
<option value=\"center bottom\"{$aligns[4]}>중간 하단</option>
|
||||
|
||||
<option value=\"right top\"{$aligns[5]}>오른쪽 상단</option>
|
||||
<option value=\"right center\"{$aligns[6]}>오른쪽 중단</option>
|
||||
<option value=\"right bottom\"{$aligns[7]}>오른쪽 하단</option>
|
||||
</select>
|
||||
</div>
|
||||
<br />
|
||||
<div class=\"setter\">
|
||||
배경크기
|
||||
<select name=\"cs_etc_4[{$this->idx}]\">
|
||||
<option value=\"\">원본크기</option>
|
||||
<option value=\"contain\"{$sizes[0]}>맞춤</option>
|
||||
<option value=\"cover\"{$sizes[1]}>꽉참</option>
|
||||
<option value=\"100% 100%\"{$sizes[2]}>늘이기</option>
|
||||
</select>
|
||||
고정
|
||||
<select name=\"cs_etc_5[{$this->idx}]\">
|
||||
<option value=\"\">스크롤</option>
|
||||
<option value=\"fixed\"{$position}>고정</option>
|
||||
</select></div>
|
||||
</td>"
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
public function addBackForeLine($desc, $default)
|
||||
{
|
||||
$idx = $this->getCurrentCount() + 1;
|
||||
if ($idx <= self::$etc_max - 3) {
|
||||
$key1 = "cs_etc_{$idx}";
|
||||
|
||||
$idx2 = $idx + 1;
|
||||
$key2 = "cs_etc_{$idx2}";
|
||||
|
||||
$idx3 = $idx + 2;
|
||||
$key3 = "cs_etc_{$idx3}";
|
||||
|
||||
if (is_array($default)) {
|
||||
$cnt = count($default);
|
||||
switch($cnt) {
|
||||
case 3:
|
||||
{
|
||||
$this->$key3 = $default[2];
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
$this->$key2 = $default[1];
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
$this->$key1 = $default[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->settings[] = [
|
||||
"type" => "color3",
|
||||
"html" => "<td class=\"bo-right\">배경</td><td><div class=\"setter\">색상 <input type=\"text\" name=\"cs_etc_{$idx}[{$this->idx}]\" value=\"{$this->$key1}\" class=\"neo_color\" size=\"30\" maxlength=\"255\" placeholder=\"#색상코드\" /></div></td></tr>" .
|
||||
|
|
|
|||
Loading…
Reference in a new issue