本文整理匯總了PHP中FusionHelper::generate_column_combinations方法的典型用法代碼示例。如果您正苦於以下問題:PHP FusionHelper::generate_column_combinations方法的具體用法?PHP FusionHelper::generate_column_combinations怎麽用?PHP FusionHelper::generate_column_combinations使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FusionHelper
的用法示例。
在下文中一共展示了FusionHelper::generate_column_combinations方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_custom_templates
/**
* Function to get tab content for custom templates
*
* @since 2.0.0
*
* @return String String having tab content
*/
public function get_custom_templates()
{
$columns = 6;
//number of columns
$content = '<div id="custom_templates_wrapper">
<div id="custom_templates_left">
<h1 class="templates_heading">' . __('Save Template', 'fusion-core') . '</h1>
<div class="save_templates_here">
<a class="templates_selection" id="fusion_save_custom_tpl"
href="JavaScript:void(0)">' . __('Save Layout As Template', 'fusion-core') . '</a>
</div>
</div>
<div id="custom_templates_right">
<h1 class="templates_heading">' . __('Load Template', 'fusion-core') . '</h1>';
//get templates data
$templates = get_option('fusion_custom_templates');
//if value exists and there are more than 1 number of templates
if ($templates != false && count($templates) > 0) {
//generate column combinations
$combinations = FusionHelper::generate_column_combinations(count($templates), $columns);
//add data in each column
for ($i = 0; $i < $columns; $i++) {
//if no data available for this column then break
if ($combinations[$i] == 0) {
break;
}
$counter = 0;
$content .= ' <div class="custom_templates_sections">';
foreach ($templates as $key => $value) {
$content .= ' <div style="position:relative;" class="template_selection_wrapper"> ';
$content .= ' <div class="hidden_overlay">
<a href="JavaScript:void(0)" data-id="' . $key . '" class="fuiosn_load_template">' . __('LOAD', 'fusion-core') . '</a>
<a href="JavaScript:void(0)" data-id="' . $key . '" class="fusion_delete_template">' . __('DELETE', 'fusion-core') . '</a>
</div>';
$content .= ' <a class="fusion_custom_template templates_selection" href="JavaScript:void(0)">' . $key . '</a>';
$content .= ' </div>';
//remove current element from array for next iteration
unset($templates[$key]);
$counter++;
//if reached combination value then break loop
if ($counter == $combinations[$i]) {
break;
}
}
$content .= '</div>';
}
}
$content .= '</div>';
return $content;
}
示例2: get_prebuilt_templates
/**
* Function to get tab content for pre-built templates
*
* @since 2.0.0
*
* @return String String having tab content
*/
public function get_prebuilt_templates()
{
$columns = 6;
//number of columns
$content = '<div id="pre_built_templates_wrapper"><div id="custom_templates_right" class="custom_pre_built">';
//get templates data
$templates = unserialize(base64_decode(self::$content));
//if value exists and there are more than 1 number of templates
if ($templates != false && count($templates) > 0) {
//generate column combinations
$combinations = FusionHelper::generate_column_combinations(count($templates), $columns);
//add data in each column
for ($i = 0; $i < $columns; $i++) {
//if no data available for this column then break
if ($combinations[$i] == 0) {
break;
}
$counter = 0;
$content .= ' <div class="pre_built_templates_section">';
foreach ($templates as $key => $value) {
$content .= ' <div class="template_selection_wrapper"> ';
$content .= ' <a class="fusion_pre_built_template templates_selection" data-id="' . $key . '" ';
$content .= ' href="JavaScript:void(0)">' . $key . '</a>';
$content .= ' </div>';
//remove current element from array for next iteration
unset($templates[$key]);
$counter++;
//if reached combination value then break loop
if ($counter == $combinations[$i]) {
break;
}
}
$content .= '</div>';
}
}
$content .= '</div></div>';
return $content;
}