• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • Examples
  • File List

system/admin/plugin.php

00001 <?php
00002 namespace Habari;
00010 ?>
00011 <?php if ( !defined( 'HABARI_PATH' ) ) { die('No direct access'); } ?>
00012 <?php if ( $plugin['debug'] ): ?>
00013 <div class="item plugin columns sixteen">
00014   <div class="head">
00015     <p><?php printf( _t('The plugin file %s had syntax errors and could not load.'), $plugin['file'] ); ?></p>
00016     <div style="display:none;" id="error_<?php echo $plugin['plugin_id']; ?>"><?php echo $plugin['error']; ?></div>
00017       <ul class="dropbutton">
00018         <li><a href="#" onclick="$('#error_<?php echo $plugin['plugin_id']; ?>').show();"><?php _e('Show Error'); ?></a></li>
00019       </ul>
00020   </div>
00021 </div>
00022 <?php elseif ( $plugin['info'] == 'legacy' ): ?>
00023 <div class="item plugin">
00024   <div class="head">
00025     <p><?php printf( _t('The plugin file %s is a legacy plugin, and does not include an XML info file.'), $plugin['file'] ); ?></p>
00026   </div>
00027 </div>
00028 <?php elseif ( $plugin['info'] == 'broken' ): ?>
00029 <div class="item plugin">
00030   <div class="head">
00031     <p><?php echo _t('The XML file for the plugin %s contained errors and could not be loaded.', array( basename( $plugin['file'] ) ) ); ?></p>
00032   </div>
00033 </div>
00034 <?php else: ?>
00035 <div class="item plugin" id="plugin_<?php echo $plugin['plugin_id']; ?>">
00036   <div class="head">
00037     <div class="title">
00038     <a href="<?php echo $plugin['info']->url; ?>" class="plugin"><?php echo $plugin['info']->name; ?> <span class="version"><?php echo $plugin['info']->version; ?></span></a>
00039     <?php _e('by'); ?>
00040 
00041     <?php
00042     $authors = array();
00043     foreach ( $plugin['info']->author as $author ) {
00044       $authors[] = isset( $author['url'] ) ? '<a href="' . $author['url'] . '">' . $author . '</a>' : $author;
00045     }
00046     // @locale The string used between the last two items in the list of authors of a plugin on the admin page (one, two, three *and* four).
00047     echo Format::and_list( $authors,  _t( ' and ' ));
00048     ?>
00049     </div>
00050     <?php if ( $plugin['core'] ): ?>
00051       <span class="core"><?php _e('core'); ?></span>
00052     <?php endif; ?>
00053 
00054     <?php if ( isset($plugin['help']) ): ?>
00055     <a class="help" href="<?php echo $plugin['help']['url']; ?>">?</a>
00056     <?php endif; ?>
00057 
00058     <?php
00060     if(count($plugin['actions']) > 0):
00061       $dbtn = FormControlDropbutton::create('actions');
00062       foreach($plugin['actions'] as $key => $data) {
00063         $dbtn->append(FormControlSubmit::create($key)->set_url($data['href'])->set_caption($data['caption']));
00064       }
00065       echo $dbtn->pre_out();
00066       echo $dbtn->get($theme);
00067     endif;
00068     ?>
00069 
00070     <?php if ( isset($plugin['update']) ): ?>
00071     <ul class="dropbutton alert">
00072       <li><a href="#"><?php _e('v1.1 Update Available Now'); ?></a></li>
00073     </ul>
00074     <?php endif; ?>
00075 
00076     <p class="description"><?php echo $plugin['info']->description; ?></p>
00077 
00078   </div>
00079   
00080   <div class="requirements">
00081     <?php if ( isset( $plugin['missing'] ) ) : ?>
00082       <ul>
00083         <?php foreach ( $plugin['missing'] as $feature => $url ) : ?>
00084         <li class="error"><?php
00085         $feature = '<span class="feature">' . ( $url == '' ? $feature : sprintf('<a href="%s">%s</a>', $url, $feature) ) . '</span>';
00086         _e('This plugin requires the %1$s feature and cannot be activated.', array($feature))
00087         ?></li>
00088         <?php endforeach; ?>
00089       </ul>
00090         <?php elseif ( isset( $plugin['available'] ) ) : ?>
00091       <ul>
00092         <?php foreach ( $plugin['available'] as $feature => $plugins ) : if(count($plugins) == 1) : ?>
00093         <li>
00094           <?php 
00095             $dependency = reset($plugins);
00096             _e('%1$s will be activated to provide %2$s.', array("<b>{$dependency}</b>", "<span class=\"feature\">{$feature}</span>"));
00097           ?>
00098         </li>
00099         
00100         <?php else: ?>
00101           <li class="error"><?php _e('One of these plugins must be activated to provide %s:', array("<span class=\"feature\">{$feature}</span>")); ?>
00102 
00103             <ul class="dependency_options">
00104             <?php foreach ( $plugins as $plugin_id => $plugin_name ) : ?>
00105               <?php if(isset($inactive_plugins[$plugin_id]['actions']['activate'])): ?>
00106                 <li class="fulfills"><a href="#plugin_<?php echo $plugin_id; ?>" onclick="$('html,body').animate({scrollTop: $('#plugin_<?php echo $plugin_id; ?>').offset().top-40},500);$('#plugin_<?php echo $plugin_id; ?>').effect('pulsate', {}, 500);return false;"><?php echo $plugin_name; ?></a></li>
00107               <?php endif; ?>
00108             <?php endforeach; ?>
00109             </ul>
00110           </li>
00111         <?php endif; endforeach; ?>
00112       </ul>
00113     <?php endif; ?>
00114   </div>
00115 
00116 
00117   <div class="pluginhelp"<?php if ( $helpaction == '_help' ): ?> class="active"<?php endif; ?>>
00118     <?php
00119     if ( Plugins::is_loaded((string) $plugin['info']->name) ) {
00120       Plugins::act_id( 'plugin_ui', $plugin['plugin_id'], $plugin['plugin_id'], '_help' );
00121     }
00122     elseif ( isset($plugin['info']->help) ) {
00123       foreach ( $plugin['info']->help as $help ) {
00124         if ( (string)$help['name'] == '' ) {
00125           echo  '<div class="help">' . Pluggable::get_xml_text($plugin['info']['filename'], $help) . '</div>';
00126         }
00127       }
00128     } ?>
00129   </div>
00130 
00131   <?php if ( isset($config) && ($config == true)): ?>
00132   <div id="pluginconfigure">
00133     <?php Plugins::plugin_ui( $configure, $configaction ); ?>
00134     <a class="link_as_button" href="<?php URL::out( 'display_plugins'); ?>"><?php _e('Close'); ?></a>
00135   </div>
00136   <?php endif; ?>
00137 
00138 </div>
00139 
00140 <?php endif; ?>

Generated on Sun Aug 4 2013 12:51:43 for Habari by  doxygen 1.7.1