public function printComponent($args, ffOptionsQuery $query)
 {
     //        echo'bbb';
     //        return;
     //		var_dump( $args );
     echo $args['before_widget'];
     echo $args['before_title'];
     echo ff_wp_kses($query->get('contact-us title'));
     echo $args['after_title'];
     echo '<ul>';
     foreach ($query->get('contact-us description-boxes') as $oneBox) {
         echo '<li>';
         foreach ($oneBox->get('lines') as $oneLine) {
             $type = $oneLine->getVariationType();
             if ($type == 'one-line') {
                 echo ff_wp_kses($oneLine->get('text')) . '<br>';
             } else {
                 if ($type == 'one-heading') {
                     echo '<span>' . ff_wp_kses($oneLine->get('text')) . '</span>';
                 } else {
                     if ($type == 'one-email') {
                         echo '<a href="mailto:' . esc_attr($oneLine->get('text')) . '">' . ff_wp_kses($oneLine->get('text')) . '</a><br>';
                     }
                 }
             }
         }
         echo '</li>';
     }
     echo '</ul>';
     echo $args['after_widget'];
 }
    public function printComponent($args, ffOptionsQuery $query)
    {
        extract($args);
        echo $before_widget;
        $title = trim($query->get('twitter title'));
        if (!empty($title)) {
            echo $before_title . zero__wp_kses($title) . $after_title;
        }
        $twitterFeeder = ffContainer::getInstance()->getLibManager()->createTwitterFeeder();
        ffContainer::getInstance()->getClassLoader()->loadClass('ffOptionsHolder_Twitter');
        $tweetsCollection = $twitterFeeder->getTwitterFeed($query->get('twitter fw_twitter'));
        if (!$tweetsCollection->valid()) {
            echo '<p class="twitter-oops">Oops!</p>';
            echo '<p>Bad Twitter account data!</p>';
        } else {
            wp_enqueue_script('zero-twitter-widget-1-js');
            ?>
			<div class="twitter-widget-1 ff-block">
				<div class="tweets">
					<div class="swiper-container">
						<div class="swiper-wrapper">
							<?php 
            foreach ($tweetsCollection as $oneTweet) {
                ?>
								<div class="tweet swiper-slide">
									<div class="tweet-inner">
										<div class="tweet-content">
											<?php 
                echo zero__wp_kses($oneTweet->textWithLinks);
                ?>
										</div>
									</div>
								</div>
							<?php 
            }
            ?>
						</div>
					</div>
				</div>
				<div class="tweets-footer clearfix">
					<div class="pull-left">
						<?php 
            echo '<a href="' . esc_url('http://twitter.com/' . esc_attr($query->get('twitter fw_twitter username'))) . '" class="tweet-author">';
            echo '<i class="fa fa-twitter"></i> ';
            echo esc_attr($query->get('twitter fw_twitter username'));
            echo '</a>';
            ?>
					</div>
					<div class="pull-right">
						<div class="twitter-pagination"></div>
					</div>
				</div>
			</div>
		<?php 
        }
        echo $after_widget;
    }
 public function createOptionsQuery($data, $structures = null)
 {
     if (is_string($structures)) {
         $structures = $this->_getOptionsholderfactory()->createOptionsHolder($structures);
     }
     $this->_getClassloader()->loadClass('ffOptionsQuery');
     $arrayConvertor = $this->_getOptionsarrayconvertorfactory()->createArrayConvertor();
     $WPLayer = ffContainer::getInstance()->getWPLayer();
     $query = new ffOptionsQuery($data, $structures, $arrayConvertor);
     $query->setWPLayer($WPLayer);
     return $query;
 }
 public function printComponent($args, ffOptionsQuery $query)
 {
     //        echo'bbb';
     //        return;
     extract($args);
     //$fw_twitter = $query->get('fw_twitter');
     //$username = $fw_twitter->get('username');
     $twitterFeeder = ffContainer::getInstance()->getLibManager()->createTwitterFeeder();
     ffContainer::getInstance()->getClassLoader()->loadClass('ffOptionsHolder_Twitter');
     $tweetsCollection = $twitterFeeder->getTwitterFeed($query->get('twitter fw_twitter'));
     //var_dump( $tweetsCollection);
     $tweetsText = '';
     if (!$tweetsCollection->valid()) {
         $tweetsText .= '<li>';
         $tweetsText .= '<span class="tweet_text">';
         $tweetsText .= '<p class="twitter-oops">Oops!</p>';
         $tweetsText .= '<p>Bad Twitter account data!</p>';
         $tweetsText .= '</span>';
         $tweetsText .= '</li>';
     } else {
         foreach ($tweetsCollection as $oneTweet) {
             $tweetsText .= '<li>';
             $tweetsText .= '<span class="tweet_text">';
             $tweetsText .= $oneTweet->textWithLinks;
             $tweetsText .= '</span>';
             $tweetsText .= '<span class="tweet_time">';
             $timeFormat = 'g:i A - j M Y';
             $time = strtotime($oneTweet->date);
             $date = date($timeFormat, $time);
             $tweetsText .= '<a href="' . esc_url('http://twitter.com/' . esc_attr($query->get('twitter fw_twitter username'))) . '"> ';
             $tweetsText .= $date;
             $tweetsText .= '</a>';
             $tweetsText .= '</span>';
             $tweetsText .= '</li>';
         }
     }
     echo $before_widget;
     $title = trim($query->get('twitter title'));
     if (!empty($title)) {
         // Default WP text
         echo $before_title . ff_wp_kses($title) . $after_title;
     }
     echo '<ul>';
     echo $tweetsText;
     echo '</ul>';
     echo $after_widget;
 }
 public function printComponent($args, ffOptionsQuery $query)
 {
     $categories = $query->getMultipleSelect('latest-news categories');
     $numberOfPosts = $query->get('latest-news number-of-posts');
     $postGetter = ffContainer()->getPostLayer()->getPostGetter();
     $posts = $postGetter->setFilterRelation_OR()->setNumberOfPosts($numberOfPosts)->filterByCategory($categories)->getAllPosts();
     echo $args['before_widget'];
     echo $args['before_title'];
     echo ff_wp_kses($query->get('latest-news title'));
     echo $args['after_title'];
     echo '<ul';
     if ('alt' == $query->get('latest-news style')) {
         echo ' class="alt"';
     }
     echo '>';
     if ('alt' == $query->get('latest-news style')) {
         foreach ($posts as $onePost) {
             $featuredImageUrl = $onePost->getFeaturedImage();
             if (empty($featuredImageUrl)) {
                 continue;
             }
             $featuredImageUrlResized = fImg::resize($featuredImageUrl, 65, 65, true);
             echo '<li>';
             echo '<img src="' . esc_url($featuredImageUrlResized) . '" alt="">';
             echo '<a href="' . get_permalink($onePost->getID()) . '" class="post-title">' . ff_wp_kses($onePost->getTitle()) . '</a>';
             echo '<p class="post-date">' . ff_wp_kses($onePost->getDateFormated('F d, Y')) . '</p>';
             echo '</li>';
         }
     } else {
         foreach ($posts as $onePost) {
             $featuredImageUrl = $onePost->getFeaturedImage();
             if (empty($featuredImageUrl)) {
                 continue;
             }
             $featuredImageUrlResized = fImg::resize($featuredImageUrl, 80, 80, true);
             echo '<li>';
             echo '<img src="' . esc_url($featuredImageUrlResized) . '" alt="">';
             echo '<p class="news-title">';
             echo '<a href="' . get_permalink($onePost->getID()) . '">' . ff_wp_kses($onePost->getTitle()) . '</a>';
             echo '</p>';
             echo '<p class="news-date">' . ff_wp_kses($onePost->getDateFormated('F d, Y')) . '</p>';
             echo '</li>';
         }
     }
     echo '</ul>';
     echo $args['after_widget'];
 }
 public function printComponent($args, ffOptionsQuery $query)
 {
     $categories = $query->getMultipleSelect('latest-portfolio categories');
     $categoriesCheck = $query->get('latest-portfolio categories');
     if (empty($categoriesCheck) || $categoriesCheck == 'all') {
         $categories = null;
     }
     $numberOfPosts = $query->get('latest-portfolio number-of-posts');
     $postGetter = ffContainer()->getPostLayer()->getPostGetter();
     $posts = $postGetter->setFilterRelation_OR()->setNumberOfPosts($numberOfPosts)->filterByTaxonomy($categories, 'ff-portfolio-category')->getAll();
     //        var_dump( $posts, $categories, $numberOfPosts );
     //        var_Dump( $posts );
     echo $args['before_widget'];
     echo $args['before_title'];
     echo ff_wp_kses($query->get('latest-portfolio title'));
     echo $args['after_title'];
     if (!empty($posts)) {
         echo '<div class="portfolio-photos">';
         foreach ($posts as $onePost) {
             $featuredImage = $onePost->getFeaturedImage();
             if (empty($featuredImage)) {
                 continue;
             }
             echo '<div class="portfolio-badge-image">';
             echo '<a href="' . get_permalink($onePost->getID()) . '">';
             echo '<img width="75" height="75" title="" alt="" src="' . esc_url(fImg::resize($featuredImage, 75, 75, true)) . '">';
             echo '</a>';
             echo '</div>';
         }
         if ($query->get('latest-portfolio show-description')) {
             echo '<p>' . ff_wp_kses($query->get('latest-portfolio description')) . '</p>';
         }
         echo '</div>';
     }
     echo $args['after_widget'];
 }
 function ff_print_before_section(ffOptionsQuery $query)
 {
     /**********************************************************************************************************************/
     /* FULLWIDTH SECTION SETTINGS
        /**********************************************************************************************************************/
     $general = $query->get('general');
     $boxed = $query->get('boxed');
     $container = $query->get('container');
     // html ID
     $id = '';
     if ($general->get('id') != '') {
         $id = 'id="' . $general->get('id') . '"';
     }
     $colorClass = '';
     if ($general->get('color-type') == 'dark') {
         $colorClass = ' full-section';
     }
     $fullscreenClass = '';
     if ($container->get('is-fulscreen')) {
         $fullscreenClass = ' full-screen';
     }
     $fullwidth = $query->get('fullwidth');
     $style = array();
     $styleString = '';
     if ($fullwidth->get('apply')) {
         if ($fullwidth->get('padding-top') != 'default') {
             $style[] = 'padding-top:' . absint($fullwidth->get('padding-top')) . 'px;';
         }
         if ($fullwidth->get('padding-bottom') != 'default') {
             $style[] = 'padding-bottom:' . absint($fullwidth->get('padding-bottom')) . 'px;';
         }
         if ($fullwidth->get('margin-top') != 'default') {
             $style[] = 'margin-top:' . absint($fullwidth->get('margin-top')) . 'px;';
         }
         if ($fullwidth->get('margin-bottom') != 'default') {
             $style[] = 'margin-bottom:' . absint($fullwidth->get('margin-bottom')) . 'px;';
         }
     }
     if (!empty($style)) {
         $styleString = 'style="' . esc_attr(implode(' ', $style)) . '"';
     }
     echo '<div class="ff-section-fullwidth' . esc_attr($colorClass . $fullscreenClass) . '" ' . $styleString . ' ' . $id . '>';
     if ($fullwidth->get('apply')) {
         ff_load_section_printer('section-background', $fullwidth->get('background'));
     }
     /**********************************************************************************************************************/
     /* BOXED
        /**********************************************************************************************************************/
     $style = array();
     $styleString = '';
     if ($boxed->get('apply')) {
         if ($boxed->get('width-type') == 'from-input') {
             if ($boxed->get('maxwidth') != '') {
                 $style[] = 'max-width:' . absint($boxed->get('maxwidth')) . 'px;';
             }
         } else {
             $style[] = 'max-width:none;';
         }
         if ($boxed->get('padding-top') != 'default') {
             $style[] = 'padding-top:' . absint($boxed->get('padding-top')) . 'px;';
         }
         if ($boxed->get('padding-bottom') != 'default') {
             $style[] = 'padding-bottom:' . absint($boxed->get('padding-bottom')) . 'px;';
         }
     }
     $fullscreenClass = '';
     if ($container->get('is-fulscreen')) {
         $fullscreenClass = ' full-section-content';
     }
     if (!empty($style)) {
         $styleString = 'style="' . esc_attr(implode(' ', $style)) . '"';
     }
     echo '<div class="ff-section-boxed' . esc_attr($fullscreenClass) . '" ' . $styleString . '>';
     if ($fullwidth->get('apply')) {
         ff_load_section_printer('section-background', $boxed->get('background'));
     }
     /**********************************************************************************************************************/
     /* CONTAINER
        /**********************************************************************************************************************/
     $class = 'container';
     if ($container->get('apply')) {
         if ($container->get('type') == 'not') {
             $class = 'container';
         } else {
             if ($container->get('type') == 'fluid') {
                 $class = 'container-fluid';
             } else {
                 if ($container->get('type') == 'fullwidth') {
                     $class = 'container-fullwidth';
                 }
             }
         }
     }
     if ($container->get('apply') && $container->get('type') == 'fluid') {
         $class = 'container-fluid';
     }
     echo '<div class="' . esc_attr($class) . '">';
 }
 public function evaluate(ffOptionsQuery $query)
 {
     $logicUseOrNot = $query->get('logic-use-or-not logic_use_or_not');
     if ($logicUseOrNot == 0) {
         return true;
     }
     //        $query->debug_dump();
     $logicOr = $query->get('logic-or');
     //$logicalStructure->debug_dump();
     $print = false;
     foreach ($logicOr as $oneOr) {
         $allConditionsAreGood = true;
         foreach ($oneOr->get('logic-and') as $oneAnd) {
             //$oneAnd->debug_dump();
             $andContent = array();
             $andContent['content_id'] = $oneAnd->get('content_id');
             $andContent['equal'] = $oneAnd->get('equal');
             $andContent['content_type'] = $oneAnd->get('content_type');
             $idArray = is_array($andContent['content_id']) ? $andContent['content_id'] : explode('--||--', $andContent['content_id']);
             $content_type = $andContent['content_type'];
             $groupInfo = $this->_getGroupInfo($content_type);
             $type = $groupInfo['type'];
             $equality = $andContent['equal'];
             switch ($groupInfo['group']) {
                 case 'tax':
                     $allConditionsAreGood = $this->_tax($type, $equality, $idArray);
                     break;
                 case 'posted-in':
                     $allConditionsAreGood = $this->_postedIn($type, $equality, $idArray);
                     break;
                 case 'post':
                     $allConditionsAreGood = $this->_postType($type, $equality, $idArray);
                     break;
                 case 'post-extra':
                     $allConditionsAreGood = $this->_postExtra($type, $equality, $idArray);
                     break;
                     // case 'users' :      $allConditionsAreGood = $this->_users(      $type, $equality, $idArray); break;
                 // case 'users' :      $allConditionsAreGood = $this->_users(      $type, $equality, $idArray); break;
                 case 'plugins':
                     $allConditionsAreGood = $this->_plugins($type, $equality, $idArray);
                     break;
                 case 'modules':
                     $allConditionsAreGood = $this->_modules($type, $equality, $idArray);
                     break;
                 case 'system':
                     $allConditionsAreGood = $this->_system($type, $equality, $idArray);
                     break;
                 case 'time':
                     $allConditionsAreGood = $this->_time($type, $equality, $idArray);
                     break;
             }
             if ($allConditionsAreGood == false) {
                 break;
             }
         }
         if ($allConditionsAreGood == true) {
             $print = true;
             break;
         }
     }
     return $print;
 }
 private function _getOAuth(ffOptionsQuery $query)
 {
     $consumerKey = $query->get('consumer-key');
     $consumerSecret = $query->get('consumer-secret');
     $accessToken = $query->get('access-token');
     $accessTokenSecret = $query->get('access-token-secret');
     $oAuth = null;
     if ($consumerKey !== null && $consumerSecret !== null && $accessToken !== null && $accessTokenSecret !== null) {
         $oAuth = $this->_getOauthfactory()->getOAuthConnection($consumerKey, $consumerSecret, $accessToken, $accessTokenSecret);
     }
     return $oAuth;
 }
 public function getNew($query)
 {
     $query = new ffOptionsQuery($this->_data, $this->_getOptionsHolder(), $this->_getArrayConvertor(), $query, $this->_optionsStructureHasBeenCompared);
     $query->setWPLayer($this->_getWPLayer());
     return $query;
 }