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;
$insideVariable = false;
$vars = [ ];
$varname = null;
$varvalue = null;
@ -983,7 +984,6 @@
$varvalue = null;
}
return $vars;
}
private static function __ReplaceAny($str, $before, $after, $with)
@ -1096,9 +1096,12 @@
if (System::ParsePathVariablesIntoPage( $actualPage, $pathVars ))
{
foreach ($pathVars as $key => $value)
if (is_array($pathVars))
{
$actualPage->PathVariables[] = new WebVariable($key, $value);
foreach ($pathVars as $key => $value)
{
$actualPage->PathVariables[] = new WebVariable($key, $value);
}
}
System::$CurrentPage = $actualPage;

View File

@ -139,7 +139,7 @@
}
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()
{
/*
if ($this->UseSubmitBehavior)
{
$tag = new Input();
@ -124,7 +125,36 @@
$divDropDown->ClassList[] = "pwt-DropDownContent Popup";
$divDropDown->Controls = $this->DropDownControls;
$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();
}
}

View File

@ -265,11 +265,21 @@
foreach ($tagStyleSheets->Elements as $elem)
{
if (get_class($elem) != "UniversalEditor\\ObjectModels\\Markup\\MarkupTagElement") continue;
$content = null;
$attFileName = $elem->GetAttribute("FileName");
if ($attFileName == null) continue;
$page->StyleSheets[] = new WebStyleSheet($attFileName->Value);
$ss = new WebStyleSheet("");
if ($attFileName == null)
{
$content = $elem->GetInnerMarkup();
}
else
{
$ss->FileName = $attFileName->Value;
}
$ss->Content = $content;
$page->StyleSheets[] = $ss;
}
}
$tagVariables = $element->GetElement("ClientVariables");
@ -454,6 +464,24 @@
}
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.
* @param WebStyleSheet $stylesheet
@ -461,6 +489,10 @@
*/
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)));
}

View File

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