/** * Returns the CSS rules. * * @since 1.1.2.1 * @since 1.2.0 Moved from the _StyleLoader class as it more makes sense in the Style class. * Made it static anc changed the scope public from protected as the ..._Style class access it. Removed the first parameter of the core object. * @access public */ public static function getStyle($arrParams = array()) { global $oResponsiveColumnWidgets; if (!isset($oResponsiveColumnWidgets)) { return ''; } $oStyle = $oResponsiveColumnWidgets->oStyle; $oOption = $oResponsiveColumnWidgets->oOption; $arrParams = $oOption->FormatParameterArray($arrParams); $oWidgetBox = new ResponsiveColumnWidgets_WidgetBox($arrParams, $oOption->SetMinimiumScreenMaxWidth($oOption->FormatColumnArray($arrParams['columns'], $arrParams['default_media_only_screen_max_width'])), $oOption->formatColSpanArray($arrParams['colspans']), $oResponsiveColumnWidgets->arrClassSelectors); $oID = new ResponsiveColumnWidgets_IDHandler(); return $oStyle->GetStyles($arrParams['sidebar'], $oID->GetCallID($arrParams['sidebar'], $arrParams), $arrParams['custom_style'], $oWidgetBox->GetScreenMaxWidths(), false); }
public function AddStyleSheetForAutoInsert() { // since 1.1.2 $oStyle = $this->oCore->oStyle; $strStyles = ''; $this->arrClassSelectors = array('box' => $this->oOption->SanitizeAttribute($this->oOption->arrOptions['general']['general_css_class_attributes']['box']), 'column' => $this->oOption->SanitizeAttribute($this->oOption->arrOptions['general']['general_css_class_attributes']['column']), 'row' => $this->oOption->SanitizeAttribute($this->oOption->arrOptions['general']['general_css_class_attributes']['row'])); foreach ($this->arrEnabledBoxIDs as $strSidebarID) { $arrParams = $this->oOption->FormatParameterArray(array('sidebar' => $strSidebarID)); $oWidgetBox = new ResponsiveColumnWidgets_WidgetBox($arrParams, $this->oOption->SetMinimiumScreenMaxWidth($this->oOption->FormatColumnArray($arrParams['columns'], $arrParams['default_media_only_screen_max_width'])), $this->oOption->formatColSpanArray($arrParams['colspans']), $this->arrClassSelectors); $oID = new ResponsiveColumnWidgets_IDHandler(); $strStyles .= $oStyle->GetStyles($strSidebarID, $oID->GetCallID($strSidebarID, $arrParams), $arrParams['custom_style'], $oWidgetBox->GetScreenMaxWidths(), false); } echo $strStyles; }
/** * Returns the widget box output. * * @remark This method can be the callback for shortcode or manually called by the front-end function. * @since 1.0.4 * @since 1.2.0 Changed the name from 'GetWidgetBoxOutput'. * @return string The widget box HTML block output. * @access public Called from instantiated objects such as the shortcode class's. */ public function getWidgetBoxOutput($arrParams, $arrOutput = array(), $bIsStyleNotScoped = false) { $arrParams = $this->oOption->FormatParameterArray($arrParams); // for shortcode callbacks , it needs to be converted to array. Note that array( '' ) is evaluated not true so if this is an empty string, '', this line helps to make it empty array. $arrOutput = empty($arrOutput) ? array() : $arrOutput; // If this is a callback for the shortcode, the third parameter will be false. Reverse the value. $bIsStyleScoped = $bIsStyleNotScoped ? false : true; // Check sidebar dependency conflicts if ($this->isDependencyConflict($arrParams['sidebar'])) { return '<p class="error">' . '<strong>Responsive Column Widget</strong>: ' . __('A dependency conflict occurred. Please reselect a child widget in the Widgets page of the administration area.', 'responsive-column-widgets') . '</p>'; } // Generate the ID - Get a unique ID selector based on the combination of the sidebar ID and the parameters. $oID = new ResponsiveColumnWidgets_IDHandler(); $strCallID = $oID->GetCallID($arrParams['sidebar'], $arrParams); // an ID based on the sidebar ID + parameters; there could be the same ID if the passed values are the same. $strIDSelector = $oID->GenerateIDSelector($strCallID); // a unique ID throughout the script load unset($oID); // for PHP below 5.3 // Retrieve the widget output. $strOut = "<div class='{$arrParams['sidebar']}'>" . $arrParams['before_widget_box'] . "<div id='{$strIDSelector}' class='{$this->arrClassSelectors['box']} {$this->strClassSelectorBox2}'>" . $this->getOutputWidgetBuffer($arrOutput, $arrParams, $strCallID, $bIsStyleScoped) . "</div>" . $arrParams['after_widget_box'] . "</div>"; return apply_filters('RCW_filter_widgetbox_output', $strOut) . $this->GetCredit(); }