Example #1
0
$file_tip['category_category_html5.php'] = $file_tip['category_category.php'] . ' (HTML5 version)';
$file_tip['category_alpha_html5.php'] = $file_tip['category_alpha.php'] . ' (HTML5 version)';
$file_tip['category_peercategories_html5.php'] = $file_tip['category_peercategories.php'] . ' (HTML5 version)';
$file_tip['category_subcategories_html5.php'] = $file_tip['category_subcategories.php'] . ' (HTML5 version)';
$file_tip_extra = array('item.xml' => 'This file contains layout\' s structure: including <br/> - <b>display parameters, field positions, file list, etc</b>, <br/> - you can add extra parameters/positions, <br/>-- if you add a new position, you will need to also add the dispay -LOOP- of the new position inside files: <br/><b>item.php</b> <br/><b>item_html5.php</b> <br/><br/>(click to edit file and then use the code button)', 'category.xml' => 'This file contains layout\' s structure: including <br/> - <b>display parameters, field positions, file list, etc</b>, <br/> - you can add extra parameters/positions, <br/>-- if you add a new position, you will need to also add the dispay -LOOP- of the new position inside files: <br/><b>category_items.php</b> <br/><b>category_items_html5.php</b> <br/><br/>(click to edit file and then use the code button)', 'item.php' => 'This file display the item, thus has display LOOPs of for every position to show fields of every position, if you add new position in the XML file, then make sure that you ADD the display loop here <br/><br/>(click to edit file and then use the code button)', 'category_items.php' => 'This file includes: <br/><br/>- Item list filtering form, <br/>- Item loop (that displays every item\'s fields), <br/><br/>if you add new field position in the XML file, then make sure that you ADD here, the display loop that displays the fields of the position <br/><br/>(click to edit file and then use the code button)');
$file_tip_extra['item_html5.php'] = $file_tip_extra['item.php'];
$file_tip_extra['category_items_html5.php'] = $file_tip_extra['category_items.php'];
$file_code_btns = array('item.xml' => array('fieldPosXML' => 1, 'paramTextXML' => 1, 'paramRadioXML' => 1, 'paramSelectXML' => 1), 'category.xml' => array('fieldPosXML' => 1, 'paramTextXML' => 1, 'paramRadioXML' => 1, 'paramSelectXML' => 1), 'item.php' => array('itemPosHTML' => 1, 'itemFieldDisplay' => 1), 'category_items.php' => array('catPosHTML' => 1, 'catFieldDisplay' => 1));
$file_code_btns['item_html5.php'] = $file_code_btns['item.php'];
$file_code_btns['category_items_html5.php'] = $file_code_btns['category_items.php'];
while ($it->valid()) {
    if (!$it->isDot()) {
        //echo '<span class="label">SubPathName</span> '. $it->getSubPathName();
        //echo ' -- <span class="label">SubPath</span> '. $it->getSubPath();
        //echo ' -- <span class="label">Key</span> '. $it->key();
        $subpath = $it->getSubPath();
        $subpath_highlighted = $subpath ? '<span class="label">' . $subpath . '/</span>' : '';
        $subpath_file = $it->getSubPathName();
        $filename = preg_replace('#^' . $subpath . '\\' . DS . '#', '', $subpath_file);
        $pi = pathinfo($it->key());
        $ext = $pi['extension'];
        $file_type = isset($ext_badge[$ext]) ? '<span class="badge badge-' . $ext_badge[$ext] . '">' . $ext . '</span> ' : '<span class="badge">---</span> ';
        $btns_handle_class = isset($ext_badge[$ext]) ? '<span class="badge badge-' . $ext_badge[$ext] . '">' . $ext . '</span> ' : '<span class="badge">---</span> ';
        $btn_allowed = isset($file_code_btns[$filename]) ? array_keys($file_code_btns[$filename]) : array();
        echo '
						' . $file_type . (!isset($file_tip_extra[$filename]) ? '<img src="components/com_flexicontent/assets/images/tick_f2.png" alt="Edit file">' : '<img src="components/com_flexicontent/assets/images/comment.png" data-placement="bottom" class="' . $tip_class . '" title="' . $file_tip_extra[$filename] . '" alt="Edit file"/>') . '
						<a href="javascript:;" class="' . $tip_class . '" data-placement="right" onclick="load_layout_file(\'' . addslashes($this->layout->name) . '\', \'' . addslashes($it->getSubPathName()) . '\', \'0\', \'' . implode($btn_allowed, ' ') . '\'); return false;"
						title="' . (isset($file_tip[$filename]) ? $file_tip[$filename] : $ext . ' file') . '">' . $subpath_highlighted . $filename . '</a>';
        echo "<br/>";
    }
    $it->next();