Page 1 of 3 123 LastLast
Results 1 to 10 of 29

Thread: Add delete button to the dashboard with alert window

  1. #1
    Thread Starter
    Junior Member amine0272's Avatar
    Join Date
    Aug 2011
    Location
    United States
    Posts
    20
    Thanks
    2
    Thanked 20 Times in 7 Posts

    Add delete button to the dashboard with alert window

    Hi everyone!

    Note : Before editing the file make sure you have a duplicate
    First is first, I recommend using a child theme part 1 and part 2 tutorials, so you well not lose you changes.

    1. If you are using a child theme copy ( tpl-dashboard.php ) file from parent theme ( classipress ) to child theme (classipress-child) as showing in the image blow
    If not just open ( tpl-dashboard.php ) file in your favorite code editor.

    copy-dashboard.jpg

    3. We have 2 pates of code to inserted

    1 - First part - Build button elements ( text button, action when button clicked, etc ... )

    Code:
    //building delete button elements 
    
    $deltext ='Delete Ad';// Button text
    $delaction = 'trash';// Button action, in this case we want to delete ad listing
    
    // when the button clicked window pops up showing message confirmation
    
    $delonclick ='javascript:if(!confirm(\'Are you sure you want to delete this ad ?\')) return false;';
    Insert the code above, at line 147 blow code
    Code:
    $postaction = 'pause';
    code-part-1.jpg


    2 - Second part - Inserting the actual button
    Insert the code blow at line 258

    code-part-2.jpg

    Code:
    //delete button     
    <a href="<?php echo CP_DASHBOARD_URL; ?>?aid=<?php the_id(); ?>&amp;action=<?php echo $delaction; ?>" onclick="<?php echo $delonclick; ?>" ><?php echo $deltext; ?></a>
    The result should be like this

    Delete Button
    delet-button.jpg

    Window alert
    ad-deletion-alert.jpg

  2. The Following 14 Users Say Thank You to amine0272 For This Useful Post:

    andriuskrutoi (January 17th, 2012), appouser (January 21st, 2012), biosrazor (January 27th, 2012), bursaemlak (March 3rd, 2012), cgatherings (February 9th, 2012), dikiyforester (January 15th, 2012), Fanatic (January 21st, 2012), fid411 (January 15th, 2012), ggriffin (February 20th, 2012), manolake07 (January 18th, 2012), ndlindquist (January 18th, 2012), rozatarra (March 1st, 2012), susie (February 18th, 2012), weiching (January 14th, 2012)

  3. #2
    jomarkosabel's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    40,991
    Thanks
    170
    Thanked 3,409 Times in 3,280 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Please help our moderating team work more efficiently by not sending us support questions via PM. You can read more about how AppThemes support works here. However, you can send a PM to follow up and remind me if I missed your support request/thread.

    Thank you and have a nice day.

  4. #3
    Veteran weiching's Avatar
    Join Date
    Apr 2011
    Posts
    505
    Thanks
    85
    Thanked 43 Times in 38 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  5. #4
    dikiyforester's Avatar
    Join Date
    Oct 2011
    Location
    Russian Federation
    Posts
    2,229
    Thanks
    89
    Thanked 593 Times in 491 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  6. The Following 6 Users Say Thank You to dikiyforester For This Useful Post:

    andriuskrutoi (February 9th, 2012), biosrazor (January 27th, 2012), cgatherings (February 9th, 2012), ggriffin (February 20th, 2012), rozatarra (March 1st, 2012), susie (February 18th, 2012)

  7. #5
    Thread Starter
    Junior Member amine0272's Avatar
    Join Date
    Aug 2011
    Location
    United States
    Posts
    20
    Thanks
    2
    Thanked 20 Times in 7 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  8. #6
    dikiyforester's Avatar
    Join Date
    Oct 2011
    Location
    Russian Federation
    Posts
    2,229
    Thanks
    89
    Thanked 593 Times in 491 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  9. #7
    Junior Member fid411's Avatar
    Join Date
    Dec 2011
    Posts
    32
    Thanks
    3
    Thanked 3 Times in 2 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  10. #8
    Thread Starter
    Junior Member amine0272's Avatar
    Join Date
    Aug 2011
    Location
    United States
    Posts
    20
    Thanks
    2
    Thanked 20 Times in 7 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  11. #9
    Junior Member fid411's Avatar
    Join Date
    Dec 2011
    Posts
    32
    Thanks
    3
    Thanked 3 Times in 2 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  12. #10
    Junior Member fid411's Avatar
    Join Date
    Dec 2011
    Posts
    32
    Thanks
    3
    Thanked 3 Times in 2 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  13. The Following User Says Thank You to fid411 For This Useful Post:

    andriuskrutoi (January 17th, 2012)

Page 1 of 3 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Delete create an account button on homepage widget
    By jpartner in forum ClassiPress General Discussion
    Replies: 2
    Last Post: December 1st, 2011, 12:18 PM
  2. How To Delete Latest Jobs Button
    By bowerboy in forum Report JobRoller Bugs
    Replies: 7
    Last Post: August 24th, 2011, 02:18 AM
  3. How can you delete a coupon from (My) Dashboard?
    By bbrjeff in forum Report Clipper Bugs
    Replies: 1
    Last Post: August 10th, 2011, 07:24 AM
  4. My Dashboard Button
    By gaston in forum ClassiPress General Discussion
    Replies: 2
    Last Post: August 4th, 2011, 10:44 AM
  5. My Dashboard Button missing
    By ffrost3 in forum Report JobRoller Bugs
    Replies: 6
    Last Post: May 24th, 2011, 12:32 AM