コード例 #1
0
ファイル: widget-contact.php プロジェクト: schiz/scrollax
    /**
     *
     */
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', empty($instance['title']) ? __('Contact Info', MISS_TEXTDOMAIN) : $instance['title'], $instance, $this->id_base);
        $name = isset($instance['name']) ? $instance['name'] : '';
        $address = isset($instance['address']) ? $instance['address'] : '';
        $city = isset($instance['city']) ? $instance['city'] : '';
        $state = isset($instance['state']) ? $instance['state'] : '';
        $zip = isset($instance['zip']) ? $instance['zip'] : '';
        $phone = isset($instance['phone']) ? $instance['phone'] : '';
        $fax = isset($instance['fax']) ? $instance['fax'] : '';
        $email = isset($instance['email']) ? $instance['email'] : '';
        $site = isset($instance['site']) ? $instance['site'] : '';
        ?>
	
        <?php 
        echo $before_widget;
        ?>

		<?php 
        echo $before_title . $title . $after_title;
        ?>
		<ul class="plain_contacts_widget">
		<li class="contact_widget_addres"><i class="im-icon-office"></i>
		<?php 
        if ($name) {
            ?>
		<?php 
            echo $name . ', <br />';
        }
        ?>
		<?php 
        if ($address) {
            ?>
		<?php 
            echo $address . '<br />';
        }
        ?>
		<?php 
        if ($zip) {
            ?>
		<?php 
            echo $zip . ', ';
        }
        ?>
		<?php 
        if ($state) {
            ?>
		<?php 
            echo $state . ' ';
        }
        ?>
		<?php 
        if ($city) {
            ?>
		<?php 
            echo $city;
        }
        ?>
		</li>
		<?php 
        if ($phone) {
            ?>
		<li class="contact_widget_phone"><i class="im-icon-phone-3"></i><?php 
            echo $phone;
            ?>
</li><?php 
        }
        ?>
		<?php 
        if ($fax) {
            ?>
		<li class="contact_widget_fax"><i class="im-icon-print-2"></i><?php 
            echo $fax;
            ?>
</li><?php 
        }
        ?>
		<?php 
        if ($email) {
            ?>
		<li class="contact_widget_email"><i class="im-icon-envelop"></i><a href="#" rel="<?php 
            echo miss_nospam($email);
            ?>
" class="email_link_replace mailto"><?php 
            echo miss_nospam($email);
            ?>
</a></li> <?php 
        }
        ?>
		<?php 
        if ($site) {
            ?>
		<li class="contact_widget_site"><i class="im-icon-earth"></i><a href="<?php 
            echo $site;
            ?>
"><?php 
            echo $site;
            ?>
</a></li> <?php 
        }
        ?>
		</ul>
        <?php 
        echo $after_widget;
    }
コード例 #2
0
ファイル: widget-contacts.php プロジェクト: schiz/scrollax
    /**
     *
     */
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', empty($instance['title']) ? __('Contacts', MISS_TEXTDOMAIN) : $instance['title'], $instance, $this->id_base);
        $name = isset($instance['name']) ? $instance['name'] : '';
        $address = isset($instance['address']) ? $instance['address'] : '';
        $city = isset($instance['city']) ? $instance['city'] : '';
        $state = isset($instance['state']) ? $instance['state'] : '';
        $zip = isset($instance['zip']) ? $instance['zip'] : '';
        $phone = isset($instance['phone']) ? $instance['phone'] : '';
        $fax = isset($instance['fax']) ? $instance['fax'] : '';
        $email = isset($instance['email']) ? $instance['email'] : '';
        $site = isset($instance['site']) ? $instance['site'] : '';
        ?>
	
        <?php 
        echo $before_widget;
        ?>

		<?php 
        echo $before_title . $title . $after_title;
        ?>

                <?php 
        if ($name) {
            ?>
                <?php 
            echo '<h6>' . $name . '</h6>';
        }
        ?>

		<ul class="im_contacts_widget">
		<?php 
        if ($phone) {
            ?>
		  <li class="contact_widget_phone"><span class="contacts-details"><?php 
            _e('Phone', MISS_TEXTDOMAIN);
            ?>
:</span>
                  <span class="phone"><?php 
            echo $phone;
            ?>
</span>
                </li>
                <?php 
        }
        ?>
		<?php 
        if ($fax) {
            ?>
		<li class="contact_widget_fax">
                  <span class="contacts-details"><?php 
            _e('Fax', MISS_TEXTDOMAIN);
            ?>
:</span>
                  <span class="phone"><?php 
            echo $fax;
            ?>
</span>
                </li>
                <?php 
        }
        ?>
		<?php 
        if ($email) {
            ?>
		<li class="contact_widget_email" style="margin-top: 10px;">
                  <span class="contacts-details"><?php 
            _e('E-Mail', MISS_TEXTDOMAIN);
            ?>
:</span>
                  <a href="#" rel="<?php 
            echo miss_nospam($email);
            ?>
" class="email_link_replace mailto"><?php 
            echo miss_nospam($email);
            ?>
</a></li> <?php 
        }
        ?>
		<?php 
        if ($site) {
            ?>
		<li class="contact_widget_site">
                  <span class="contacts-details"><?php 
            _e('Web', MISS_TEXTDOMAIN);
            ?>
:</span>
                  <a href="<?php 
            echo $site;
            ?>
"><?php 
            echo $site;
            ?>
</a></li> <?php 
        }
        ?>
  <?php 
        if ($address) {
            ?>

                <li style="margin-bottom: 6px; margin-top: 10px;" class="contact_widget_addres">
                  <?php 
            echo $address;
            ?>
                </li>
  <?php 
        }
        ?>
  <?php 
        if ($state) {
            ?>
                <li>
                  <i class="im-icon-location-4" style="float: left; font-size:16px"></i>&nbsp;<a href="<?php 
            echo $state;
            ?>
&iframe=true&width=50%&height=50%" rel="prettyPhoto[iframes]"><?php 
            _e('View map', MISS_TEXTDOMAIN);
            ?>
</a>
                </li>
		</ul>
  <?php 
        }
        ?>
        <?php 
        echo $after_widget;
    }