function indexAction()
 {
     $id = Zend_Auth::getInstance()->hasIdentity();
     $this->view->layout()->maps = false;
     //if(!$id) {
     //echo '<body><div style="width:1000px;margin:0px auto;"><div style="margin:0px auto;"><img
     //		src="/images/UnderConstruction.jpeg" /></div></div></body>';
     //exit;
     //} else {
     $fn = new FM_Components_RSS_FlashNews();
     $this->view->topstories = $this->view->partial('widgets/rss/news.phtml', array('news' => $fn, 'class' => 'rss', 'id' => "fnrss", 'limit' => 30, 'title' => 'flash news', 'icon' => 'flashnew-icon.png'));
     $mn = new FM_Components_RSS_MonmouthNews();
     $this->view->monmouthnews = $this->view->partial('widgets/rss/news.phtml', array('news' => $mn, 'class' => 'rss', 'id' => "mnrss", 'limit' => 30, 'title' => 'mounmouth news 24', 'icon' => 'info_icon.png'));
     $bz = new FM_Components_RSS_Finance();
     $this->view->financenews = $this->view->partial('widgets/rss/news.phtml', array('news' => $bz, 'class' => 'rss', 'id' => "bzrss", 'limit' => 30, 'title' => 'finance', 'icon' => 'finance-icon.png'));
     $en = new FM_Components_RSS_Entertainment();
     $this->view->entertainmentnews = $this->view->partial('widgets/rss/news.phtml', array('news' => $en, 'class' => 'rss', 'id' => "enrss", 'limit' => 30, 'title' => 'entertainment', 'icon' => 'entert-icon.png'));
     $sports = new FM_Components_RSS_Sports();
     $this->view->sportsnews = $this->view->partial('widgets/rss/news.phtml', array('news' => $sports, 'class' => 'rss', 'id' => "sprss", 'limit' => 30, 'title' => 'sports', 'icon' => 'sport-icon.png'));
     $banners = FM_Components_Banner::getSortedRandomBanners(array(), 9);
     $this->view->layout()->banners = $this->view->partial('banner/bannerleftindex.phtml', array('banners' => $banners));
     $featuredOrganization = FM_Components_Organization::getRandom(1, true, array(8));
     $this->view->layout()->featuredOrganization = $this->view->partial('organization/indexfeatured.phtml', array('organization' => $featuredOrganization[1]));
     $this->view->layout()->weather = $this->view->partial('widgets/weather/widget.phtml');
     $spotlight = FM_Components_Organization::getRandom(6, false, array(), true);
     //print_r(count($spotlight));exit;
     $this->view->layout()->spotlight = $this->view->partial('organization/spotlight.phtml', array('organizations' => $spotlight));
     //$recipeOfTheDay = new FM_Components_RSS_Rod();
     //$this->view->layout()->rod = $this->view->partial('widgets/rss/rod.phtml',
     //array('rod'=>$recipeOfTheDay, 'class'=>'rodrss', 'id'=>"rssrod", 'limit'=>1, 'title'=>'RECIPE OF THE DAY', 'icon'=>''));
     $this->view->entertainment = $this->view->partial('widgets/rss/entertainment.phtml');
     //	print_r($recipeOfTheDay);exit;
     $this->view->layout()->astrology = $this->view->partial('widgets/horoscope/full.phtml', array('signs' => FM_Components_RSS_Horoscope::getAll()));
     $headerBanner = new FM_Components_Widgets_BannerLayout($this->view);
     $this->view->layout()->header = $this->view->partial('headers/index.phtml', array('banner' => $headerBanner->toHTML()));
     $c = new FM_Components_Calendar_Month(0, 0, 0);
     $date1 = date('n', time()) == 12 ? date('Y', strtotime("+1 year")) : date('Y', time());
     $date2 = date('n', time()) == 12 || date('n', time()) == 11 ? date('Y', strtotime("+1 year")) : date('Y', time());
     $d = new FM_Components_Calendar_Month(date('n', strtotime("first day of next month")), $date1, 0);
     $e = new FM_Components_Calendar_Month(date('n', strtotime("first day of next month +1 month")), $date2, 0);
     //echo date('n', strtotime("+1 month"));exit;
     $ae[] = $c->getActiveEvents(date('d', time()));
     $ae[] = $d->getActiveEvents(date('d', time()), true);
     $ae[] = $e->getActiveEvents(date('d', time()), true);
     $this->view->calendarrss = $this->view->partial('widgets/rss/calendar.phtml', array('events' => $ae, 'class' => 'rss', 'id' => "evrss", 'title' => 'Events', 'icon' => 'event-icon.png'));
     //	}
 }
 public function toHTML()
 {
     //print_r($this->orgConfig->getCommon());exit;
     $displayElements = array();
     $type = $this->orgObj->getType();
     $common = $this->orgConfig->getCommon();
     $tabs = $common['tabs'];
     $displayElements['orgdataAdmin'] = $orgdataAdmin = $this->_view->partial('widgets/admin/parts/orgdata.phtml', array('orgdata' => $this->orgObj));
     $displayElements['common'] = $common = $this->_view->partial('widgets/admin/parts/common.phtml', array('config' => $this->orgConfig->getCommon(), 'type' => $type));
     //print_r($this->icon);exit;
     $displayElements['topbanners'] = $common = $this->_view->partial('widgets/admin/parts/topbanners.phtml', array('config' => $this->orgConfig->getCommon(), 'type' => $type, 'icon' => $this->icon[0]));
     $displayElements['profile'] = $profile = $this->_view->partial('widgets/admin/parts/profile.phtml', array('profile' => $this->orgObj->get('description'), 'orgType' => $this->orgObj->getType()));
     if ($type == 2) {
         $display = $tabs['realestate'] == 1 ? 'inline' : 'none';
         $displayElements['realestatelist'] = $realestateAdmin = $this->_view->partial('widgets/admin/parts/realestatelist.phtml', array('orgdata' => $this->orgObj, 'display' => $display));
         $menu = $this->menu;
         $display = $tabs['menu'] == 1 ? 'inline' : 'none';
         $displayElements['menu'] = $menu = $this->_view->partial('widgets/admin/parts/menu.phtml', array('orgdata' => $this->orgObj, 'display' => $display, 'orgId' => $this->orgConfig->getOrgId(), 'profile' => $menu['menu']));
         $display = $tabs['coupons'] == 1 ? 'inline' : 'none';
         $displayElements['coupontemplates'] = $couponTemplates = $this->_view->partial('widgets/admin/parts/createcoupon.phtml', array('templates' => $this->couponTemplates, 'display' => $display));
         $displayElements['availCoupons'] = $availCoupons = $this->_view->partial('widgets/admin/parts/managecoupons.phtml', array('coupons' => $this->coupons, 'display' => $display));
         $displayElements['textAd'] = $availCoupons = $this->_view->partial('widgets/admin/parts/textad.phtml', array('orgId' => $this->orgConfig->getOrgId()));
         $displayElements['availtextAds'] = $availBanners = $this->_view->partial('widgets/admin/parts/managetextads.phtml', array('ads' => $this->textAds));
     }
     if ($type != 4) {
         $display = $tabs['products'] == 1 ? 'inline' : 'none';
         $displayElements['productlist'] = $productlistAdmin = $this->_view->partial('widgets/admin/parts/productlist.phtml', array('orgdata' => $this->orgObj, 'display' => $display));
         $siteConfig = new FM_Components_SiteConfig();
         if ($type == 2 || $siteConfig->npBannersEnabled()) {
             $display = $tabs['banners'] == 1 ? 'inline' : 'none';
             $displayElements['bannertemplates'] = $bannerTemplates = $this->_view->partial('widgets/admin/parts/createbanner.phtml', array('templates' => $this->bannerTemplates, 'display' => $display, 'form' => new FM_Forms_Admin_Banner()));
             $displayElements['availBanners'] = $availBanners = $this->_view->partial('widgets/admin/parts/managebanners.phtml', array('banners' => $this->banners, 'display' => $display));
         }
         $display = $tabs['services'] == 1 ? 'inline' : 'none';
         $services = $this->services;
         $displayElements['services'] = $services = $this->_view->partial('widgets/admin/parts/services.phtml', array('orgdata' => $this->orgObj, 'display' => $display, 'orgId' => $this->orgConfig->getOrgId(), 'profile' => $services['services']));
         $display = $tabs['reviews'] == 1 ? 'inline' : 'none';
         $displayElements['testimonials'] = $displayElements[] = $testimonials = $this->_view->partial('widgets/admin/parts/testimonials.phtml', array('testimonials' => $this->testimonials, 'display' => $display, 'orgId' => $this->orgConfig->getOrgId()));
     }
     if ($type == 4) {
         $displayElements['sportsuser'] = $displayElements[] = $testimonials = $this->_view->partial('widgets/admin/parts/addsportsuser.phtml', array('users' => $this->sportsusers));
         $displayElements['sendemail'] = $displayElements[] = $sendemail = $this->_view->partial('widgets/admin/parts/sendemail.phtml', array('users' => $this->sportsusers, 'emails' => $this->sportsemails));
         $displayElements['emaillist'] = $displayElements[] = $sendemail = $this->_view->partial('widgets/admin/parts/emaillist.phtml', array('emails' => $this->sportsemails));
         $menu = $this->menu;
         $display = $tabs['sportsschedule'] == 1 ? 'inline' : 'none';
         $displayElements['sportsschedule'] = $sportsschedule = $this->_view->partial('widgets/admin/parts/sportsschedule.phtml', array('orgdata' => $this->orgObj, 'display' => 'inline', 'orgId' => $this->orgConfig->getOrgId(), 'profile' => $this->schedule['schedule']));
         $displayElements['pwd'] = $this->_view->partial('widgets/admin/parts/pwdprotect.phtml', array('sport' => $this->orgObj));
     }
     $calendarForm = new FM_Forms_Events();
     $c = new FM_Components_Calendar_Month(0, 0, $this->orgConfig->getOrgId());
     $display = $tabs['events'] == 1 ? 'inline' : 'none';
     $displayElements['calendar'] = $calendar = $this->_view->partial('widgets/admin/parts/calendar.phtml', array('form' => $calendarForm, 'events' => $c->getDaysWithEvents(), 'orgId' => $this->orgConfig->getOrgId(), 'display' => $display, 'type' => $type));
     $displayElements['availEvents'] = $displayElements[] = $sendemail = $this->_view->partial('widgets/admin/parts/manageevents.phtml', array('events' => FM_Components_Calendar_Month::getAll($this->orgConfig->getOrgId()), 'display' => $display));
     return $this->_view->partial('widgets/admin/widget.phtml', $displayElements);
 }
 public function ajaxgeteventAction()
 {
     $e = FM_Components_Calendar_Month::getEventAsArray($_POST['id']);
     print count($e) ? Zend_Json::encode($e) : '0';
     exit;
 }