Your IP : 216.73.216.55


Current Path : /home/giteleslfp/www/administrator/components/com_templateck/views/template/tmpl/
Upload File :
Current File : /home/giteleslfp/www/administrator/components/com_templateck/views/template/tmpl/edit_favorites.php

<?php
/**
 * @name		Template Creator CK
 * @package		com_templateck
 * @copyright	Copyright (C) 2013. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 * @author		Cedric Keiflin - http://www.template-creator.com - http://www.joomlack.fr
 */
// No direct access to this file
defined('TCK_LOADED') or die();
?>
<div id="ckfavoritespanel" class="ckleftpanel">
	<div class="ckleftpanelheader">
		<span class="ckleftpaneltitle"><?php echo TCK_Text::_('CK_FAVORITES') ?> <span class="ckleftpanelsubtitle ckleftpanelsubtitleunder">[ <span class="objid"></span> ]</span></span>
		<span class="ckleftpanelheadericon ckclose ckhastip" title="<?php echo TCK_Text::_('CK_CLOSE') ?>" onclick="ckCloseFavoritePanel();">×</span>
		<span class="ckleftpanelheadericon ckstick ckhastip" title="<?php echo TCK_Text::_('CK_KEEP_OPENED') ?>" id="ckstick" onclick="$ck('#ckfavoritespanel').toggleClass('cksticked');"><span class="fa fa-thumb-tack"></span></span>
	</div>
	<div class="ckelementscontainer">
		<div class="ckinterfacesliderlinks">
			<div class="ckinterfacesliderlink" tab="tab_modules"><?php echo TCK_Text::_('CK_MODULE'); ?></div>
			<div class="ckinterfacesliderlink" tab="tab_menus"><?php echo TCK_Text::_('CK_MENU'); ?></div>
			<div class="ckinterfacesliderlink" tab="tab_shadows"><?php echo TCK_Text::_('CK_SHADOW'); ?></div>
			<div class="ckinterfacesliderlink" tab="tab_myfavorites"><?php echo TCK_Text::_('CK_MYFAVORITES'); ?></div>
		</div>
		<div class="clr"></div>
		<div class="ckinterfaceslidercontent">
			<div class="ckinterfacesliderback"><?php echo TCK_Text::_('CK_BACK'); ?></div>
			<div class="ckinterfaceslider" id="tab_menus">
				<?php
				$index = 'menu';
				$path = TEMPLATECREATORCK_PATH . '/suggestions';
				$files = TCK_Folder::files($path, '.fck3', false, false);
				natsort($files);
				$i = 1;
				$merge = 0;
				?>

				<?php foreach ($files as $file) {
					$favorite = TCK_File::stripExt($file);
					$content = file_get_contents($path . '/' . $file);
					$content = json_decode($content);
					if ($index == 'menu' && !stristr($file, "menu")) :
						$index = 'module';
					?>
				</div>
				<div class="ckinterfaceslider" id="tab_modules">
					<?php
					endif;
					if ($index == 'module' && !stristr($file, "module")) :
						$index = 'shadow';
						$merge = '1';
					?>
				</div>
				<div class="ckinterfaceslider" id="tab_shadows">
					<?php
					endif;
					if (stristr($file, "shadow")) {
						$content->style = '/*shadow start*/' . $content->style . '/*shadow end*/';
					}
					echo '<div class="favoritethumb" data-merge="' . $merge . '" onmouseout="ckRestoreBeforeFavorite()" onmouseover="ckPreviewFavoriteDirect(this)" onclick="ckLoadFavorite(\'' . $favorite . '\', \'suggestions\', 1, this)"><img src="' . TEMPLATECREATORCK_MEDIA_URI . '/suggestions/' . $favorite . '.png" style="margin:0;padding:0;" />'
					. '<div class="themeindice">' . $i . '</div>'
					. '<div class="favoritethumbstyles"><style>' . $content->style . '</style></div>'
					. '</div>';
					$i++;
				} ?>
				</div>
			<div class="ckinterfaceslider" id="tab_myfavorites">
				<div class="ckbutton ckaddtofavorite" id="ckaddtofavorite" onclick="ckSaveFavorite($ck('.ckfocus'))" style="display:block;margin:5px;"><span class="fa fa-plus-circle"></span> <?php echo TCK_Text::_('CK_ADD_TO_FAVORITES_ACTION'); ?></div>
				<br />
				<div class="ckpopupinfostitle"><?php echo TCK_Text::_('CK_MYFAVORITES'); ?></div>
				<div id="showfavorites" class="clearfix">
				<?php
				$path = TEMPLATECREATORCK_PATH . '/favorites';
				$files = TCK_Folder::files($path, '.fck3', false, false);
				natsort($files);
				$files = array_reverse($files, true);
				$i = 1;
				// $nbthemes = count($files);
				echo '<div class="inner clearfix" style="min-height:35px;margin: 0 5px;">';
				foreach ($files as $file) {
					$favorite = TCK_File::stripExt($file);
					$content = file_get_contents($path . '/' . $file);
					$content = json_decode($content);

					$styles = str_replace('|ID|', 'ckmyfavorite' . $favorite, $content->style);
					$styles = str_replace('|di|', '#', $styles);
					$title = isset($content->name) ? $content->name : $favorite;

					$ckprops = '';
					foreach ($content as $name => $prop) {
						if (substr($name, 0,7) == 'ckprops') {
							$ckprops .= '<div ' . str_replace('|di|', '#', $prop) . '></div>';
						}
					}

					echo '<div class="ckmyfavoriterow clearfix">'
							.'<div class="ckmyfavoritename">'
								. '<span class="ckmyfavoritenamevalue">' . $title . '</span>'
								. '<div class="ckbutton ckedit" style="padding: 1px 4px;margin: 0 10px;" onclick="ckEditFavoriteName(this)"><span class="fa fa-edit"></span></div><div class="ckbutton ckvalidate" style="padding: 1px 4px;margin: 0 10px;" onclick="ckSaveFavoriteName(this)"><span class="fa fa-check"></span></div>'
							. '</div>'
							. '<div id="ckmyfavorite' . $favorite . '" data-name="' . $favorite . '" style="" class="favoritethumb ckmyfavorite" data-merge="0" onmouseout="ckRestoreBeforeFavorite()" onmouseover="ckPreviewFavoriteDirect(this)" onclick="ckLoadFavorite(\'' . $favorite . '\', \'favorites\', 1, this)">'
								. $ckprops
								. '<div class="ckstyle"><style>' . $styles . '</style></div>'
								. '<div class="inner">'
									. 'Lorem ipsum dolor sit amet'
									. '<div class="favoritethumbstyles"><style>' . $content->style . '</style></div>'
								. '</div>'
							. '</div>'
							. '<div class="ckbutton" onclick="ckEditFavorite(this);"><span class="fa fa-edit"></span> ' . TCK_Text::_('CK_EDIT') . '</div>'
							. '<div class="ckbutton" onclick="ckRemoveFavorite(this);"><span class="fa fa-remove" style="color:red;"></span> ' . TCK_Text::_('CK_DELETE') . '</div>'
						. '</div>';
					$i++;
				}
				echo '</div>';
				?>
				</div>
			</div>
		</div>
	</div>
</div>
<script language="javascript" type="text/javascript">
	ckInitOptionsSliders($ck('#ckfavoritespanel .ckelementscontainer'));
</script>