Ejemplo n.º 1
0
 def render(self, context):
     user_isLogged = self.user_isLogged.resolve(context)
     user_id       = self.user_id.resolve(context) 
     
     activeCategories = get_active_categories('limit 7')
     active_categories = ''
     if len(activeCategories) > 0:
         for category_row in activeCategories:	
             if len(category_row[1]) > 10:
                 category_title = category_row[1][0:15]+'...'
             else:
                 category_title = category_row[1]
             active_categories += '<li>'
             active_categories += '<a href="/forum/?cat_id='+category_row[0]+'/" class="ac_cat_list" title="'+category_row[1]+'" >'+category_title+'</a>'
             if user_isLogged:
                 if category_row[4] == user_id:
                     if category_row[7]:
                         append_link = 'unlock'
                     else:
                         append_link = 'lock'
                     #active_categories += '<span id="edit_link_span"><a href="/forum/editcategory/'+category_row[0]+'/"><img src="../media/images/edit-icon.jpeg"/></a>  <a href="/'+append_link+'topic/'+ category_row[0] +'"><img src="../media/images/'+append_link+'-icon.png"/></a>  <a href="/forum/deletecategory/'+category_row[0]+'/"><img src="../media/images/delete-icon.jpeg" width="10px" height="10px"/></a></span>'
                     active_categories += '<span id="edit_link_span"><a href="/forum/editcategory/'+category_row[0]+'/" title="Click to edit category" ><img src="../media/images/edit-icon.jpeg"/></a>  <a href="/'+append_link+'topic/'+ category_row[0] +'" ><img src="../media/images/'+append_link+'-icon.png"/></a>  <span onClick="deleteActiveCategory(\''+category_row[0]+'\');" class="delete_link" title="Click to delete category"><img src="../media/images/delete-icon.jpeg" width="10px" height="10px"/></span></span>'
             active_categories += '</li>'
     elif len(activeCategories) == 0:
         active_categories += '<br/><br/><center><i>No records found.</i></center></br/></br/>'        
     return active_categories
Ejemplo n.º 2
0
 def render(self, context):
     user_isLogged       = self.user_isLogged.resolve(context)
     user_id             = self.user_id.resolve(context) 
     topic_id            = self.topic_id.resolve(context)
     topic_is_locked     = self.topic_is_locked.resolve(context)
     thread_id           = self.thread_id.resolve(context)
     data_limit           = self.data_limit.resolve(context)
     
     if not data_limit is None:
         activeCategories = get_active_categories(data_limit)
     elif data_limit is None:
         activeCategories = get_active_categories('')    
     active_categories = ''
     if len(activeCategories) > 0:
         for category_row in activeCategories:  
             if topic_id == category_row[0]:
                 style = 'style = "color:#8AAA3F"'
             else:
                 style=''      
             #active_categories += '<li><span onclick="getForumContentByTopic(\''+category_row[0]+'\')" class="ac_cat_list">'+category_row[1].capitalize()+'</span></li>'
             if len(category_row[1]) > 10:
                 category_title = category_row[1][0:15]+'...'
             else:
                 category_title = category_row[1]
             active_categories += '<li>'
             active_categories += '<a href="/forum/?cat_id='+category_row[0]+'/" class="ac_cat_list" title="'+category_row[1]+'" '+style+'>'+category_title+'</a>'
             if user_isLogged:
                 if category_row[4] == user_id:
                     if category_row[7]:
                         append_link = 'unlock'
                     else:
                         append_link = 'lock'
                     if not thread_id is None:
                         thread_link_id = "/" + thread_id
                     else:
                         thread_link_id = "/"             
                     if len(data_limit)> 0:
                         active_categories += '<span id="edit_link_span"><a href="/forum/editcategory/'+category_row[0]+'/'+topic_id+thread_link_id+'" title="Click to edit category"><img src="/media/images/edit-icon.jpeg"/></a>  <a href="/'+append_link+'topic/'+ category_row[0] +'/'+ topic_id +'/True"><img src="/media/images/'+append_link+'-icon.png"/></a>  <span onClick="deleteCategory(\''+category_row[0]+'\',\''+topic_id+'\',\''+thread_id+'\');" class="delete_link" title="Click to delete category"><img src="/media/images/delete-icon.jpeg" width="10px" height="10px"/></span></span>'
                     elif len(data_limit)== 0:
                         if topic_id:
                             active_categories += '<span id="edit_link_span"><a href="/forum/editcategory/'+category_row[0]+'/community/" title="Click to edit category" ><img src="/media/images/edit-icon.jpeg"/></a>  <a href="/'+append_link+'topic/'+ category_row[0] +'/'+ topic_id +'/True"><img src="/media/images/'+append_link+'-icon.png"/></a><span onClick="deleteCategory(\''+category_row[0]+'\',\'forums\',\'\');" class="delete_link" title="Click to delete category"><img src="/media/images/delete-icon.jpeg" width="10px" height="10px"/></span></span>'    
                         else:
                             active_categories += '<span id="edit_link_span"><a href="/forum/editcategory/'+category_row[0]+'/view-all/" title="Click to edit category" ><img src="/media/images/edit-icon.jpeg"/></a>  <a href="/'+append_link+'topic/'+ category_row[0] +'/view-all/True/"><img src="/media/images/'+append_link+'-icon.png"/></a><span onClick="deleteCategory(\''+category_row[0]+'\',\'view\',\'\');" class="delete_link" title="Click to delete category"><img src="/media/images/delete-icon.jpeg" width="10px" height="10px"/></span></span>'   
             active_categories += '</li>'
     elif len(activeCategories) == 0:
         active_categories += '<br/><br/><center><i>No Records Found</i></center><br/><br/><br/>'
     return active_categories