<?php /* Smarty version Smarty-3.1.7, created on 2013-01-24 22:00:32
         compiled from "C:\wamp\www\collab\activecollab\3.2.8\angie\frameworks\globalization\views\default\fw_languages_admin\index.tpl" */ ?>
<?php /*%%SmartyHeaderCode:114545101af000acbd7-66751671%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '401516db947a36f19d3c57a5545889ed9402a116' => 
    array (
      0 => 'C:\\wamp\\www\\collab\\activecollab\\3.2.8\\angie\\frameworks\\globalization\\views\\default\\fw_languages_admin\\index.tpl',
      1 => 1357817598,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '114545101af000acbd7-66751671',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'import_enabled' => 0,
    'import_url' => 0,
    'languages' => 0,
    'active_language' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.7',
  'unifunc' => 'content_5101af0042740',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5101af0042740')) {function content_5101af0042740($_smarty_tpl) {?><?php if (!is_callable('smarty_block_title')) include 'C:\\wamp\\www\\collab\\activecollab/3.2.8/angie/frameworks/environment/helpers\\block.title.php';
if (!is_callable('smarty_block_add_bread_crumb')) include 'C:\\wamp\\www\\collab\\activecollab/3.2.8/angie/frameworks/environment/helpers\\block.add_bread_crumb.php';
if (!is_callable('smarty_block_lang')) include 'C:\\wamp\\www\\collab\\activecollab/3.2.8/angie/frameworks/globalization/helpers\\block.lang.php';
if (!is_callable('smarty_function_image_url')) include 'C:\\wamp\\www\\collab\\activecollab/3.2.8/angie/frameworks/environment/helpers\\function.image_url.php';
if (!is_callable('smarty_function_assemble')) include 'C:\\wamp\\www\\collab\\activecollab/3.2.8/angie/frameworks/environment/helpers\\function.assemble.php';
if (!is_callable('smarty_block_form')) include 'C:\\wamp\\www\\collab\\activecollab/3.2.8/angie/frameworks/environment/helpers\\block.form.php';
if (!is_callable('smarty_block_wrap')) include 'C:\\wamp\\www\\collab\\activecollab/3.2.8/angie/frameworks/environment/helpers\\block.wrap.php';
if (!is_callable('smarty_block_label')) include 'C:\\wamp\\www\\collab\\activecollab/3.2.8/angie/frameworks/environment/helpers\\block.label.php';
if (!is_callable('smarty_function_file_field')) include 'C:\\wamp\\www\\collab\\activecollab/3.2.8/angie/frameworks/environment/helpers\\function.file_field.php';
if (!is_callable('smarty_block_submit')) include 'C:\\wamp\\www\\collab\\activecollab/3.2.8/angie/frameworks/environment/helpers\\block.submit.php';
if (!is_callable('smarty_modifier_json')) include 'C:\\wamp\\www\\collab\\activecollab/3.2.8/angie/frameworks/environment/helpers\\modifier.json.php';
?><?php $_smarty_tpl->smarty->_tag_stack[] = array('title', array()); $_block_repeat=true; echo smarty_block_title(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Languages<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_title(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>

<?php $_smarty_tpl->smarty->_tag_stack[] = array('add_bread_crumb', array()); $_block_repeat=true; echo smarty_block_add_bread_crumb(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Details<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_add_bread_crumb(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>


<div id="languages"> 
  <div class="empty_content">
      <div class="objects_list_title"><?php $_smarty_tpl->smarty->_tag_stack[] = array('lang', array()); $_block_repeat=true; echo smarty_block_lang(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Language<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_lang(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</div>
      <div class="objects_list_icon"><img src="<?php echo smarty_function_image_url(array('name'=>'admin_panel/languages.png','module'=>@GLOBALIZATION_FRAMEWORK),$_smarty_tpl);?>
" alt=""/></div>
      <div class="objects_list_details_actions">
        <ul>
          <li><a href="<?php echo smarty_function_assemble(array('route'=>'admin_languages_add'),$_smarty_tpl);?>
" id="new_language"><?php $_smarty_tpl->smarty->_tag_stack[] = array('lang', array()); $_block_repeat=true; echo smarty_block_lang(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
New Language<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_lang(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</a></li>
          <li><a href="<?php echo smarty_function_assemble(array('route'=>'admin_languages_set_default'),$_smarty_tpl);?>
" id="set_default_language"><?php $_smarty_tpl->smarty->_tag_stack[] = array('lang', array()); $_block_repeat=true; echo smarty_block_lang(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Set Default Language<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_lang(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</a></li>
          <?php if ($_smarty_tpl->tpl_vars['import_enabled']->value){?><li><a href="#" id="import_language"><?php $_smarty_tpl->smarty->_tag_stack[] = array('lang', array()); $_block_repeat=true; echo smarty_block_lang(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Import Language<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_lang(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</a></li><?php }?>
        </ul>
      </div>
      
     	<?php if ($_smarty_tpl->tpl_vars['import_enabled']->value){?>
      <div class="upload_to_flyout import_language">
      	<?php $_smarty_tpl->smarty->_tag_stack[] = array('form', array('method'=>'post','action'=>$_smarty_tpl->tpl_vars['import_url']->value,'id'=>"import_form",'enctype'=>"multipart/form-data",'class'=>"import_language_form")); $_block_repeat=true; echo smarty_block_form(array('method'=>'post','action'=>$_smarty_tpl->tpl_vars['import_url']->value,'id'=>"import_form",'enctype'=>"multipart/form-data",'class'=>"import_language_form"), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>

          <?php $_smarty_tpl->smarty->_tag_stack[] = array('wrap', array('field'=>'xml')); $_block_repeat=true; echo smarty_block_wrap(array('field'=>'xml'), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>

            <?php $_smarty_tpl->smarty->_tag_stack[] = array('label', array('for'=>'xml')); $_block_repeat=true; echo smarty_block_label(array('for'=>'xml'), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Select Language XML File<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_label(array('for'=>'xml'), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>

            <?php echo smarty_function_file_field(array('name'=>'xml','id'=>'xml'),$_smarty_tpl);?>

          <?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_wrap(array('field'=>'xml'), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>

          
          <?php $_smarty_tpl->smarty->_tag_stack[] = array('submit', array()); $_block_repeat=true; echo smarty_block_submit(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Import<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_submit(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
 
      	<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_form(array('method'=>'post','action'=>$_smarty_tpl->tpl_vars['import_url']->value,'id'=>"import_form",'enctype'=>"multipart/form-data",'class'=>"import_language_form"), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>

      </div>
    	<?php }else{ ?>
			<div class="objects_list_details_actions">
        <p><?php $_smarty_tpl->smarty->_tag_stack[] = array('lang', array()); $_block_repeat=true; echo smarty_block_lang(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Importing is not enabled, please review errors<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_lang(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</p>
      </div>
    	<?php }?>
      <div class="object_lists_details_tips">
        <h3><?php $_smarty_tpl->smarty->_tag_stack[] = array('lang', array()); $_block_repeat=true; echo smarty_block_lang(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Tips<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_lang(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
:</h3>
        <ul>
          <li><?php $_smarty_tpl->smarty->_tag_stack[] = array('lang', array()); $_block_repeat=true; echo smarty_block_lang(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
To select a language and load its details, please click on it in the list on the left<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo smarty_block_lang(array(), $_block_content, $_smarty_tpl, $_block_repeat);  } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</li>
        </ul>
      </div>  
  </div>
</div>

<script type="text/javascript">
  $('#new_language').flyoutForm({
    'success_event' : 'language_created',
    'title' : App.lang('New Language'),
    'width' : 'narrow'
  });
  
  $('#set_default_language').flyoutForm({
    'title' : App.lang('Set Default Language'),
    'width' : 'narrow'
  });

	$('#languages').each(function() {
	  var wrapper = $(this);
    
    wrapper.objectsList({
      'id' : 'languages',
      'items' : <?php echo smarty_modifier_json($_smarty_tpl->tpl_vars['languages']->value);?>
,
      'objects_type' : 'language',
      'print_url' : null,
      'required_fileds'   : ['id', 'name', 'locale'],
      'events' : App.standardObjectsListEvents(),
      'multi_url' : '<?php echo smarty_function_assemble(array('route'=>'people_mass_edit'),$_smarty_tpl);?>
',
      'render_item' : function (item) {
        return '<td class="name">' + item['name'].clean() + '</td>';
      },
      'search_index' : function (item) {
        return item.name.clean() + ' ' + item.email.clean();
      }
		});

    //import language form
  	var page_action_import_language = $("#page_title_actions #page_action_import_language a");
  	page_action_import_language.click(function(){
  		var import_language_form = $("#import_language_form");
  		import_language_form.slideToggle('slow',function() {
  			return false;
  		});
  	});
	
    // Handle new language event
    App.Wireframe.Events.bind('language_created.content', function(e, language) {
      wrapper.objectsList('add_item', language);
      App.Wireframe.Flash.success(language.name + App.lang(' language added'));
    });

    App.Wireframe.Events.bind('language_deleted.content', function(e, language) {
      wrapper.objectsList('delete_item', language);
      App.Wireframe.Flash.success(language.name + App.lang(' language deleted'));
    });
    
    // Handle language event
    App.Wireframe.Events.bind('language_updated.content', function(e, language) {
    	wrapper.objectsList('update_item', language);
    	App.Wireframe.Flash.success(language.name + App.lang(' language updated'));
    });
  
    // handle on importing vCard (upload/review)
    var upload_to_flyout_wrapper = $('div.import_language.upload_to_flyout');
  	var form = upload_to_flyout_wrapper.find('.import_language_form');
  	
    $('#import_language').click(function() {
    	upload_to_flyout_wrapper.slideToggle('fast');
    });
    
    form.find('button').click(function() {
      var file_input = form.find('input[type=file]:first');

      if (!file_input.val()) {
        App.Wireframe.Flash.error('Please choose XML file which contains language translation');
        return false;
      } // if

      form.ajaxSubmit({
        'url' : App.extendUrl(form.attr('action'), { 'async' : 1 }),
        'type' : 'post',
        'success' : function(response) {

        	// hide/reset import langiage form
        	upload_to_flyout_wrapper.slideToggle('fast');
        	file_input.val('');
        	
          var dialog = App.widgets.FlyoutDialog.show({
		        'title' : App.lang('Importing Language file'),
		        'data' : response,
		        'min_height' : 'auto',
		        'width' : 520
					});
        },
        'error' : function(response) {
          App.Wireframe.Flash.error(App.lang('An error occurred while trying to import language'));
        }
      });
      
      return false;
    }); //importing language

    // Pre select item if this is permalink
    <?php if ($_smarty_tpl->tpl_vars['active_language']->value->isLoaded()){?>
    	wrapper.objectsList('load_item', <?php echo smarty_modifier_json($_smarty_tpl->tpl_vars['active_language']->value->getId());?>
, <?php echo smarty_modifier_json($_smarty_tpl->tpl_vars['active_language']->value->getViewUrl());?>
);
    <?php }?>
	});
</script>
<?php }} ?>