public function editAction()
 {
     $id = $this->_request->getParam('id');
     if ($id) {
         $banner = new FM_Components_Banner(array('id' => $id));
         if ($banner) {
             print Zend_Json::encode($banner->toArray());
             exit;
         }
     }
 }
 public function init()
 {
     parent::init();
     $banners = FM_Components_Banner::getSortedRandomBanners(array());
     $this->view->layout()->banners = $this->view->partial('banner/bannerleftindex.phtml', array('banners' => $banners));
     $spotlight = FM_Components_Organization::getRandom(6, false, array(), true);
     $this->view->layout()->spotlight = $this->view->partial('organization/spotlight.phtml', array('organizations' => $spotlight));
     $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()->header = $this->view->partial('headers/index.phtml');
 }
 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 __construct($view, $orgConfig, $orgObj)
 {
     //print_r($orgObj);exit;
     $this->_view = $view;
     $this->orgConfig = $orgConfig;
     $this->orgObj = $orgObj;
     $testimonialTable = new FM_Models_FM_Testimonials();
     $this->testimonials = $testimonialTable->getTestimonialsByKeys(array('orgId' => $this->orgConfig->getOrgId()));
     //print_r($this->testimonials);exit;
     $this->couponTemplates = FM_Components_Util_CouponTemplate::getActive();
     $this->coupons = FM_Components_Coupon::getAllOrgCoupons($this->orgConfig->getOrgId());
     $this->bannerTemplates = FM_Components_Util_BannerTemplate::getActive();
     $this->banners = FM_Components_Banner::getOrgBanners($this->orgConfig->getOrgId());
     $this->sportsusers = FM_Components_SportsUser::getAll($this->orgConfig->getOrgId());
     $this->sportsemails = FM_Components_Util_Email::getAll($this->orgConfig->getOrgId());
     $sm = new FM_Models_FM_Services();
     $this->services = $sm->getServiceByKeys(array('orgId' => $this->orgConfig->getOrgId()));
     $mm = new FM_Models_FM_Menu();
     $this->menu = $mm->getMenuByKeys(array('orgId' => $this->orgConfig->getOrgId()));
     $ss = new FM_Models_FM_SportsSchedule();
     $this->schedule = $ss->getScheduleByKeys(array('orgId' => $this->orgConfig->getOrgId()));
     $this->textAds = FM_Components_Util_TextAd::getOrgAds($this->orgConfig->getOrgId());
     $this->icon = FM_Components_Util_Icon::getOrgActive($this->orgConfig->getOrgId());
     $view->headScript()->appendFile('/js/widgets/coupon.js', 'text/javascript');
     //$view->headScript()->appendFile(
     //'/js/widgets/admin.js',
     //'text/javascript'
     //);
     $view->headScript()->appendFile('/js/widgets/banner.js', 'text/javascript');
     //$view->headScript()->appendFile(
     //'/js/swfupload/swfupload.js',
     //'text/javascript'
     //);
     $this->_view->headScript()->appendFile('/js/tiny_mce/tiny_mce.js', 'text/javascript');
     //$view->headScript()->appendFile(
     //'/js/widgets/photogallery.js',
     //'text/javascript'
     //);
 }
 public function uploadbannerAction()
 {
     if ($this->_request->isPost()) {
         $_FILES['userfile']['name'] = $_POST['id'] . '_' . date('YmdHis', time()) . str_ireplace(array(' ', '_', '-'), '', strtolower($_FILES['userfile']['name']));
         $fileHandler = new FM_Components_Util_UploadHandler($_FILES['userfile']);
         $folder = $fileHandler->setFolder('banner');
         if ($fileHandler->move()) {
             list($width, $height, $type, $attr) = getimagesize($_SERVER['DOCUMENT_ROOT'] . $folder . '/' . $_FILES['userfile']['name']);
             $uploadedData['width'] = $width;
             $uploadedData['height'] = $height;
             $uploadedData['path'] = $folder;
             $uploadedData['medianame'] = $_FILES['userfile']['name'];
             FM_Components_Banner::updateBanner(array('id' => $_POST['id']), $uploadedData);
             print $_FILES['userfile']['name'];
         } else {
             print '0';
         }
     } else {
         print '0';
     }
     exit;
 }
 public function ajaxdeletebannerAction()
 {
     if ($_POST && array_key_exists('id', $_POST) && $_POST['id'] != '') {
         if (FM_Components_Banner::deleteBanner(array('id' => $_POST['id']))) {
             print $_POST['id'];
         } else {
             print '0';
         }
     } else {
         print '0';
     }
     exit;
 }
 function indexAction()
 {
     $this->_helper->layout->setLayout('layout2col');
     $this->view->layout()->cols = 2;
     if ($this->_request->getParam('id') == 0 || !($this->_business = new FM_Components_Sports(array('id' => $this->_request->getParam('id'))))) {
         $this->_redirect('/');
     }
     //print_r($this->_business);exit;
     if (!$this->_business->getId()) {
         $this->_redirect('/');
     }
     if ($this->_business->getType() == 2) {
         $this->_redirect('/merchant/' . $this->_request->getParam('id'));
     }
     if ($this->_business->getType() == 3) {
         $this->_redirect('/org/' . $this->_request->getParam('id'));
     }
     if (!$this->_user && !$this->_business->getActive()) {
         $this->_redirect('/');
     }
     if (!$this->_business->getActive() && !($this->_user->isRoot() || $this->_user->frontEndAdmin())) {
         $this->_redirect('/');
     }
     $this->view->orgId = $this->_request->getParam('id');
     $myNamespace = new Zend_Session_Namespace('sportsuser');
     $sportsuser = false;
     if (isset($myNamespace->auth) && $myNamespace->auth == true) {
         //print_r(unserialize($myNamespace->auth));exit;
         $sportsuser = unserialize($myNamespace->auth);
         $this->view->sportsuser = unserialize($myNamespace->auth);
     }
     $orgConfig = $this->_business->getOrgConfig();
     $common = $orgConfig->getTabs();
     $siteAdmin = false;
     if ($this->_user && ($this->_user->inOrg($this->_request->getParam('id')) || $this->_user->isRoot())) {
         //user is admin for this group, show edit
         $siteAdmin = $this->_user;
     }
     $banners = FM_Components_Banner::getSortedRandomBanners();
     $this->view->layout()->banners = $this->view->partial('banner/bannerleftindex.phtml', array('banners' => $banners));
     $this->view->layout()->leftcol = $this->view->partial('b2b/leftcol.phtml', array('orgdata' => $this->view->partial('widgets/profile/synop.phtml', array('org' => $this->_business)), 'banners' => $banners));
     $tg = new FM_Components_Tabs_TabGroup();
     if ($sportsuser || !$this->_business->isProtected() || $siteAdmin) {
         $tab = new FM_Components_Tabs_Profile();
         $tab->setProfile($this->_business->get('description'));
         $tg->addTab($tab, 'profile', 'profile', true);
         $gallery = new FM_Components_Widgets_PhotoGallery($this->view, $this->_request->getParam('id'), 'photogallery', $siteAdmin);
         $media = new FM_Components_Tabs_Media($this->_request->getParam('id'), true);
         $media->setProfile('This is the profile tab');
         $tg->addTab($media, 'media', 'media', false);
         $calendarTab = new FM_Components_Tabs_Calendar($this->_request->getParam('id'));
         $tg->addTab($calendarTab, 'events', 'calendar', false);
         if ($common['forum']) {
             $forum = new FM_Components_Tabs_Forum($this->_request->getParam('id'), $siteAdmin, $sportsuser);
             $tg->addTab($forum, 'forum', 'forum', false);
         }
         if ($common['directions']) {
             $dir = new FM_Components_Tabs_Directions($this->_business);
             $dir->setProfile('these are directions');
             $tg->addTab($dir, 'directions', 'directions', false);
         }
         $spsch = new FM_Components_Tabs_SportsSchedule($this->_business);
         $tg->addTab($spsch, 'schedule', 'schedule', false);
         if ($common['contact']) {
             $dir = new FM_Components_Tabs_Contact($this->_request->getParam('id'));
             $dir->setProfile('these are directions');
             $tg->addTab($dir, 'contact us', 'contact', false);
         }
         $this->view->video = false;
         $this->view->photo = false;
         if ($common['media']) {
             $this->view->layout()->photo = true;
             $gallery = new FM_Components_Widgets_PhotoGallery($this->view, $this->_request->getParam('id'), 'photogallery', $siteAdmin);
         }
         if ($common['video']) {
             $this->view->layout()->video = true;
             $videoGallery = new FM_Components_Widgets_VideoGallery($this->view, $this->_request->getParam('id'), 'videogallery', $siteAdmin);
         }
     }
     if (!$sportsuser) {
         $signIn = new FM_Components_Tabs_SportsSignIn($this->_request->getParam('id'), $this->_business->isProtected() && !$this->_user);
         $tg->addTab($signIn, 'signin', 'signin', $this->_business->isProtected() && !$this->_user);
     }
     if ($siteAdmin) {
         $adminTab = new FM_Components_Tabs_Admin();
         $admin = new FM_Components_Widgets_Admin($this->view, $this->_business->getOrgConfig(), $this->_business);
         $adminTab->setProfile($admin->toHTML());
         $tg->addTab($adminTab, 'admin', 'admin');
     }
     $this->view->layout()->profiletab = $tg->toHTML();
     $this->view->crumb = 'home >> sports >> ' . $this->_business->getName();
     $this->view->content = new FM_Forms_Login();
     $this->view->layout()->logo = $this->_business->getLogoObj()->getFileName();
     $this->view->layout()->miniwebBanner = $mw = $this->_business->getMiniWebBannerObj()->getFileName();
     $this->view->coupons = $coupons = FM_Components_Coupon::getOrgCoupons($this->_request->getParam('id'));
     $this->view->pageId = 'sports';
 }
 public function indexAction()
 {
     $this->_helper->layout->setLayout('layout2col');
     $this->view->layout()->cols = 2;
     if ($this->_request->getParam('id') == 0 || !($this->_business = new FM_Components_Business(array('id' => $this->_request->getParam('id'))))) {
         $this->_redirect('/');
     }
     if (!$this->_business->getId()) {
         $this->_redirect('/');
     }
     if ($this->_business->getType() == 4) {
         $this->_redirect('/sports/' . $this->_request->getParam('id'));
     }
     if ($this->_business->getType() == 3) {
         $this->_redirect('/org/' . $this->_request->getParam('id'));
     }
     if (!$this->_business->getCategory()) {
         //$this->_redirect ( '/' );
     }
     //print_r($this->_business);exit;
     $this->view->orgId = $this->_request->getParam('id');
     $orgConfig = $this->_business->getOrgConfig();
     $common = $orgConfig->getTabs();
     $siteAdmin = false;
     //print_r($this->_user->getOrgId());exit;
     if ($this->_user && ($this->_user->inOrg($this->_request->getParam('id')) || $this->_user->isRoot() || $this->_user->frontEndAdmin() && !stristr($_SERVER['REQUEST_URI'], 'root'))) {
         //user is admin for this group, show edit
         $siteAdmin = true;
     }
     if (!$this->_user && !$this->_business->getActive()) {
         $this->_redirect('/');
     }
     if (!$this->_business->getActive() && !($this->_user->isRoot() || $this->_user->frontEndAdmin())) {
         $this->_redirect('/');
     }
     //print_r($this->_business->getCategories()); exit;
     $banners = FM_Components_Banner::getSortedRandomBanners($this->_business->getCategories());
     //exit;
     $this->view->layout()->banners = $this->view->partial('banner/bannerleftindex.phtml', array('banners' => $banners));
     $gallery = new FM_Components_Widgets_PhotoGallery($this->view, $this->_request->getParam('id'), 'photogallery', $siteAdmin);
     $this->view->layout()->leftcol = $this->view->partial('b2b/leftcol.phtml', array('orgdata' => $this->view->partial('widgets/profile/synop.phtml', array('org' => $this->_business)), 'banners' => $banners));
     $tg = new FM_Components_Tabs_TabGroup();
     $tab = new FM_Components_Tabs_Profile();
     $tab->setProfile($this->_business->get('description'));
     $tg->addTab($tab, 'profile', 'profile', true);
     if ($common['menu']) {
         $menu = new FM_Components_Tabs_Menu($this->_request->getParam('id'), $siteAdmin);
         $tg->addTab($menu, 'menu', 'mmenu', false);
     }
     if ($common['services']) {
         $services = new FM_Components_Tabs_Services($this->_request->getParam('id'));
         $tg->addTab($services, 'services', 'mservices', false);
     }
     if ($common['products']) {
         $pl = new FM_Components_Tabs_ProductList($this->_request->getParam('id'), $siteAdmin);
         $tg->addTab($pl, 'products', 'products', false);
     }
     if ($common['realestate']) {
         $rel = new FM_Components_Tabs_RealEstateList($this->_request->getParam('id'), $siteAdmin);
         $tg->addTab($rel, 'r/e listings', 'realestate', false);
     }
     if ($common['coupons']) {
         $coupons = new FM_Components_Tabs_Coupons($this->_request->getParam('id'));
         $tg->addTab($coupons, 'coupons', 'coupons', false);
         if ($this->_user) {
             $b2bcoupons = new FM_Components_Tabs_B2BCoupons($this->_request->getParam('id'));
             $tg->addTab($b2bcoupons, 'b2bcoupons', 'b2bcoupons', false);
         }
     }
     if ($common['media']) {
         $media = new FM_Components_Tabs_Media($this->_request->getParam('id'));
         $media->setProfile('This is the profile tab');
         $tg->addTab($media, 'media', 'media', false);
     }
     if ($common['events']) {
         // CALENDAR TAB!!!!
         $calendarTab = new FM_Components_Tabs_Calendar($this->_request->getParam('id'));
         $tg->addTab($calendarTab, 'events', 'calendar', false);
     }
     if ($common['reviews']) {
         $dir = new FM_Components_Tabs_Testimonials($this->_request->getParam('id'));
         $dir->setProfile('these are directions');
         $tg->addTab($dir, 'reviews', 'testimonials', false);
     }
     /**
     		if($common['forum']) {
     			$forum = new FM_Components_Tabs_Forum($this->_request->getParam ( 'id' ), $siteAdmin);
     			$tg->addTab($forum, 'forum', 'forum', false);
     		}
     		**/
     if ($common['directions']) {
         $dir = new FM_Components_Tabs_Directions($this->_business);
         $dir->setProfile('these are directions');
         $tg->addTab($dir, 'directions', 'directions', false);
     }
     if ($common['contact']) {
         $dir = new FM_Components_Tabs_Contact($this->_request->getParam('id'));
         $dir->setProfile('these are directions');
         $tg->addTab($dir, 'contact us', 'contact', false);
     }
     $this->view->video = false;
     $this->view->photo = false;
     if ($common['media']) {
         $this->view->layout()->photo = true;
         $gallery = new FM_Components_Widgets_PhotoGallery($this->view, $this->_request->getParam('id'), 'photogallery', $siteAdmin);
     }
     if ($common['video']) {
         $this->view->layout()->video = true;
         $videoGallery = new FM_Components_Widgets_VideoGallery($this->view, $this->_request->getParam('id'), 'videogallery', $siteAdmin);
     }
     if ($siteAdmin) {
         $adminTab = new FM_Components_Tabs_Admin();
         $admin = new FM_Components_Widgets_Admin($this->view, $this->_business->getOrgConfig(), $this->_business);
         $adminTab->setProfile($admin->toHTML());
         $tg->addTab($adminTab, 'admin', 'admin');
     }
     $this->view->layout()->profiletab = $tg->toHTML();
     $this->view->layout()->logo = $this->_business->getLogoObj()->getFileName();
     $this->view->layout()->miniwebBanner = $mw = $this->_business->getMiniWebBannerObj()->getFileName();
     $this->view->crumb = 'home >> business >> ' . $this->_business->getName();
     $this->view->content = new FM_Forms_Login();
     $this->view->coupons = $coupons = FM_Components_Coupon::getOrgCoupons($this->_request->getParam('id'));
     $this->view->pageId = 'b2b';
 }
 function orgsAction()
 {
     $this->view->results = null;
     if ($_POST || $_GET && array_key_exists('all', $_GET)) {
         //print_r($_POST);exit;
         $search = FM_Components_Search::getInstance();
         $search->setType(3);
         if ($_POST) {
             foreach ($_POST as $key => $value) {
                 if (stristr($key, 'region')) {
                     $regionId = explode('_', $key);
                     $search->addRegion($regionId[2]);
                     continue;
                 }
                 if (stristr($key, 'all')) {
                     $regionId = explode('_', $key);
                     $all[] = $regionId[2];
                     continue;
                 }
                 if (stristr($key, 'town')) {
                     $townId = explode('_', $key);
                     if ($townId[2] != 0) {
                         $search->addTown($townId[2]);
                     }
                     continue;
                 }
                 if (stristr($key, 'category')) {
                     $categoryId = explode('_', $key);
                     if ($categoryId[2] != 0) {
                         $search->addCategory($categoryId[2]);
                     }
                     continue;
                 }
                 if ($key == 'keyword') {
                     $search->setKeywords(explode(',', $value));
                     continue;
                 }
                 if ($key == 'zip') {
                     $search->setZipcode($value);
                 }
             }
         }
         $results = $search->doNpSearch();
         $objs = array();
         if ($resultsTotal = count($results)) {
             //print_r($results);
             foreach ($results as $index => $values) {
                 switch ($values['type']) {
                     case 3:
                         $obj = $values;
                         $icon = new FM_Components_Util_Icon(array('orgId' => $values['id']));
                         $obj['icon'] = $icon->getFileName();
                         $objs[] = $obj;
                         break;
                     case 4:
                         $obj = $values;
                         $icon = new FM_Components_Util_Icon(array('orgId' => $values['id']));
                         $obj['icon'] = $icon->getFileName();
                         $obj['type'] = 4;
                         $objs[] = $obj;
                         break;
                 }
             }
             $banners = FM_Components_Banner::getSortedRandomBanners();
             $banners = $this->view->partial('banner/bannerleftindex.phtml', array('banners' => $banners));
             $this->view->results = $this->view->partial('search/results.phtml', array('clients' => $objs, 'total' => $resultsTotal, 'banners' => $banners, 'type' => 'org'));
         } else {
             $this->view->noResults = true;
         }
     }
     $this->_helper->layout->setLayout('singlecolumn');
     $this->view->layout()->cols = 1;
     $this->view->cats = $this->view->partial('search/categories.phtml', array('cats' => FM_Components_Util_Category::getSortedSearchCategories(true)));
     $this->view->towns = $this->view->partial('search/towns.phtml', array('towns' => FM_Components_Util_Town::getAll()));
     $this->view->orgsearch = true;
 }
 function indexAction()
 {
     $this->_helper->layout->setLayout('layout2col');
     $this->view->layout()->cols = 2;
     if ($this->_request->getParam('id') == 0 || !($org = new FM_Components_Organization(array('id' => $this->_request->getParam('id'))))) {
         $this->_redirect('/');
     }
     if ($org->getType() == 2) {
         $this->_redirect('/merchant/' . $this->_request->getParam('id'));
     }
     if ($org->getType() == 4) {
         $this->_redirect('/sports/' . $this->_request->getParam('id'));
     }
     if (!$this->_user && !$org->getActive()) {
         $this->_redirect('/');
     }
     if (!$org->getActive() && !($this->_user->isRoot() || $this->_user->frontEndAdmin())) {
         $this->_redirect('/');
     }
     $this->view->orgId = $this->_request->getParam('id');
     $orgConfig = $org->getOrgConfig();
     $siteAdmin = false;
     if ($this->_user && ($this->_user->inOrg($this->_request->getParam('id')) || $this->_user->isRoot())) {
         //user is admin for this group, show edit
         $siteAdmin = $this->_user;
     }
     //$gallery = new FM_Components_Widgets_PhotoGallery($this->view, $this->_request->getParam ( 'id' ), 'photogallery', $siteAdmin);
     $banners = FM_Components_Banner::getSortedRandomBanners(array(), 3);
     $this->view->layout()->banners = $this->view->partial('banner/bannerleftindex.phtml', array('banners' => $banners));
     $this->view->layout()->leftcol = $this->view->partial('orgs/leftcol.phtml', array('orgdata' => $this->view->partial('widgets/profile/synop.phtml', array('org' => $org)), 'banners' => $banners));
     $tg = new FM_Components_Tabs_TabGroup();
     $org = new FM_Components_Organization(array('id' => $this->_request->getParam('id')));
     $tab = new FM_Components_Tabs_Profile();
     $tab->setProfile($org->get('description'));
     $tg->addTab($tab, 'profile', 'profile', true);
     $common = $orgConfig->getTabs();
     //print_r($common);exit;
     if ($common['services']) {
         $services = new FM_Components_Tabs_Services($this->_request->getParam('id'));
         $tg->addTab($services, 'services', 'mservices', false);
     }
     if ($common['products']) {
         $pl = new FM_Components_Tabs_ProductList($this->_request->getParam('id'), $siteAdmin);
         $tg->addTab($pl, 'products', 'products', false);
     }
     if ($common['media'] || $common['video']) {
         $media = new FM_Components_Tabs_Media($this->_request->getParam('id'));
         $media->setProfile('This is the profile tab');
         $tg->addTab($media, 'media', 'media', false);
     }
     /**
     		if($common['video']) {
     			$media = new FM_Components_Tabs_Media($this->_request->getParam ( 'id' ));
     			$media->setProfile('This is the profile tab');
     			$tg->addTab($media, 'media', 'media', false);
     		}
     		**/
     if ($common['events']) {
         // CALENDAR TAB!!!!
         $calendarTab = new FM_Components_Tabs_Calendar($this->_request->getParam('id'));
         $tg->addTab($calendarTab, 'events', 'calendar', false);
     }
     if ($common['reviews']) {
         $dir = new FM_Components_Tabs_Testimonials($this->_request->getParam('id'));
         $dir->setProfile('these are directions');
         $tg->addTab($dir, 'reviews', 'testimonials', false);
     }
     if ($common['forum']) {
         $forum = new FM_Components_Tabs_Forum($this->_request->getParam('id'), $siteAdmin);
         $tg->addTab($forum, 'forum', 'forum', false);
     }
     if ($common['directions']) {
         $dir = new FM_Components_Tabs_Directions($org);
         $dir->setProfile('these are directions');
         $tg->addTab($dir, 'directions', 'directions', false);
     }
     if ($common['contact']) {
         $dir = new FM_Components_Tabs_Contact($this->_request->getParam('id'));
         $dir->setProfile('these are directions');
         $tg->addTab($dir, 'contact us', 'contact', false);
     }
     $this->view->video = false;
     $this->view->photo = false;
     if ($common['media']) {
         $this->view->layout()->photo = true;
         $gallery = new FM_Components_Widgets_PhotoGallery($this->view, $this->_request->getParam('id'), 'photogallery', $siteAdmin);
     }
     if ($common['video']) {
         $this->view->layout()->video = true;
         $videoGallery = new FM_Components_Widgets_VideoGallery($this->view, $this->_request->getParam('id'), 'videogallery', $siteAdmin);
     }
     //$tg->addTab($videoGallery , 'videogallery', 'videogallery', false);
     //print_r($videoGallery);exit;
     /**
     		if($common['testimonials']) {
     			$dir = new FM_Components_Tabs_Testimonials($this->_request->getParam ( 'id' ));
     			$dir->setProfile('these are directions');
     			$tg->addTab($dir, 'testimonials', 'testimonials', false);
     		}
     		**/
     if ($siteAdmin) {
         $adminTab = new FM_Components_Tabs_Admin();
         $admin = new FM_Components_Widgets_Admin($this->view, $orgConfig, $org);
         $adminTab->setProfile($admin->toHTML());
         $tg->addTab($adminTab, 'admin', 'admin');
     }
     $this->view->layout()->logo = $org->getLogoObj()->getFileName();
     $this->view->layout()->miniwebBanner = $mw = $org->getMiniWebBannerObj()->getFileName();
     $this->view->layout()->profiletab = $tg->toHTML();
     $this->view->layout()->comments = $this->view->partial('widgets/askus/contact.phtml');
     $this->view->pageId = 'orgs';
 }