Plugin Directory


Ignore:
Timestamp:
01/29/2010 02:34:53 PM (16 years ago)
Author:
Txanny
Message:

Released SidePosts 3.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sideposts/trunk/framework/lib/themes.php

    r196960 r199488  
    132132    }
    133133}
     134
     135/**
     136 * Authoring widget for admin pages.
     137 * You can add a readme.txt file for themes to add aditional links not found on style.css
     138 * Additional strings searched at readme.txt are: 'Help link:' and 'Docs link'.
     139 * All others follow plugins readme.txt guidelines.
     140 *
     141 * @since 0.5
     142 *
     143 * @param string $mod_id Module ID
     144 * @return void
     145 */
     146function ak_admin_authoring ( $mod_id )
     147{
     148    $mod = ak_get_object($mod_id);
     149    if ( ! $mod ) {
     150        return;
     151    }
     152    $data = $mod->getModData();
     153?>
     154
     155    <dl>
     156        <dt><?php echo $data['Name']; ?></dt>
     157        <dd>
     158            <ul>
     159                <?php if ( ! empty($data['PluginURI']) ) : ?>
     160                    <li><a href="<?php echo $data['PluginURI']; ?>" class="<?php echo $mod_id; ?>" target="_blank"><?php _e('Plugin Homepage', 'akfw'); ?></a></li>
     161                <?php endif; ?>
     162
     163                <?php if ( ! empty($data['URI']) ) : ?>
     164                    <li><a href="<?php echo $data['URI']; ?>" class="theme" target="_blank"><?php _e('Theme Homepage', 'akfw'); ?></a></li>
     165                <?php endif; ?>
     166
     167                <?php if ( ! empty($data['DocsURI']) ) : ?>
     168                    <li><a href="<?php echo $data['DocsURI']; ?>" class="docs" target="_blank"><?php _e('Documentation', 'akfw'); ?></a></li>
     169                <?php endif; ?>
     170
     171                <?php if ( ! empty($data['HelpURI']) ) : ?>
     172                    <li><a href="<?php echo $data['HelpURI']; ?>" class="help" target="_blank"><?php _e('Support Forum', 'akfw'); ?></a></li>
     173                <?php endif; ?>
     174
     175                <?php if ( ! empty($data['AuthorURI']) ) : ?>
     176                    <li><a href="<?php echo $data['AuthorURI']; ?>" class="home" target="_blank"><?php _e('Author Homepage', 'akfw')?></a></li>
     177                <?php endif; ?>
     178
     179                <?php if ( ! empty($data['DonateURI']) ) : ?>
     180                    <li><a href="<?php echo $data['DonateURI']; ?>" class="donate" target="_blank"><?php _e('Donate to project', 'akfw')?></a></li>
     181                <?php endif; ?>
     182            </ul>
     183        </dd>
     184    </dl>
     185<?php
     186}
     187
     188/**
     189 * Copyright, authoring and versions for admin pages footer.
     190 *
     191 * @since 0.5
     192 *
     193 * @param string $mod_id Module ID
     194 * @param int $year First copyrigh year.
     195 * @return void
     196 */
     197function ak_admin_footer ( $mod_id, $year = 2009 )
     198{
     199    $mod = ak_get_object($mod_id);
     200    if ( ! $mod ) {
     201        return;
     202    }
     203    $data = $mod->getModData();
     204
     205    if ( $mod->isPlugin() ) {
     206        echo '<p class="footer"><a href="' . $mod->getModData('PluginURI') . '">' . $mod->getModData('Name') . ' ' . $mod->getModData('Version') .
     207             '</a> &nbsp; &copy; Copyright ';
     208        if ( 2010 != $year ) {
     209            echo $year . '-';
     210        }
     211        echo date('Y') . ' ' . $mod->getModData('Author');
     212    } elseif ( $mod->isTheme() ) {
     213        echo '<p class="footer"><a href="' . $mod->getModData('URI') . '">' . $mod->getModData('Name') . ' ' . $mod->getModData('Version') .
     214             '</a> &nbsp; &copy; Copyright ';
     215        if ( 2010 != $year ) {
     216            echo $year . '-';
     217        }
     218        echo date('Y') . ' ';
     219        echo $mod->getModData('Author');
     220    }
     221
     222    echo '<br />Framework Version: ' . get_option('ak_framework_version');
     223    if ( $mod->isChildTheme() ) {
     224        echo ' - Child theme: ' . $mod->getChildData('Name') . ' ' . $mod->getChildData('Version');
     225    }
     226    echo '</p>';
     227}
Note: See TracChangeset for help on using the changeset viewer.