bring everything into line with mocha

This commit is contained in:
Michael Becker 2024-01-25 23:42:36 -05:00
parent d99b1317ea
commit 413cf121c3
5 changed files with 76 additions and 10 deletions

View File

@ -879,6 +879,7 @@
$escape = false; $escape = false;
$insideVariable = false; $insideVariable = false;
$vars = [ ];
$varname = null; $varname = null;
$varvalue = null; $varvalue = null;
@ -983,7 +984,6 @@
$varvalue = null; $varvalue = null;
} }
return $vars; return $vars;
} }
private static function __ReplaceAny($str, $before, $after, $with) private static function __ReplaceAny($str, $before, $after, $with)
@ -1095,11 +1095,14 @@
$sortedPages = null; $sortedPages = null;
if (System::ParsePathVariablesIntoPage( $actualPage, $pathVars )) if (System::ParsePathVariablesIntoPage( $actualPage, $pathVars ))
{
if (is_array($pathVars))
{ {
foreach ($pathVars as $key => $value) foreach ($pathVars as $key => $value)
{ {
$actualPage->PathVariables[] = new WebVariable($key, $value); $actualPage->PathVariables[] = new WebVariable($key, $value);
} }
}
System::$CurrentPage = $actualPage; System::$CurrentPage = $actualPage;
System::$RequestURL = "~/" . implode("/", $path); System::$RequestURL = "~/" . implode("/", $path);

View File

@ -139,7 +139,7 @@
} }
else else
{ {
echo ("<a class=\"apb-text apb-empty\" href=\"\">" . $this->Text . "</a>"); echo ("<a class=\"apb-text apb-empty\" tabindex=\"-1\">" . $this->Text . "</a>");
} }
} }

View File

@ -48,6 +48,7 @@
protected function RenderBeginTag() protected function RenderBeginTag()
{ {
/*
if ($this->UseSubmitBehavior) if ($this->UseSubmitBehavior)
{ {
$tag = new Input(); $tag = new Input();
@ -124,6 +125,35 @@
$divDropDown->ClassList[] = "pwt-DropDownContent Popup"; $divDropDown->ClassList[] = "pwt-DropDownContent Popup";
$divDropDown->Controls = $this->DropDownControls; $divDropDown->Controls = $this->DropDownControls;
$this->Controls[] = $divDropDown; $this->Controls[] = $divDropDown;
*/
if (count($this->DropDownControls) > 0)
{
$this->ClassList[] = "uwt-button-hasdropdown";
}
if ($this->DropDownRequired)
{
$this->ClassList[] = "uwt-button-requiredropdown";
}
/*
$buttonElement = new WebControl();
$buttonElement->TagName = "button";
*/
$spanText = new WebControl();
$spanText->TagName = "span";
$spanText->ClassList[] = "uwt-title";
$spanText->Content = $this->Text;
// $buttonElement->Controls[] = $spanText;
$this->Controls[] = $spanText;
//$this->Controls[] = $buttonElement;
$buttonElement = new WebControl();
$buttonElement->TagName = "button";
$buttonElement->ClassList[] = "uwt-button-dropdownbutton";
$this->Controls[] = $buttonElement;
parent::RenderBeginTag(); parent::RenderBeginTag();
} }

View File

@ -266,10 +266,20 @@
{ {
if (get_class($elem) != "UniversalEditor\\ObjectModels\\Markup\\MarkupTagElement") continue; if (get_class($elem) != "UniversalEditor\\ObjectModels\\Markup\\MarkupTagElement") continue;
$content = null;
$attFileName = $elem->GetAttribute("FileName"); $attFileName = $elem->GetAttribute("FileName");
if ($attFileName == null) continue; $ss = new WebStyleSheet("");
if ($attFileName == null)
{
$content = $elem->GetInnerMarkup();
}
else
{
$ss->FileName = $attFileName->Value;
}
$ss->Content = $content;
$page->StyleSheets[] = $ss;
$page->StyleSheets[] = new WebStyleSheet($attFileName->Value);
} }
} }
$tagVariables = $element->GetElement("ClientVariables"); $tagVariables = $element->GetElement("ClientVariables");
@ -454,6 +464,24 @@
} }
return $tag; return $tag;
} }
public static function CreateStyleTag(WebStyleSheet $stylesheet)
{
$tag= new HTMLControl();
$tag->TagName = "style";
if ($stylesheet->ContentType != "")
{
$tag->Attributes[] = new WebControlAttribute("type", $stylesheet->ContentType);
}
else
{
$tag->Attributes[] = new WebControlAttribute("type", "text/css");
}
if ($stylesheet->Content != "")
{
$tag->InnerHTML = $stylesheet->Content;
}
return $tag;
}
/** /**
* Creates the style sheet tag for the given style sheet. * Creates the style sheet tag for the given style sheet.
* @param WebStyleSheet $stylesheet * @param WebStyleSheet $stylesheet
@ -461,6 +489,10 @@
*/ */
public static function CreateStyleSheetTag(WebStyleSheet $stylesheet) public static function CreateStyleSheetTag(WebStyleSheet $stylesheet)
{ {
if ($stylesheet->FileName == "")
{
return WebPage::CreateStyleTag($stylesheet);
}
return WebPage::CreateResourceLinkTag(new WebResourceLink($stylesheet->FileName, "stylesheet", (($stylesheet->ContentType == "") ? "text/css" : $stylesheet->ContentType))); return WebPage::CreateResourceLinkTag(new WebResourceLink($stylesheet->FileName, "stylesheet", (($stylesheet->ContentType == "") ? "text/css" : $stylesheet->ContentType)));
} }

View File

@ -5,6 +5,7 @@
{ {
public $ContentType; public $ContentType;
public $FileName; public $FileName;
public $Content;
public function __construct($FileName, $ContentType = "text/css") public function __construct($FileName, $ContentType = "text/css")
{ {