<?php
/**
  * Ahead WebSoft Technologies Pvt Ltd.
  * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
  * @license    https://www.socialengine.com/policies
*/
?>
<?php if($this->success) { ?>
  <script type="text/javascript">
    en4.core.runonce.add(function() {
      parent.scriptJquery('.photo_view_info_title').html('<?php echo $this->title; ?>');
      parent.scriptJquery('.photo_view_info_caption').html('<?php echo $this->description; ?>');
      parent.Smoothbox.close();
    });
  </script>
  <?php return; ?>
<?php } ?>
<script type="text/javascript">
  en4.core.runonce.add(function() {
    scriptJquery('#tags').selectize({
      maxItems: 10,
      valueField: 'label',
      labelField: 'label',
      searchField: 'label',
      create: true,
      load: function(query, callback) {
        if (!query.length) return callback();
        scriptJquery.ajax({
          url: '<?php echo $this->url(array('controller' => 'tag', 'action' => 'suggest'), 'default', true) ?>',
          data: { value: query },
          success: function (transformed) {
            callback(transformed);
          },
          error: function () {
            callback([]);
          }
        });
      }
    });
  });
</script>
<?php echo $this->partial('_approved_tip.tpl', 'core', array('item' => $this->subject)); ?>
<?php echo $this->form->render($this); ?>
