/** * Make everything */ function rebuildContent() { $callBack = $this->_callBack; $collectionName = $this->_collectionName; $thingsToApplyCollectionTo = $this->_thingsToApplyCollectionTo; //get the theme eval('$theme = ' . $callBack . "();"); if (!is_object($theme)) { return; } $color = GUIComponentUtility::makeColorArrays(12, 5); $marginArray = GUIComponentUtility::makeMarginAndPaddingArray(); $borderSizes = GUIComponentUtility::makeBorderSizeArrays(); $borderStyles = GUIComponentUtility::makeBorderStyleArrays(); $collectionSelector1 = "*." . $collectionName; //first style collection if (!$theme->getStyleCollection($collectionSelector1)) { $styleCollection1 = new StyleCollection($collectionSelector1, $collectionName, "BackGround properties", "How would you like your background to look?" . $collectionName); foreach ($thingsToApplyCollectionTo as $arr) { $theme->addStyleForComponentType($styleCollection1, $arr['type'], $arr['index']); } } //first style collection GUI elements $comp = new WGUISelectList($callBack, $collectionSelector1, new BackgroundColorSP("#FFFFFF"), "ColorSC", $color['options'], $color['styles']); $this->addComponent('bgColor', $comp); $prop = new BorderSP('0px', "solid", "#000000"); $comp = new WGUISelectList($callBack, $collectionSelector1, $prop, "LengthSC", $borderSizes['options'], $borderSizes['styles']); $this->addComponent('borderSize', $comp); $comp = new WGUISelectList($callBack, $collectionSelector1, $prop, "BorderStyleSC", $borderStyles['options'], $borderStyles['styles']); $this->addComponent('borderStyle', $comp); $comp = new WGUISelectList($callBack, $collectionSelector1, $prop, "ColorSC", $color['options'], $color['styles']); $this->addComponent('borderColor', $comp); $comp = new WGUISelectList($callBack, $collectionSelector1, new MarginTopSP("0px"), "LengthSC", $marginArray, false); $this->addComponent('m_top', $comp); $comp = new WGUISelectList($callBack, $collectionSelector1, new MarginBottomSP("0px"), "LengthSC", $marginArray, false); $this->addComponent('m_bottom', $comp); $comp = new WGUISelectList($callBack, $collectionSelector1, new MarginLeftSP("0px"), "LengthSC", $marginArray, false); $this->addComponent('m_left', $comp); $comp = new WGUISelectList($callBack, $collectionSelector1, new MarginRightSP("0px"), "LengthSC", $marginArray, false); $this->addComponent('m_right', $comp); }
/** * Make everything */ function rebuildContent() { $callBack = $this->_callBack; $collectionName = $this->_collectionName; $thingsToApplyCollectionTo = $this->_thingsToApplyCollectionTo; //get the theme eval('$theme = ' . $callBack . "();"); if (!is_object($theme)) { return; } //get arrays ready $color = GUIComponentUtility::makeColorArrays(12, 5); $fonts = GUIComponentUtility::makeFontArray(); $fontSize = GUIComponentUtility::makeFontSizeArray(); $collectionSelector1 = "*." . $collectionName; //first style collection if (!$theme->getStyleCollection($collectionSelector1)) { $styleCollection1 = new StyleCollection($collectionSelector1, $collectionName, "Font Properties", "Font choice with selector " . $collectionName); foreach ($thingsToApplyCollectionTo as $arr) { $theme->addStyleForComponentType($styleCollection1, $arr['type'], $arr['index']); } } //first style collection GUI elements $comp = new WGUISelectList($callBack, $collectionSelector1, new ColorSP("#000000"), "ColorSC", $color['options'], $color['styles']); $this->addComponent('color', $comp); $prop = new FontSP('serif', "12pt", "normal", "normal", "normal"); $comp = new WGUISelectList($callBack, $collectionSelector1, $prop, "FontFamilySC", $fonts, "font-family"); $this->addComponent('font', $comp); $comp = new WGUISelectList($callBack, $collectionSelector1, $prop, "FontSizeSC", $fontSize, "font-size"); $this->addComponent('fontSize', $comp); $comp = new WGUICheckBox($callBack, $collectionSelector1, $prop, "FontWeightSC", "bold", "normal"); $this->addComponent('boldBox', $comp); $comp = new WGUICheckBox($callBack, $collectionSelector1, $prop, "FontStyleSC", "italic", "normal"); $this->addComponent('italicsBox', $comp); $comp = new WGUICheckBox($callBack, $collectionSelector1, $prop, "FontVariantSC", "small-caps", "normal"); $this->addComponent('smallcapsBox', $comp); }