Пример #1
0
 protected function managementForm($widgetData = array())
 {
     $form = new \Ip\Form();
     $form->setEnvironment('admin');
     $form->addField(new \Ip\Form\Field\Hidden(array('name' => 'aa', 'value' => 'Block.checkForm', 'validator' => array("Required"))));
     $fieldset = new \Ip\Form\Fieldset();
     $fieldset->addField(new \Ip\Form\Field\Color(array('label' => __('Text Color', 'Block'), 'name' => 'color', 'validator' => array("Required"), 'value' => isset($widgetData['color']) ? $widgetData['color'] : ipGetThemeOption('ipTextColor', '000000'))));
     $form->addFieldset($fieldset);
     $fieldset = new \Ip\Form\Fieldset("Background");
     $fieldset->addField(new \Ip\Form\Field\Color(array('label' => __('Background color', 'Block'), 'name' => 'background_color', 'validator' => array("Required"), 'value' => isset($widgetData['background_color']) ? $widgetData['background_color'] : 'dedede')));
     $fieldset->addField(new \Ip\Form\Field\Number(array('label' => __('Background color transparency in percent', 'Block'), 'name' => 'transparency', 'validator' => array("Required"), 'value' => isset($widgetData['transparency']) ? $widgetData['transparency'] : 0)));
     $fieldset->addField(new \Ip\Form\Field\Checkbox(array('label' => __('Background image', 'Block'), 'name' => 'show_background_image', 'validator' => array("Required"), 'value' => isset($widgetData['show_background_image']) ? $widgetData['show_background_image'] : false)));
     $fieldset->addField(new \Ip\Form\Field\Hidden(array('name' => 'background_image', 'value' => isset($widgetData['background_image']) ? $widgetData['background_image'] : null)));
     $fieldset->addField(new \Ip\Form\Field\Info(array('html' => ' <div class="ipsEditScreen"></div>')));
     $form->addFieldset($fieldset);
     $fieldset = new \Ip\Form\Fieldset("Advanced");
     $fieldset->addField(new \Ip\Form\Field\Checkbox(array('label' => __('Fixed background', 'Block'), 'name' => 'fixed_background', 'validator' => array("Required"), 'value' => isset($widgetData['fixed_background']) ? $widgetData['fixed_background'] : false, 'hint' => __('Fixed background image will be fixed to viewport causing parallax effect.', 'Block'))));
     $fieldset->addField(new \Ip\Form\Field\Checkbox(array('label' => __('Blur background image', 'Block'), 'name' => 'blur_background_image', 'validator' => array("Required"), 'value' => isset($widgetData['blur_background_image']) ? $widgetData['blur_background_image'] : false)));
     $fieldset->addField(new \Ip\Form\Field\Number(array('label' => __('Blur radius(pixels)', 'Block'), 'name' => 'blur_radius', 'validator' => array("Required"), 'value' => isset($widgetData['blur_radius']) ? $widgetData['blur_radius'] : 5)));
     $fieldset->addField(new \Ip\Form\Field\Checkbox(array('label' => __('Text shadow', 'Block'), 'name' => 'text_shadow', 'validator' => array("Required"), 'value' => isset($widgetData['text_shadow']) ? $widgetData['text_shadow'] : false)));
     $values = array(array('cover', 'Cover'), array('contain', 'Contain'), array('auto', 'Auto'), array('100% auto', 'Fit width'), array('auto 100%', 'Fit height'));
     $fieldset->addField(new \Ip\Form\Field\Select(array('label' => __('Background size', 'Block'), 'name' => 'background_size', 'values' => $values, 'value' => isset($widgetData['background_size']) ? $widgetData['background_size'] : 'cover', 'hint' => __('Cover: Scale the background image to be as large as possible so that the background area is completely covered by the background image. Some parts of the background image may not be in view within the background positioning area. Contain: Scale the image to the largest size such that both its width and its height can fit inside the content area. Auto: The background-image contains its width and height. Fit width: will scale image to match width. Fit height: will scale image to match height.', 'Block'))));
     $fieldset->addField(new \Ip\Form\Field\Checkbox(array('label' => __('Background repeat', 'Block'), 'name' => 'background_repeat', 'validator' => array("Required"), 'value' => isset($widgetData['background_repeat']) ? $widgetData['background_repeat'] : true)));
     $fieldset->addField(new \Ip\Form\Field\Number(array('label' => __('Image width', 'Block'), 'hint' => __('If you want to optimize background image you can change the size of it. Beware that big images slows down page load speed, but small images will look bad if background is big. You can try to change size, repeat and blur to improve quality of lower resolution images.', 'Block'), 'name' => 'width', 'validator' => array("Required"), 'value' => isset($widgetData['width']) ? $widgetData['width'] : 960)));
     $fieldset->addField(new \Ip\Form\Field\Number(array('label' => __('Image height', 'Block'), 'name' => 'height', 'validator' => array("Required"), 'value' => isset($widgetData['height']) ? $widgetData['height'] : 640)));
     $form->addFieldset($fieldset);
     return $form;
 }
Пример #2
0
 private static function getThemeOption($name, $default)
 {
     if (isset($_SESSION['designPreview']) && isset($_SESSION['designPreview'][$name])) {
         return $_SESSION['designPreview'][$name];
     } else {
         return ipGetThemeOption($name, $default);
     }
 }
Пример #3
0
<?php

// @Layout name: Main
echo ipView('_header.php')->render();
?>
    <div class="sidenav col_12 col_md_12 col_lg_3 left">
        <nav<?php 
if (ipGetThemeOption('collapseSidebarMenu') == 'yes') {
    echo ' class="collapse"';
}
?>
>
            <?php 
// generate 2 - 7 levels submenu
// please note that it is possible to generate second level only if first level item is in breadcrumb
// $pages = \Ip\Menu\Helper::getMenuItems('menu1', 2, 7);
// echo ipSlot('menu', $pages);
//submenu of currently active menu item
//$pages = \Ip\Menu\Helper::getChildItems();
//echo ipSlot('menu', $pages);
echo ipSlot('menu', 'menu2');
?>
        </nav>
    </div>
    <div class="main col_12 col_md_12 col_lg_8 right">
        <?php 
echo ipSlot('breadcrumb');
?>
        <?php 
echo ipBlock('main')->render();
?>
Пример #4
0
        #footer {
            background: <?php 
echo ipGetThemeOption('footerBackgroundColor', '#2f2f2f');
?>
;
        }

        #ww, #white {
            background: <?php 
echo ipGetThemeOption('contentBodyColor', '#2f2f2f');
?>
 ;
        }

        <?php 
echo ipGetThemeOption('customcss');
?>

    </style>
</head>
<body>
<!-- Static navbar -->
<div class="navbar navbar-inverse navbar-static-top">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="index.html">