コード例 #1
0
 protected function InitItem($resize_mode = 'html')
 {
     $image = sfAdminDash::getProperty('default_image');
     if (array_key_exists('image', $this->item)) {
         $image = $this->item['image'];
     }
     $this->item['image'] = sfAdminDash::getProperty('image_dir');
     if ($resize_mode == 'thumbnail') {
         $this->item['image'] .= 'small/';
     }
     //if image isn't specified - use default
     if (!array_key_exists('image', $this->item)) {
         $this->item['image'] .= $image;
     } else {
         $this->item['image'] .= $image;
     }
     //if name isn't specified - use key
     if (!array_key_exists('name', $this->item)) {
         $this->item['name'] = $this->key;
     }
     //if url isn't specified - use key
     if (!array_key_exists('url', $this->item)) {
         $this->item['url'] = $this->key;
     }
 }
コード例 #2
0
 /**
  * This is the right way to add stuff to the <head> tag after the page has been generated :)
  * The principle is the same as with the old sfCommonFilter and asset insertion in sf 1.0-1.2
  * 
  * @param sfEvent $event
  * @param string  $content
  * 
  * @return string
  */
 public static function listenToResponseFilterContentEvent(sfEvent $event, $content = null)
 {
     $jquery_include_tag = '<script type="text/javascript" src="' . sfAdminDash::getProperty('web_dir') . '/js/' . sfAdminDash::getProperty('jquery_filename') . '"></script>';
     $jquery_no_conflict_tag = '<script type="text/javascript">jQuery.noConflict();</script>';
     if (false !== ($pos = strpos($content, $jquery_include_tag))) {
         $content = substr($content, 0, $pos + strlen($jquery_include_tag)) . $jquery_no_conflict_tag . substr($content, $pos + strlen($jquery_include_tag));
     }
     return $content;
 }
コード例 #3
0
 /**
  * This function primes the item for use, making sure all required fields are set
  *
  * @param array $item The item data, sent by reference
  * @param string|integer $key  The key that points to the specific item
  */
 public static function initItem(&$item, $key)
 {
     $image = isset($item['image']) ? $item['image'] : sfAdminDash::getProperty('default_image');
     $image = substr($image, 0, 1) == '/' ? $image : sfAdminDash::getProperty('image_dir') . $image;
     $item['image'] = $image;
     //if name isn't specified - use key
     $item['name'] = isset($item['name']) ? $item['name'] : $key;
     //if url isn't specified - use key
     $item['url'] = isset($item['url']) ? $item['url'] : $key;
     //if in_menu isn't specified - use true
     $item['in_menu'] = isset($item['in_menu']) ? $item['in_menu'] : true;
 }
コード例 #4
0
ファイル: config.php プロジェクト: GrifiS/SyrexCMS
<?php

/**
* This file is part of the sfAdminDash package
*/
if (in_array('sfAdminDash', sfConfig::get('sf_enabled_modules', array()))) {
    // the plugin module is in the enabled modules, add assets:
    $this->dispatcher->connect('context.load_factories', array('sfAdminDashConfig', 'listenToContextLoadFactoriesEvent'));
    if (true == sfAdminDash::getProperty('include_jquery_no_conflict')) {
        // if include_jquery_no_conflict is set to true, we need to modify the response content
        $this->dispatcher->connect('response.filter_content', array('sfAdminDashConfig', 'listenToResponseFilterContentEvent'));
    }
}
コード例 #5
0
        <?php echo link_to( $sf_user->getGuardUser()->getFirstName(), '/user/password-reset' ); ?> 
        <?php echo link_to(__('Logout', null, 'sf_admin_dash'), sfAdminDash::getProperty('logout_route', '@sf_guard_signout ')); ?>
      </div>
    <?php endif; ?>
    <div class="clear"></div>
  </div>

<!--
  <?php if (sfAdminDash::getProperty('include_path')): ?>
    <div id='sf_admin_path'>
      <strong><a href='<?php echo url_for('homepage'); ?>'><?php echo sfAdminDash::getProperty('site'); ?></a></strong> 
      <?php if ($sf_context->getModuleName() != 'sfAdminDash' && $sf_context->getActionName() != 'dashboard'): ?>
        / <?php echo null !== $module_link ? link_to($module_link_name, $module_link) : $module_link_name; ?>
        <?php if (null != $action_link): ?>
          / <?php echo link_to(__(ucfirst($action_link_name), null, 'sf_admin'), $action_link); ?>
        <?php endif ?>
      <?php endif; ?>
    </div>
  <?php endif; ?>
-->
  
<?php else: ?>

  <div id='sf_admin_menu'>
    <div id="logout"><?php echo link_to(__('Login', null, 'sf_admin_dash'), sfAdminDash::getProperty('login_route', '@sf_guard_signin ')); ?></div>
    <div class="clear"></div>
  </div>

<?php endif; ?>

<?php endif; // BC check if ?>
コード例 #6
0
ファイル: _menu_item.php プロジェクト: auphau/joyreactor
<a href="<?php 
echo url_for($item['url']);
?>
">
  <?php 
if (sfAdminDash::getProperty('resize_mode') == 'html') {
    ?>
    <?php 
    echo image_tag($item['image'], array('alt' => $item['name'], 'width' => '16', 'height' => '16'));
    ?>
  <?php 
} else {
    ?>
    <?php 
    echo image_tag($item['image'], array('alt' => $item['name']));
    ?>
  <?php 
}
?>
  <span><?php 
echo $item['name'];
?>
</span>
</a>
コード例 #7
0
?> 

<?php if ($sf_user->isAuthenticated()): ?> 
  <div id='sf_admin_theme_header'>
    <a href='<?php echo url_for('homepage') ?>'><?php echo image_tag(sfAdminDash::getProperty('web_dir').'/images/header_text', array('alt' => 'Home')); ?></a>
  </div>

  <div id='sf_admin_menu'>    
    <?php include_partial('sfAdminDash/menu', array('items' => $items, 'categories' => $categories)); ?>
    
    <?php if (sfAdminDash::getProperty('logout') && $sf_user->isAuthenticated()): ?>
      <div id="logout"><?php echo link_to(__('Logout', null, 'sf_admin_dash'), sfAdminDash::getProperty('logout_route', '@sf_guard_signout ')); ?> <?php echo $sf_user; ?></div>
    <?php endif; ?>
    <div class="clear"></div>
  </div>

  <?php if (sfAdminDash::getProperty('include_path')): ?>
    <div id='sf_admin_path'>
      <strong><a href='<?php echo url_for('homepage'); ?>'><?php echo sfAdminDash::getProperty('site'); ?></a></strong> 
      <?php if ($sf_context->getModuleName() != 'sfAdminDash' && $sf_context->getActionName() != 'dashboard'): ?>
        / <?php echo null !== $module_link ? link_to($module_link_name, $module_link) : $module_link_name; ?>
        <?php if (null != $action_link): ?>
          / <?php echo link_to(__(ucfirst($action_link_name), null, 'sf_admin'), $action_link); ?>
        <?php endif ?>
      <?php endif; ?>
    </div>
  <?php endif; ?>
<?php endif; ?>


<?php endif; // BC check if ?>
コード例 #8
0
ファイル: _header.php プロジェクト: rollmax/read2read
    <?php 
        }
        ?>
    <?php 
        include_partial('sfAdminDash/user_actions', array('user_actions' => $user_actions));
        ?>
    <div class="clear"></div>
  </div>

  <?php 
        if (sfAdminDash::getProperty('include_path')) {
            ?>
    <div id='sf_admin_path'>
      <strong>
        <?php 
            echo link_to(sfAdminDash::getProperty('site'), sfAdminDash::getProperty('dashboard_url'));
            ?>
      </strong>
      <?php 
            if ($sf_context->getModuleName() != 'sfAdminDash' && $sf_context->getActionName() != 'dashboard') {
                ?>
        / <?php 
                echo null !== $module_link ? link_to($module_link_name, $module_link) : $module_link_name;
                ?>
        <?php 
                if (null != $action_link) {
                    ?>
          / <?php 
                    echo link_to(__(ucfirst($action_link_name)), $action_link);
                    ?>
        <?php 
コード例 #9
0
ファイル: _menu_list.php プロジェクト: GrifiS/SyrexCMS
    <?php 
        if ($items_in_menu && $item['in_menu'] || !$items_in_menu && !$item['in_menu']) {
            ?>
      <li <?php 
            echo $item['in_menu'] ? 'class="item"' : 'class="item-menu"';
            ?>
>
        <a href="<?php 
            echo url_for($item['url']);
            ?>
" title="<?php 
            echo __($item['name']);
            ?>
">
          <?php 
            if (sfAdminDash::getProperty('resize_mode') == 'thumbnail') {
                ?>
            <?php 
                echo image_tag(substr($item['image'], 0, strrpos($item['image'], '/')) . '/small/' . substr($item['image'], strrpos($item['image'], '/') + 1), array('alt' => __($item['name']), 'width' => '16', 'height' => '16'));
                ?>
          <?php 
            } else {
                ?>
            <?php 
                echo image_tag($item['image'], array('alt' => $item['name'], 'width' => '16', 'height' => '16'));
                ?>
          <?php 
            }
            ?>
          <span><?php 
            echo __($item['name']);
コード例 #10
0
ファイル: _login.php プロジェクト: auphau/joyreactor
echo $form['password']->renderError();
?>
            <?php 
echo $form['password']->render(array('class' => 'inputbox'));
?>
          </div>
          <div class="inputlabel">
            <?php 
echo $form['remember']->renderLabel('Remember?');
?>
            <?php 
echo $form['remember']->render(array('class' => 'inputcheck'));
?>
          </div>
          <div align="left"><input type="submit" name="submit" class="button clr" value="Login" /></div>
        </div>
      </form>
    </div>
    <div class="login-text">
      <div class="ctr"><img alt="Security" src="/sfAdminDashPlugin/images/login_security.png" /></div>
      <p>Welcome to <?php 
echo sfAdminDash::getProperty('site');
?>
</p>
      <p>Use a valid username and password to gain access to the administration console.</p>
    </div>

    <div class="clr"></div>
  </div>
</div>
コード例 #11
0
<?php
  use_helper('I18N');
?>  

<div id='sf_admin_theme_footer'>
  <?php echo __('Copyright &copy; %current_year% %site_name%. All rights reserved', array('%current_year%' => date('Y'), '%site_name%' => sfAdminDash::getProperty('site'))); ?>
</div>
コード例 #12
0
            <?php echo __('Passwort ändern') ?>
          </a>
        </li>
        <li class="divider"></li>
        <li>
          <a href="<?php echo url_for(sfAdminDash::getProperty('logout_route', '@sf_guard_signout ')); ?>">
            <i class="icon-signout"></i> 
            <?php echo __('Abmelden') ?>
          </a>
        </li>
      </ul>
      <?php endif; ?>

    </div><!--/.nav-collapse -->

<?php else: ?>

  <div class="nav-collapse">
    <ul class="nav pull-right">
      <li>
        <?php echo link_to(__('<i class="icon-user icon-white" ></i> Login', null, 'sf_admin_dash'), sfAdminDash::getProperty('login_route', '@sf_guard_signin ')); ?>
      </li>
    </ul>
  </div><!--/.nav-collapse -->

<?php endif; ?>

  </div>
</div>

<?php endif; // BC check if ?>
コード例 #13
0
ファイル: _header_top.php プロジェクト: auphau/joyreactor
<?php

use_stylesheet(sfAdminDash::getProperty('web_dir') . '/css/default.css', 'first');
?>

<?php 
if (sfAdminDash::getProperty('include_jquery')) {
    use_javascript(sfAdminDash::getProperty('web_dir') . '/js/jquery-1.3.1.min.js', 'first');
}
use_javascript(sfAdminDash::getProperty('web_dir') . '/js/sf_admin_dash', 'first');
?>

<div id='sf_admin_theme_header'>
  <a href='<?php 
echo url_for('homepage');
?>
'><?php 
echo image_tag(sfAdminDash::getProperty('web_dir') . '/images/header_text', array('alt' => 'Home'));
?>
</a>
</div>