Beispiel #1
0
    def leftnav_group_actions(self, current=None):
        """Returns the html for admin actions in the leftnav
		@param current: a string of the current action"""

        selected = None
        counter = 0

        actions = ("Add DHCP Group",)
        action_links = ("/admin/dhcp/groups/add",)

        # Run through our actions list and highlight the currently selected action
        for action in actions:
            if action == current:
                selected = counter
            counter += 1

        return submenu(actions, action_links, "Actions", selected)
Beispiel #2
0
	def leftnav_option_actions(self, gid, current=None):
		'''Returns the html for admin actions in the leftnav
		@param current: a string of the current action'''

		selected = None
		counter = 0

		actions = ('Add DHCP Option to Group', )
		action_links = ('/admin/dhcp/groups/options/add/'+gid,)
		
		# Run through our actions list and highlight the currently selected action
		for action in actions:
			if action == current:
				selected = counter
			counter += 1
			
		return submenu(actions, action_links, "Actions", selected)
Beispiel #3
0
	def leftnav_manage(self, current=None):
		'''Returns the html for admin management in the leftnav
		@param current: a string of the current selection'''

		selected = None
		counter = 0

		actions = ('Users', 'Groups', 'DHCP Groups', 'DHCP Options', 'DNS Resource Record Types', 'Custom Host Attributes', 'System Settings')
		action_links = ('/admin/users', '/admin/groups', '/admin/dhcp/groups', '/admin/dhcp/options', '/admin/dns', '/admin/attr/host', '/admin/sys')
		
		# Run through our actions list and highlight the currently selected action
		for action in actions:
			if action == current:
				selected = counter
			counter += 1
		
		return submenu(actions, action_links, "Manage", selected)
Beispiel #4
0
	def leftnav_view_actions(self, gid, current=None):
		'''Returns the html for admin actions in the leftnav
		@param current: a string of the current action'''

		selected = None
		counter = 0

		actions = ('Add User to Group', 'Add Domain to Group', 'Add Network to Group', 'Add Host to Group')
		action_links = ('/admin/groups/user/add/%s' % gid, '/admin/groups/domain/add/%s' % gid, '/admin/groups/network/add/%s' % gid, '/admin/groups/host/add/%s' % gid)
		
		# Run through our actions list and highlight the currently selected action
		for action in actions:
			if action == current:
				selected = counter
			counter += 1
			
		return submenu(actions, action_links, "Actions", selected)
Beispiel #5
0
    def leftnav_manage(self, current=None):
        '''Returns the html for admin management in the leftnav
		@param current: a string of the current selection'''

        selected = None
        counter = 0

        actions = ('Users', 'Groups', 'DHCP Groups', 'DHCP Options',
                   'DNS Resource Record Types', 'Custom Host Attributes',
                   'System Settings')
        action_links = ('/admin/users', '/admin/groups', '/admin/dhcp/groups',
                        '/admin/dhcp/options', '/admin/dns',
                        '/admin/attr/host', '/admin/sys')

        # Run through our actions list and highlight the currently selected action
        for action in actions:
            if action == current:
                selected = counter
            counter += 1

        return submenu(actions, action_links, "Manage", selected)