objTable = new UniteTableUC(); $this->pageBuilder = new UniteCreatorPageBuilder(); $this->objLayouts = new UniteCreatorLayouts(); } private function z_INIT(){} /** * set templates text */ protected function getTemplatesTextArray(){ $pluralLower = strtolower($this->layoutTypeTitlePlural); $titleLower = strtolower($this->layoutTypeTitle); $arrText = array( "import_layout"=>esc_html__("Import ","unlimited-elements-for-elementor").$this->layoutTypeTitle, "import_layouts"=>esc_html__("Import ","unlimited-elements-for-elementor").$this->layoutTypeTitlePlural, "uploading_layouts_file"=>esc_html__("Uploading ","unlimited-elements-for-elementor"). $this->layoutTypeTitlePlural. esc_html__(" file...","unlimited-elements-for-elementor"), "layouts_added_successfully"=> $this->layoutTypeTitle.esc_html__(" Added Successfully","unlimited-elements-for-elementor"), "my_layouts"=>esc_html__("My ","unlimited-elements-for-elementor").$this->layoutTypeTitlePlural, "search_layout"=> esc_html__("Search","unlimited-elements-for-elementor")." ". $this->layoutTypeTitlePlural, "layout_title"=>$this->layoutTypeTitle." ". esc_html__("Title","unlimited-elements-for-elementor"), "no_layouts_found"=>esc_html__("No","unlimited-elements-for-elementor")." ".$this->layoutTypeTitlePlural. " ". esc_html__("Found","unlimited-elements-for-elementor"), "are_you_sure_to_delete_this_layout"=>esc_html__("Are you sure to delete this ?","unlimited-elements-for-elementor").$titleLower, "edit_layout"=>esc_html__("Edit","unlimited-elements-for-elementor")." ".$this->layoutTypeTitle, "manage_layout_categories"=>esc_html__("Manage ","unlimited-elements-for-elementor"). $this->layoutTypeTitlePlural. esc_html__(" Categories","unlimited-elements-for-elementor"), "select_layouts_export_file"=>esc_html__("Select ","unlimited-elements-for-elementor"). $pluralLower. esc_html__(" export file","unlimited-elements-for-elementor"), "new_layout"=>esc_html__("New","unlimited-elements-for-elementor")." ". $this->layoutTypeTitle, ); return($arrText); } /** * set templat etype */ public function setLayoutType($layoutType){ $this->layoutType = $layoutType; $this->objLayoutType = UniteCreatorAddonType::getAddonTypeObject($layoutType, true); //set title $this->layoutTypeTitle = $this->objLayoutType->textSingle; $this->layoutTypeTitlePlural = $this->objLayoutType->textPlural; //set text $arrText = $this->getTemplatesTextArray(); HelperUC::setLocalText($arrText); //set other settings $this->isTemplate = $this->objLayoutType->isTemplate; $this->showColCategory = $this->objLayoutType->enableCategories; $this->showColShortcode = $this->objLayoutType->enableShortcodes; //set display type manager / table $displayType = UniteFunctionsUC::getGetVar("displaytype", "",UniteFunctionsUC::SANITIZE_TEXT_FIELD); if(empty($displayType)) $displayType = $this->objLayoutType->displayType; if($displayType == UniteCreatorAddonType_Layout::DISPLAYTYPE_MANAGER) $this->isDisplayTable = false; } /** * validate inited */ protected function validateInited(){ if(empty($this->objLayoutType)) UniteFunctionsUC::throwError("The layout type not inited, please use : setLayoutType function"); if($this->objLayoutType->isLayout == false) UniteFunctionsUC::throwError("The layout type should be layout type, now: ".$this->objLayoutType->textShowType); } /** * init display vars table related */ protected function initDisplayVars_table(){ $this->objTable->setDefaultOrderby("title"); $pagingOptions = $this->objTable->getPagingOptions(); if(!empty($this->layoutType)){ $pagingOptions["layout_type"] = $this->layoutType; } $response = $this->objLayouts->getArrLayoutsPaging($pagingOptions); $this->arrLayouts = $response["layouts"]; $pagingData = $response["paging"]; $urlLayouts = HelperUC::getViewUrl_LayoutsList(); $this->objTable->setPagingData($urlLayouts, $pagingData); } /** * * init manager display vars */ protected function initDisplayVars_manager(){ $this->objManager = new UniteCreatorManagerLayouts(); $this->objManager->init($this->layoutType); } /** * init display vars */ protected function initDisplayVars(){ //init layout type $this->urlViewCreateObject = HelperUC::getViewUrl_Layout(); $this->urlManageAddons = HelperUC::getViewUrl_Addons(); if($this->showHeaderTitle == true){ $headerTitle = HelperUC::getText("my_layouts"); require HelperUC::getPathTemplate("header"); }else require HelperUC::getPathTemplate("header_missing"); //table object if($this->isDisplayTable == true) $this->initDisplayVars_table(); else $this->initDisplayVars_manager(); } private function z_PUT_HTML(){} /** * put page catalog browser */ public function putDialogPageCatalog(){ $webAPI = new UniteCreatorWebAPI(); $isPageCatalogExists = $webAPI->isPagesCatalogExists(); if($isPageCatalogExists == false) return(false); $objBrowser = new UniteCreatorBrowser(); $objBrowser->initAddonType(GlobalsUC::ADDON_TYPE_REGULAR_LAYOUT); $objBrowser->putBrowser(); } /** * put manage categories dialog */ public function putDialogCategories(){ $prefix = "uc_dialog_add_category"; ?>
" style="display:none; height: 300px;" class="unite-inputs">
a-z , z-a

:
">
isTemplate == false) return(false); ?>
Notice - The templates will work for only if the blox template selected
$arrType): $tabTitle = UniteFunctionsUC::getVal($arrType, "plural"); $urlView = HelperUC::getViewUrl_TemplatesList(null, $type); $addClass = ""; if($type == $this->layoutType){ $addClass = " uc-tab-selected"; $urlView = "#"; } ?>
objManager->outputHtml(); } /** * display table view */ public function display(){ $this->validateInited(); $this->initDisplayVars(); if($this->isDisplayTable) $this->displayTable(); else $this->displayManager(); } /** * display layouts view */ public function displayTable(){ $sizeActions = UniteProviderFunctionsUC::applyFilters(UniteCreatorFilters::FILTER_LAYOUTS_ACTIONS_COL_WIDTH, 380); $numLayouts = count($this->arrLayouts); ?> showButtonsPanel == true) $this->putHtmlButtonsPanel(); ?>
objTable->putActionsFormStart(); if($this->isTemplate == true) $this->putLayoutTypeTabs(); ?>
objTable->putSearchForm(HelperUC::getText("search_layout"), "Clear"); if($this->isTemplate == false): $this->objTable->putFilterCategory(); endif; ?>
arrLayouts)): ?>
"> showColShortcode == true):?> showColCategory == true):?> arrLayouts as $key=>$layout): $id = $layout->getID(); $title = $layout->getTitle(); $shortcode = $layout->getShortcode(); $shortcode = UniteFunctionsUC::sanitizeAttr($shortcode); $editLink = HelperUC::getViewUrl_Layout($id); $previewLink = HelperUC::getViewUrl_LayoutPreview($id, true); $showTitle = HelperHtmlUC::getHtmlLink($editLink, $title); $rowClass = ($key%2==0)?"unite-row1":"unite-row2"; $arrCategory = $layout->getCategory(); $catID = UniteFunctionsUC::getVal($arrCategory, "id"); $catTitle = UniteFunctionsUC::getVal($arrCategory, "name"); ?> showColShortcode):?> showColCategory):?>
objTable->putTableOrderHeader("title", HelperUC::getText("layout_title")) ?> objTable->putTableOrderHeader("catid", esc_html__("Category","unlimited-elements-for-elementor")) ?>
objTable->putPaginationHtml(); $this->objTable->putInpageSelect(); ?> objTable->putActionsFormEnd(); $this->pageBuilder->putLayoutsGlobalSettingsDialog(); $this->putDialogImportLayout(); $this->putDialogCategories(); //put pages catalog if exists $this->putDialogPageCatalog(); ?>